This repository has been archived by the owner on Feb 4, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 272
Ignore non_constant_identifier_names, camel_case_types in generated (.g.dart) files #222
Comments
You can also ignore generated files with an analyzer:
exclude:
- '**/*.g.dart' |
Yes. That is much cleaner. This probably has to be added manually on a case-by-case basis though? So maybe it could be added to the documentation as an option? |
This sounds like something the readme could point out, yes :) Do you want to open a PR for that? |
Sure, can do that tomorrow |
vinicentus
added a commit
to vinicentus/web3dart
that referenced
this issue
Nov 26, 2021
Add note about suppressing analyzer warnings for generated files. Closes simolus3#222
Created a PR |
simolus3
pushed a commit
that referenced
this issue
Nov 26, 2021
Add note about suppressing analyzer warnings for generated files. Closes #222
mjkim
pushed a commit
to mjkim/web3dart
that referenced
this issue
Dec 10, 2021
Add note about suppressing analyzer warnings for generated files. Closes simolus3#222 (cherry picked from commit 4b809ec)
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I would like to propose that we automatically include the comment
// ignore_for_file: non_constant_identifier_names, camel_case_types
in the beginning of every file generated usingpub run build_runner build
. That way, dart doesn't complain about Name non-constant identifiers using lowerCamelCase and Name types using UpperCamelCase. The rationale behind this suggestion is that the smart contracts, written in another language and perhaps with other naming conventions, shouldn't have to conform to dart's standards, as long as they still work.This would be especially useful in large projects with multiple contract classes.
If you think this suggestion makes sense, I can create a PR.
RELATED:
Naming can however become a problem, as is evident in #213. In that special case, functions outright won't be acessible from outside the file. Then we might need to actually rename a function (starting with _), or create a public wrapper funtion.
The text was updated successfully, but these errors were encountered: