Commit Graph

33 Commits

Author SHA1 Message Date
Sam Rawlins 2c13c7ea80 analyzer: Enforce avoid_dynamic_calls lint
Change-Id: I496ed3abbb29ebef14542636aaf1b878f3420740
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192288
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-03-22 18:47:14 +00:00
Konstantin Shcheglov 46e4363df5 Enforce lint: always_use_package_imports
Change-Id: Ib7c9f2b4fe3d3d1a874f97f73def6ba1ffaf911e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/187360
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-02-25 16:57:16 +00:00
Konstantin Shcheglov 7ec28c3f08 Enforce await_only_futures and fix violations.
R=brianwilkerson@google.com

Change-Id: Icfc093d46562ddc7084151e76f495cc1462bb900
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/164257
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-09-24 14:28:00 +00:00
Sam Rawlins f28fb78e8f Analyzer: Use 3 upcoming pedandic lints
Change-Id: I7bd1d856024feee5c4e3ab346a46db059b692b53
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/163160
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2020-09-17 16:20:42 +00:00
Sam Rawlins d169af6f7d Analyzer: remove unnecessary this
Change-Id: I85a769e0c32159ac2a6422d3a60d160bda40d9b4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/156488
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2020-08-01 06:16:31 +00:00
Sam Rawlins 041e0dd618 Analyzer: Enforce strict-inference
Change-Id: Iba49bfa7cf10f8a3b1d3be03e73fdca280f0940a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/155062
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2020-07-22 00:44:55 +00:00
Konstantin Shcheglov b09dd47d38 Enforce prefer_typing_uninitialized_variables lint.
R=brianwilkerson@google.com

Change-Id: Icfe4a24a6e69ab08f4743502ae88f94ab9cd8c8a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153951
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-07-10 16:19:07 +00:00
Konstantin Shcheglov f2cbec8010 Check for unnecessary_parenthesis in analyzer.
R=brianwilkerson@google.com

Change-Id: I2e8af156a190b51741d60fdb0217101c15306a79
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153622
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-07-08 21:46:16 +00:00
Sam Rawlins bda4994482 Analyzer: Finish using ///-style comments.
This ignores the Lint on a few files where it is undesired.

Change-Id: I5e4244607da0ef60678cebb89a433e44cb1e753f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153180
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2020-07-06 00:54:10 +00:00
Sam Rawlins 6bf946bbfc analyzer: Always declare return types.
Change-Id: I23d89bb572310a1a8deef8e173630d9bb59c9a50
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152708
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2020-06-26 23:54:28 +00:00
Parker Lougheed cad7b26b47 [pkg/analyzer] Update pedantic to 1.9.0
Change-Id: I1161ed0c4681ddc8d2bd494586a9442a2ce1c4e7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149120
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-06-02 21:41:03 +00:00
Sam Rawlins 478a8f2a16 analyzer: Do not report non-EOL doc comments in codes.dart
This codifies Brian's comment on a recent CL [1].

[1] https://dart-review.googlesource.com/c/sdk/+/145571/2/pkg/analyzer/lib/src/error/codes.dart#5496

Change-Id: Ie9def6fe9979e57b77ee951d38c701d6300fad26
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/147041
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2020-05-08 08:10:49 +00:00
Konstantin Shcheglov 7161036eb7 Fix avoid_unused_constructor_parameters in analyzer.
Bug: https://github.com/dart-lang/sdk/issues/41797
Change-Id: I6fb201b549a599b12d022abd6108d3418966c4f0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/147221
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2020-05-08 04:44:58 +00:00
Konstantin Shcheglov 8a0d30d4e2 Fix annotate-overrides in analyzer.
R=brianwilkerson@google.com

Change-Id: I7a587daf9715ded6450b28ecf3892ce4181aeb37
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129421
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-12-23 00:02:37 +00:00
Sam Rawlins 2d332ee1d3 Make private fields final where possible
Change-Id: I16ee52f1b23e8d708e40cb482c5150f1e04d2417
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128524
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-12-17 06:12:39 +00:00
Konstantin Shcheglov 4b21941d33 Fix prefer_iterable_wheretype in analyzer.
R=brianwilkerson@google.com

Change-Id: Id683ec62a7bdfddb5b2662afbcf57d884767a736
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127454
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-12-06 15:54:10 +00:00
Konstantin Shcheglov 54e1c16c1c Fix empty_catches in analyzer.
R=brianwilkerson@google.com

