commit | 8eee2377278ef0933f5e0bab38412a6559b91a6f | [log] [tgz] |
---|---|---|
author | David Morgan <davidmorgan@google.com> | Sun May 12 11:10:14 2019 -0600 |
committer | GitHub <noreply@github.com> | Sun May 12 11:10:14 2019 -0600 |
tree | 9da3684bcc6a294cbe012deac27145c2f4726910 | |
parent | 59e9d4a55d5890589429b6f1b66613a1cd6305a0 [diff] |
Update README.md Fix recommendation so we don't pin to one version; that's no longer needed as the files are versioned in the package.
This package serves three purposes:
README.md
.analysis_options.yaml
.Note that everything here fits within the guidelines set out in Effective Dart. You could think of that document as the design and this package as one possible partial implementation.
Here is how static analysis is used internally at Google:
TODO
hint is a permanent exception.unnecessary_no_such_method
, unused_element
, unused_field
and unused_local_variable
are allowed.The currently enabled lints can be found in analysis_options.1.7.0.yaml.
To use the lints add a dependency in your pubspec.yaml
:
# If you use `package:pedantic/pedantic.dart`, add a normal dependency. dependencies: pedantic: ^1.7.0 # Or, if you just want `analysis_options.yaml`, it can be a dev dependency. dev_dependencies: pedantic: ^1.7.0
then, add an include in your analysis_options.yaml
. If you want to always use the latest version of the lints, add a dependency on the main analysis_options
file:
include: package:pedantic/analysis_options.yaml
If your continuous build and/or presubmit check lints then they will likely fail whenever a new version of package:pedantic
is released. To avoid this, specify a specific version of analysis_options.yaml
instead:
include: package:pedantic/analysis_options.1.7.0.yaml
The following lints have been considered and will not be enforced:
always_put_control_body_on_new_line
violates Effective Dart “DO format your code using dartfmt”. See note about Flutter SDK style below.
always_specify_types
violates Effective Dart “AVOID type annotating initialized local variables” and others. See note about Flutter SDK style below.
avoid_as
does not reflect standard usage. See note about Flutter SDK style below.
control_flow_in_finally
does not offer enough value: people are unlikely to do this by accident, and there are occasional valid uses.
empty_statements
is superfluous, enforcing use of dartfmt
is sufficient to make empty statements obvious.
prefer_bool_in_asserts
is obsolete in Dart 2; bool is required in asserts.
prefer_final_locals
does not reflect standard usage.
throw_in_finally
does not offer enough value: people are unlikely to do this by accident, and there are occasional valid uses.
Note on Flutter SDK Style: some lints were created specifically to support Flutter SDK development. Flutter app developers should instead use standard Dart style as described in Effective Dart, and should not use these lints.
Please file feature requests and bugs at the issue tracker.