Skip to content
This repository was archived by the owner on Feb 4, 2022. It is now read-only.

Commit 4b809ec

Browse files
authored
note about analyzer warnings in generated files (#223)
Add note about suppressing analyzer warnings for generated files. Closes #222
1 parent a63b113 commit 4b809ec

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,21 @@ pub run build_runner build
137137

138138
You'll now find a `.g.dart` file containing code to interact with the contract.
139139

140+
#### Optional: Ignore naming suggestions for generated files
141+
142+
If importing contract ABIs with function names that don't follow dart's naming conventions, the dart analyzer will (by default) be unhappy about it, and show warnings.
143+
This can be mitigated by excluding all the generated files from being analyzed.
144+
Note that this has the side effect of suppressing serious errors as well, should there exist any. (There shouldn't as these files are automatically generated).
145+
146+
Create a file named `analysis_options.yaml` in the root directory of your project:
147+
```
148+
analyzer:
149+
exclude:
150+
- '**/*.g.dart'
151+
```
152+
153+
See [Customizing static analysis](https://dart.dev/guides/language/analysis-options) for advanced options.
154+
140155
## Feature requests and bugs
141156

142157
Please file feature requests and bugs at the [issue tracker][tracker].

0 commit comments

Comments
 (0)