Skip to content

Commit

Permalink
note about analyzer warnings in generated files (simolus3#223)
Browse files Browse the repository at this point in the history
Add note about suppressing analyzer warnings for generated files.

Closes simolus3#222

(cherry picked from commit 4b809ec)
  • Loading branch information
vinicentus authored and mjkim committed Dec 10, 2021
1 parent 9599f79 commit d326396
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,21 @@ pub run build_runner build

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

#### Optional: Ignore naming suggestions for generated files

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.
This can be mitigated by excluding all the generated files from being analyzed.
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).

Create a file named `analysis_options.yaml` in the root directory of your project:
```
analyzer:
exclude:
- '**/*.g.dart'
```

See [Customizing static analysis](https://dart.dev/guides/language/analysis-options) for advanced options.

## Feature requests and bugs

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

0 comments on commit d326396

Please sign in to comment.