Commit Graph

63 Commits

Author SHA1 Message Date
Paul Berry 07669ab650 [messages] Remove HintCode.deprecatedMemberUseFromSamePackage*.
Removes the diagnostic codes
`HintCode.deprecatedMemberUseFromSamePackage` and
`HintCode.deprecatedMemberUseFromSamePackageWithMessage`, and the
logic for reporting them. These hint codes have been replaced with
lints.

Removing these diagnostic codes avoids an ambiguity between
`HintCode.deprecatedMemberUseFromSamePackageWithMessage` and
`LinterLintCode.deprecatedMemberUseFromSamePackageWithMessage`.

Avoiding ambiguities like these is important, because in many cases
the user only sees the diagnostic name; they don't see the class it's
in. For example, `ignore:` comments just give the diagnostic name, and
the web page https://dart.dev/tools/diagnostics only shows diagnostic
names.

In the future I intend to add an error check to the analyzer
diagnostic code generator, to ensure that there are no ambiguities
like these. This CL is a prerequisite for adding the error check.

To avoid this change causing `ignore:` comments to become unnecessary
(which would break bots), I've enabled the lint
`deprecated_member_use_from_same_package` in `pkg/analysis_server`,
`pkg/analyzer`, `pkg/compiler`, and `pkg/linter`. After this change
lands, I will work with the owners of those packages to determine
whether it's better to keep the lint enabled or to remove the
`ignore:` comments.

Change-Id: I6a6a6964aa7f69a41b9b815e0f50fc638898f104
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/455541
Reviewed-by: Mayank Patke <fishythefish@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2025-10-20 06:49:30 -07:00
Paul Berry b4cd468761 [analyzer] Enable the comment_references lint.
Fixes trivial typos and adds `@docImport` declarations so that no
dangling comment references remain in the `analyzer` package, and
enables the `comment_references` lint so that dangling comment
references won't be added in the future.

Change-Id: I6a6a696466de07d6a07fe9f0afe875019bc44c71
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/450743
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Auto-Submit: Paul Berry <paulberry@google.com>
2025-09-19 13:34:10 -07:00
Konstantin Shcheglov 3d95c84db5 Fine. Add internal analyzer_element_model_tracking lint.
Introduce the internal `analyzer_element_model_tracking` lint to enforce
explicit tracking annotations on analyzer element-model members. This
codifies how each member contributes to IDs, dependency tracking, and
incremental analysis.

Rule behavior (applies to classes annotated with `@elementClass`):
- Public instance **fields** must be annotated with
  `@trackedIncludedInId`.
- Public instance **getters/methods** (non-abstract, non-void) must have
  exactly one of:
  `@trackedDirectly`, `@trackedDirectlyExpensive`,
  `@trackedDirectlyOpaque`, `@trackedIncludedInId`, or
  `@trackedIndirectly`.
- Flags invalid annotations on ineligible members (constructors, setters,
  static or private members).
- Reports when more than one tracking annotation is present.
- Reports when a required annotation is missing.

Wire-up:
- Add lint codes and names:
  - `analyzer_element_model_tracking_bad`
  - `analyzer_element_model_tracking_more_than_one`
  - `analyzer_element_model_tracking_zero`
- Mark these as `noFix` in error-fix status and enable the rule in
  `analysis_options.yaml`.
- Register the rule in the linter.

Model updates:
- Annotate many members in `element.dart` to reflect their tracking
  category (e.g. `@trackedIncludedInId` for identity-affecting members;
  `@trackedDirectlyExpensive` for lazily computed collections).
- For opaque surfaces where precise tracking is impractical (e.g.
  `documentationComment`, `nonSynthetic`, `session`, member lookups,
  ancestor queries, `visitChildren`), record usage via
  `globalResultRequirements?.recordOpaqueApiUse(...)`.

Why:
- Makes dependency/ID semantics explicit and reviewable.
- Improves correctness of incremental and cache invalidation behavior.
- Establishes a foundation for refining precision over time without
  regressions.

Scope:
- Internal only; no public API changes.

Change-Id: Id2beaf5ead35b8a361bc1b7688ccb5b5a74afe88
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/446140
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2025-08-20 16:44:13 -07:00
Konstantin Shcheglov 515a4823aa Enable no_literal_bool_comparisons in the analyzer.
Change-Id: Ib6d534331ab91fe03f9d8292c2aa946d5599387a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/440202
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2025-08-12 15:21:52 -07:00
Paul Berry 525b67a9fe Enable discarded_futures lint in analyzer and _fe_analyzer_shared.
Several call sites intentionally discard a future; these call sites
have been wrapped with `unawaited()` (which is the standard way to
suppress the lint).