Change-Id: I6abc5acbd93aa12df8ff6226c49f9b72c0313c92
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127426
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-12-06 15:03:30 +00:00
Konstantin Shcheglov 54b7543c55 Fix unnecessary_const in analyzer.
The only non-mechanical change is update for tool/diagnostics/generate.dart
to handle MethodInvocation, because without resolution and without
explicit `new` and `const` we get MethodInvocation(s).

R=brianwilkerson@google.com

Change-Id: Ib89ce9c37066e9b27ad03aed96b349ef36f11d43
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127453
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-12-06 15:03:00 +00:00
Konstantin Shcheglov 0bca6aaf10 Fix avoid_return_types_on_setters in analyzer.
R=brianwilkerson@google.com

Change-Id: If7132980451d76c777d3734abbb89ece5ad3e3d8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127425
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-12-06 01:48:48 +00:00
Konstantin Shcheglov 364dd8936b Fix unnecessary_new in analyzer.
R=brianwilkerson@google.com

Change-Id: I70f80baa3da4b14c0a52c1f28da16a9ad26d7dda
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127424
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-12-06 01:11:30 +00:00
Konstantin Shcheglov eee20b4e60 Fix prefer_equal_for_default_values in analyzer.
Change-Id: Ia72a2ac31d6cf6329c78baad6954ac9595a6c45a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127448
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-12-06 00:00:30 +00:00
Konstantin Shcheglov f772b572c8 Fix curly_braces_in_flow_control_structures lint.
R=brianwilkerson@google.com, paulberry@google.com

Change-Id: I63cb372bf04f80182f873e2143971cb3cf1392fe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127447
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-12-05 23:46:13 +00:00
Konstantin Shcheglov 3f65652ad0 Enable avoid_init_to_null.
R=brianwilkerson@google.com

Change-Id: I983fdff71c47dbf2b271508955095a73cfbeee59
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119380
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-09-30 14:26:06 +00:00
Konstantin Shcheglov a006914279 Enable prefer_contains and no_duplicate_case_values.
R=brianwilkerson@google.com

Change-Id: I2ad2754b587c00d40811f6e5710b30d9111b828a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119361
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-09-30 14:25:36 +00:00
Devon Carew 40cc975932 Increase the severity of the unused_import hint (to a warning).
Change-Id: Ie65eb7e9c0f48c54a1c537e821c88a5ea8451266
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119101
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2019-09-27 02:10:22 +00:00
Sam Rawlins 344b30e8ce Enable pedantic 1.8.0 in analyzer, analysis_server
Since some pedantic issues were individually enabled, this CL turns our
analysis_options files into something more like "pedantic lints,
except ...". Effectively, this _adds_ the following lint rules:

* avoid_empty_else
* avoid_relative_lib_imports
* avoid_shadowing_type_parameters
* avoid_types_as_parameter_names
* library_names
* library_prefixes
* null_closures
* prefer_contains
* recursive_getters
* type_init_formals
* unnecessary_null_in_if_null_operators
* unrelated_type_equality_checks
* use_rethrow_when_possible

It also documents (for some rules) how many violations certain rules have.

Change-Id: I79a2c101ae4d10215d3f232d9e511bf8e6c7faa4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118720
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-09-25 19:08:03 +00:00
pq b686e1b84d unawaited futures
Change-Id: I4f8273dd461483c178d47c659b9be062cd673f27
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118602
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-09-24 23:42:24 +00:00
Devon Carew f53388b50d [analyzer] enable implicit-casts: false for several projects
Change-Id: Idd7ed77756d93a94f637dcc4abd7e0403a2f6d81
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112703
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-08-13 16:26:41 +00:00
pq 8f90265176 de-lint collection size checks
Change-Id: Id8e7ce2ec59ad7cd2b0b9c961594a37d4fef621a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108522
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2019-07-10 13:46:43 +00:00
Devon Carew 11e001595a Update analysis options files.
Change-Id: I06b659b5ee7105d3f11343259f787194f1d2bd79
Reviewed-on: https://dart-review.googlesource.com/63501
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2018-07-03 00:20:06 +00:00
Brian Wilkerson e28064f405 Restore partial analysis of analysis options files
R=devoncarew@google.com

Review-Url: https://codereview.chromium.org/2946313003 .
2017-06-22 08:00:50 -07:00
Brian Wilkerson b928683560 Add a couple of lints to the options files
R=devoncarew@google.com

Review-Url: https://codereview.chromium.org/2933713002 .
2017-06-11 09:12:48 -07:00
danrubel c8784af933 rename .analysis_options --> analysis_options.yaml
See https://github.com/dart-lang/sdk/issues/28385

R=brianwilkerson@google.com, vsm@google.com

Review-Url: https://codereview.chromium.org/2839383003 .
2017-04-30 18:33:10 -04:00