Turning on this lint uncovered several tests that should have been
async; these tests have been fixed.

Change-Id: I66e0f6bf7a05946e8d460ce9b5581837ce067870
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/431420
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Auto-Submit: Paul Berry <paulberry@google.com>
2025-05-28 08:52:15 -07:00
Kevin Moore 67a24ea983 [pkg] drop lints already covered by the included lint file
Change-Id: I84fdee27e3e28576187896502e5ffed487ee232f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/425408
Reviewed-by: Moritz Sümmermann <mosum@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Auto-Submit: Kevin Moore <kevmoo@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Kenzie Davisson <kenzieschmoll@google.com>
2025-04-30 11:58:24 -07:00
Konstantin Shcheglov f7ff419cd3 Remove analyzer_use_new_elements from analysis_options.yaml files.
Change-Id: Ic71fe16ae25001cc10673db2ef14d23d04f8a44b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/424600
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-04-24 11:11:12 -07:00
Devon Carew 3c973fb292 [lints] address diagnostics related to strict_top_level_inference
Change-Id: I228058202855900f0adba73c1ab04d35180a6e5d
Tested: this is an analyzer diagnostic only change
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/414900
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Nate Biggs <natebiggs@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2025-03-17 08:27:57 -07:00
Paul Berry d3de420bf8 Add a custom lint to sanity check the analyzer public API.
The new lint, called `analyzer_public_api`, verifies that the analyzer
public API satisfies the following properties:

- No method, function, getter, setter, or supertype in the public API
  refers to a non-public type.

- No `export` declaration in the public API shows a non-public name.

- No declaration in the public API has a name ending in `Impl`.

- No file in the public API has a `part` declaration that points to a
  file that's not in the public API. (If it did, then the other checks
  could be circumvented.)

A new annotation is added, `@AnalyzerPublicApi()`, allowing
declarations in `package:analyzer/src` or
`package:_fe_analyzer_shared/src` to be marked as part of the analyzer
public API. This is necessary because some parts of the analyzer
public API need to be declared elsewhere and then exported by the
analyzer.

A few lint violations have been ignored using `ignore:` comments. I
will try to clean these up in follow-up CLs.

Fixes https://github.com/dart-lang/sdk/issues/60058.

Bug: https://github.com/dart-lang/sdk/issues/60058
Change-Id: I0047a73dec8a29e2ffe03dd3a90f7e41ca2e27b6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/409763
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2025-02-14 05:24:22 -08:00
pq a11d2feb92 [CQ] enforce unnecessary_ignore
Change-Id: Id2c57e56425aa31e86b78f081d71575e8fec7838
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/406722
Auto-Submit: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2025-01-29 14:49:38 -08:00
Konstantin Shcheglov c054056146 Elements. Lint. Disallow 'declaredElement' from src/dart/element/element.dart
Also enable the lint for analyzer/.

Change-Id: I2c9e61c6427f5e59b936f1ee7f5f94d4584f2988
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/392851
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2024-11-04 20:59:51 +00:00
Parker Lougheed 1f4f0d386a [linter] Generate lint codes from messages file
Change-Id: Id4f7ee5843a4063d1e527c1566847d88b355c614
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373725
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-08-08 19:24:30 +00:00
Sam Rawlins f1aa891d6a analyzer: Add a test-directory-specific analysis options file
Change-Id: I6f8ce377923756a0ac31a377c75632216bcec0c5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/365867
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2024-05-10 15:52:03 +00:00
Konstantin Shcheglov f061f85bb7 CQ. Enable unnecessary_final in analyzer/
After going for a few files, I decided against using patterns,
and reverted to just using shadowing `var` everywhere.

Change-Id: Ib6cd60e6cd6731baad9c440077cb33076491cba6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/365901
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-05-09 00:37:59 +00:00
Konstantin Shcheglov f9d4df6331 CQ. Enable avoid_redundant_argument_values in analyzer/
Change-Id: I8e5f5f6629249d1fdfddcfe87d20680b37198765
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/353804
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2024-02-26 19:55:13 +00:00
Konstantin Shcheglov 8b564e0bea Enable 'unnecessary_breaks' in analyzer/.
Change-Id: I46615f08175db25f24abf341376d571f270756cb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336831
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2023-11-19 17:31:18 +00:00
pq fe6950eceb enable flutter_style_todos
Change-Id: Ic82963b754404d54e37f5fb03819aebc3fa67954
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336502
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2023-11-15 23:04:19 +00:00
Devon Carew 6917656134 [pkg] remove duplicate config from the analysis options files
Change-Id: I149a97bbe260600a3de664b28c4d212dd9adb889
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/335862
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2023-11-14 00:37:53 +00:00
Paul Berry 5d7dd58d41 Ignore TODO in pkg/analyzer and pkg/analysis_server.
The analyzer team has decided to adopt the convention of using `TODO`
comments to document long term issues that should persist in the
codebase, and `FIXME` comments to document short term issues that need
immediate attention.  They may even consider adding a presubmit hook
to ensure that `FIXME` comments are only used during local
development.

Accordingly, it makes sense to suppress `TODO` comments from being
surfaced to the IDE "problems" view (since there are hundreds of them,
and they're not immediately actionable).  This makes VSCode's
"problems" view much more usable in "tree" mode.

Change-Id: I11a0c59132fb98c1c86fb4adf22d1fdf3b547c80
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/295662
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2023-04-21 19:16:04 +00:00
pq 98014e0e2e fixed dangling library doc comments
Change-Id: I28f5cd8ae31cb7b69da09028d0328e9f6c76bb69
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/294681
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2023-04-12 00:29:48 +00:00
Sam Rawlins a5912c6c58 Enforce strict-casts in analyzer
Broadly, this _adds_ text to the code, as making something explicit which was previously implicit generally requires adding characters. The fixes are of the form:

* `int x = y /* dynamic */;` --> `var x = y as int;`
* `Map<A, B> x = y; --> `var x = y.cast<A, B>();`

Most of the changes are in code which has parsed YAML or which has parsed arguments. Go figure. :)

Change-Id: I1107688bf4ce9c1ec3ed6a4cef56d4d968048e2e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278522
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-01-06 01:59:47 +00:00
Sam Rawlins 2bb495462b [analyzer] Use collection_methods_unrelated_type
Since 1.31 was released, there is no longer a false positive.

Change-Id: I9765b0a67eae55db060dfbb17f77c69ad3f8f826
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/277580
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2023-01-03 16:04:02 +00:00
Sam Rawlins f811d53450 Add some recent lint rules to analyzer
Change-Id: I962812880b660dd17c821fb4264da28783fa14ac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/269441
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2022-11-14 04:14:40 +00:00
Konstantin Shcheglov 1244294c09 Enable overridden_fields in analyzer/.
Change-Id: Ie7dc6d1d8c5347fc38bf271aaa074db2da4d3e31
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/265221
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-10-21 23:15:08 +00:00
pq 2458c36b22 remove redundant lints
(These are defined in the core lint set.)

Change-Id: I194dba3ea91e6cee6a75ea0fc59a8be0f2a1101f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/263143
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2022-10-07 18:24:58 +00:00
Sam Rawlins e139fb1527 Tidy some lint issues in analyzer
* Move many identifiers from snake_case or SCREAMING_SNAKE_CASE to
  camelCase. I think I restricted the changes to private API.
* Add an ignore in generated files for constant_identifier_names;
  we often just mirror names found in YAML files or whatever, where
  things are not necessarily named according to Effective Dart
  standards.
* Avoid some implementation imports which I think were accidental.
* Use single quotes in some more places.

Bug: https://github.com/dart-lang/sdk/issues/48784
Change-Id: I439fe50cb9f8f8f5e9c74ce594aea15e394ee7da
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/254500
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2022-08-10 21:23:21 +00:00
Konstantin Shcheglov f0a07ac120 Enforce use_super_parameters in analyzer/.
Change-Id: I92a002d69a10b83b9600455156a43c1592439477
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/245420
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-05-19 19:36:41 +00:00
Konstantin Shcheglov b0bb5343d9 Enforce unawaited_futures in analyzer/.
Change-Id: If83cb171963d66edf955c9b9f5e486ff4b55619f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/241245
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-04-15 18:20:14 +00:00
pq e0d87b8f48 migrate analyzer to recommended lints
See: https://github.com/dart-lang/sdk/issues/48784

Change-Id: I69a2b6ef16159796e5fa405308438df62af6c826
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/240905
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2022-04-11 22:47:41 +00:00
pq 63a77416b7 enable depend_on_referenced_packages
this is under consideration for core lint inclusion: https://github.com/dart-lang/lints/issues/42

(also undoubtably nice to get the early warning.)

Change-Id: I3ea204444f48d3b4bde3ff65b4ce85a2cf2a7b11
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/202301
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-06-04 14:19:08 +00:00
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