Commit Graph

56 Commits

Author SHA1 Message Date
Parker Lougheed 640d9a760f [linter] Update lint changelog for 3.8 and 3.9
Also mark recently published lint docs as published.

Change-Id: If2fba38b6c6cae5764691803d9359dffca8ddf33
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/429281
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Auto-Submit: Parker Lougheed <parlough@gmail.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-05-19 14:54:26 -07:00
Parker Lougheed 2b8c0ee20a [analyzer] Mark latest diagnostic docs as published
Change-Id: I288dcf8c997819bc2e48bf7b4479c37dcba35485
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/419681
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Auto-Submit: Parker Lougheed <parlough@gmail.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2025-04-01 10:51:19 -07:00
Parker Lougheed 6322a400f1 [analyzer] Update messages and lint docs for downstream status
Change-Id: Ie4e057956dba0e568fa7fa6497ce42922207a382
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/414440
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-03-07 17:37:20 -08:00
Parker Lougheed 2e13d4d954 [linter] Doc and changelog updates
Change-Id: I64554034fc510afdab1c3e1dab18a3855fd31b09
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/406782
Commit-Queue: Marya Belanger <mbelanger@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Auto-Submit: Parker Lougheed <parlough@gmail.com>
2025-02-03 15:08:15 -08:00
Mohamed Abdelaal 9b7bb9df90 Fix "the the" typo
Closes https://github.com/dart-lang/sdk/pull/59926

GitOrigin-RevId: cb37bca473b0c177b876a0f4e75858cd1862e699
Change-Id: I6827241b22e99db455945afcdfbaee0450999ce9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/404923
Reviewed-by: Devon Carew <devoncarew@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2025-01-21 14:08:20 -08:00
Parker Lougheed fec029fa04 [analyzer] Mark latest lint and diagnostic docs as published
Also fixes a few minor typos.

Change-Id: I026bb91682440aa851f05f998c4c67c3d1a7a56e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/403540
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Auto-Submit: Parker Lougheed <parlough@gmail.com>
2025-01-07 18:12:37 -08:00
Parker Lougheed 7ecf333dcf [linter] Mark package_api_docs as removed
Resolves https://github.com/dart-lang/sdk/issues/59554

Change-Id: Ic843c827b1b7c9345132c4b8d901de040a56e1a2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/396780
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2024-12-05 21:43:19 +00:00
Erik Ernst e88f0811f9 Shortened the documentation of unsafe_variance
It is now 69 lines, and not the longest.

Change-Id: Ibf618c2356f0bcf90ab3a4f5661a094f53382b22
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/395523
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-11-29 14:36:49 +00:00
Parker Lougheed 9de2a62d74 [linter] Store historical state in messages file
Follow-up PRs will have linter rules use a generated version of these, removing the current duplication.

Contributes to https://github.com/dart-lang/sdk/issues/56835

Change-Id: Ie7a7225001cc254b2ea1428d2f21c5ba1db5ba52
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/396920
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-11-21 22:15:19 +00:00
Erik Ernst 7b71ed17b2 Introduce the lint unsafe_variance
This CL implements a new lint, `unsafe_variance`. This lint emits a
warning whenever an instance member declaration has a signature where
a type variable declared by the enclosing class/mixin/enum occurs in
a non-covariant position in the return type (including the type of
an instance variable).

Issues: https://github.com/dart-lang/linter/issues/4111, with goals related to https://github.com/dart-lang/language/issues/296 and https://github.com/dart-lang/language/issues/524.

Change-Id: I1352d71d61fece03a432ccf0d98825a69e3a457f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/384700
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2024-11-15 09:28:52 +00:00
Erik Ernst c9391d7f19 Set obvious/property lints to hasFix
The lints `omit_obvious_property_types` and
`specify_nonobvious_property_types` previously had error fix status
'needsEvaluation'. This CL changes it to 'hasFix'. This is needed in
order to get access to the fix in IntelliJ.

This CL also corrects a bug whereby a map literal was considered to have an obvious type in cases where there were no actual type arguments and no elements with an obvious type.

Change-Id: Id9305152d086604b78636b696bd97e318ed6bdb5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/393280
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-11-09 16:59:49 +00:00
Parker Lougheed 2de5bb15f1 [linter] Changelog and since updates for 3.6 and 3.7
Change-Id: Ic308308ee7590a3dc10d84b4b33fa78ae4135a11
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/393587
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-11-06 17:10:52 +00:00
Parker Lougheed 47ecb53072 [linter] Mark unnecessary_final and prefer_final_in_for_each as incompatible
Change-Id: Ifa4af7c5ab4c5e68ae3e71bc6fc6a3b30394927b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/391022
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-10-21 16:59:06 +00:00
Erik Ernst e6f81dfbc3 Add new lints {omit_,specify_non}obvious_property_types
See https://github.com/dart-lang/linter/issues/5101 for some background information.

Change-Id: I51b6988f08585b7b4863ae8858d44de831615177
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/387960
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2024-10-21 08:08:37 +00:00
Parker Lougheed e032779a86 [linter] Deprecate package_api_docs lint
The lint hasn't been functional for a long time. Rather than try to fix it and start introducing a lot of warnings on packages that include it, let's deprecate it and prepare for removal. Keeping it around in its current state results in the analyzer not meeting the expectations of developers that include the rule, potentially even causing misconceptions that an element isn't public when it is.

A replacement, with a new name, can be introduced in the future if there is the desire and time to implement it.

Bug: https://github.com/dart-lang/linter/issues/5107
Change-Id: Ied113e4c98be2253cb938277cfd6ea1c96bcac4a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/389585
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Auto-Submit: Parker Lougheed <parlough@gmail.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2024-10-16 21:13:27 +00:00
Parker Lougheed 701dfa233a [linter] Follow-up clean up for lint name and code generation
- Add `.g` suffix to generated filenames and export from the base file.
- Rename `linter_lint_codes.dart` to just `lint_codes.dart` for simplicity.
- Export `lint_codes.dart` from `src/analyzer.dart` to avoid importing it in every rule file, as they all need it.
- Use pre-existing/shared `generateAll` method for generation.
- Add some explanatory docs and comments.

Bug: https://github.com/dart-lang/sdk/issues/56835
Change-Id: I605e39156bfcc5e3c19a01157426d26300eb877d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/388058
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Auto-Submit: Parker Lougheed <parlough@gmail.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2024-10-10 14:29:08 +00:00
Parker Lougheed e2a2761cc6 [linter] Clarify status and use of rules.json and clean up generation
- Adds a doc at `pkg/linter/tool/machine/rules.json` with info about the file.
- Drops the disabled test that checked that the file is up to date.
- Drops inclusion of rule sets from the `rules.json` file.
- Consolidate the remaining logic for determining rule sets


Closes https://github.com/dart-lang/linter/issues/4756
Closes https://github.com/dart-lang/sdk/issues/55977
Contributes to https://github.com/dart-lang/sdk/issues/56835

Change-Id: Ic030640571c0f8cf553a218a2e32c5a767535564
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/388481
Auto-Submit: Parker Lougheed <parlough@gmail.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2024-10-08 18:39:29 +00:00
Parker Lougheed 1b6fe3406a [linter] Add custom data structure and validation for messages.yaml
The MessagesData abstraction was nice, but for ease of access in future work, I found I need a typed data structure anyway. To keep it simple, I added validation as part of the decoding, so the checks/tests just rerun the decoding.

Change-Id: I81833347937d063de957d57deb7ebe6290f32a46
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/387828
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2024-10-02 14:31:34 +00:00
Parker Lougheed 62a52ed946 [linter] Move sinceSdk information to messages file
Continuing work towards consolidating documentation-related information to the messages.yaml file.

Change-Id: I6c80dfae9ed20372c4207c6f007d26e735925a08
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/386823
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Auto-Submit: Parker Lougheed <parlough@gmail.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2024-09-26 04:33:50 +00:00
Parker Lougheed 46cd8b627c [linter] Move old lint details out of source
- Makes way for slowly replacing them with new "why" docs.
- Slightly reduces snapshot size of analysis server
- Colocates docs in the new linter/messages.yaml file.

Change-Id: I8708b8b55455a183ccfa5c9d8c21098ae0655b51
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/385304
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Auto-Submit: Parker Lougheed <parlough@gmail.com>
2024-09-24 23:06:34 +00:00
Parker Lougheed 409bb144cb [linter] Update machine.json generation for new categories setup
We're getting closer to no longer needing this file, but dart.dev still relies on it for now.

Change-Id: Iae5381515778021237413bb1b5fca3ac350b47f4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/384823
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Auto-Submit: Parker Lougheed <parlough@gmail.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-09-13 01:23:54 +00:00
Parker Lougheed a7a554f14e [linter] Test that linter_lint_codes.dart is up to date
Also ensures other info for `specify_nonobvious_local_variable_types` is updated and regenerates `machine/rules.json`.

Change-Id: I00df54cadd5087df1b35f48ea6ce7f411a8a95b3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/380660
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-08-15 18:29:07 +00:00
Parker Lougheed c50c194d41 [linter] Update lint since info for 3.5 release
Also removes the group from the generated machine.json file as they are no longer the same 3.

Change-Id: I92d4ef8cd655cc4efaa6b37fcdf56611494ac635
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/379140
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2024-08-06 23:00:11 +00:00
Parker Lougheed aedaede1eb [linter] Add docs for avoid_as removal
Also updates `tool/machine.dart` for recent `LintRule` and category changes.

Change-Id: I58200e465e7c372881d0c0af406e606b09b0a844
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373885
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2024-07-02 15:06:03 +00:00
Parker Lougheed 687a1d5a43 [linter] Fix formatting of noop_primitive_operations docs
Fixes https://github.com/dart-lang/site-www/issues/5867

Change-Id: I618199e38dfb524f0a4caeb2b01b498c63411064
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/368360
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2024-05-28 14:47:36 +00:00
Parker Lougheed a768742545 [linter] Clarify that none can be specified to disable highlighting
Fixes https://github.com/dart-lang/site-www/issues/5861

Change-Id: Ic0dfdded5f38f1de4a19a7b41e52f87f3f9b9cef
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/368221
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-05-24 22:11:51 +00:00
Parker Lougheed 10a38d0fd1 [linter] Update linter details for newest lints
Change-Id: If2ff9ea645c77cd4912f0bc6626468aa375b366e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/366970
Auto-Submit: Parker Lougheed <parlough@gmail.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2024-05-20 15:03:46 +00:00
Parker Lougheed 09e92e2a49 [linter] Update changelog entry and since info for 3.4
Change-Id: I597cf9117b2f61b8d6786af987d29452b7ce2243
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/365381
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Auto-Submit: Parker Lougheed <parlough@gmail.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2024-05-06 20:03:26 +00:00
Kallen Tu cd4b418628 [linter] Add unintended_html_in_doc_comment lint.
This CL adds a lint that reports when a user uses a pair of angled brackets which are not in a code block, nor a code span, and is not an autolink.

Updated the `rules.json` for the new lint as well.

Bug: https://github.com/dart-lang/linter/issues/4793
Change-Id: I1ca762b5e62678b8c6fba60206f3465154696b6c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/359900
Reviewed-by: Morgan :) <davidmorgan@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-04-02 21:09:51 +00:00
Parker Lougheed 3cf6ac9bb0 [linter] Add since info for 'missing_code_block_language_in_doc_comment'
Change-Id: I87199e1ccea45907e7974309cedd2b064bfa6478
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/356980
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Kallen Tu <kallentu@google.com>
2024-03-18 19:22:26 +00:00
Eli Geller 0766f7b83e typo fixes: its vs. it's
Closes https://github.com/dart-lang/sdk/pull/55023

GitOrigin-RevId: f9457aac2575780d5d712531d3694ccb38d3a5bd
Change-Id: I29357eac563d6423a78ec58bbfa6a1a72e3dadf7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/354501
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Michael Thomsen <mit@google.com>
2024-02-29 11:07:40 +00:00
Zach Anderson 59b02ea3a1 Revert "[linter] Account for new JS interop libraries in 'avoid_web_libraries_in_flutter'"
This reverts commit a7e1e26446.

Reason for revert: https://github.com/flutter/flutter/issues/140881

Original change's description:
> [linter] Account for new JS interop libraries in 'avoid_web_libraries_in_flutter'
>
> Users are going to begin interacting with the DOM and JS through these libraries more and more.
>
> To avoid new warnings later on, let's account for them as soon as possible.
>
> Change-Id: Ib86e00aeb4bf42f13e104c1b68910195737667d9
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/343700
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
> Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
> Reviewed-by: Phil Quitslund <pquitslund@google.com>
> Reviewed-by: Samuel Rawlins <srawlins@google.com>
> Auto-Submit: Parker Lougheed <parlough@gmail.com>

Change-Id: I6b3ec89ab18aa5d6a3bce43355025808256240d6
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344560
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
2024-01-03 16:13:08 +00:00
Parker Lougheed a7e1e26446 [linter] Account for new JS interop libraries in 'avoid_web_libraries_in_flutter'
Users are going to begin interacting with the DOM and JS through these libraries more and more.

To avoid new warnings later on, let's account for them as soon as possible.

Change-Id: Ib86e00aeb4bf42f13e104c1b68910195737667d9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/343700
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Auto-Submit: Parker Lougheed <parlough@gmail.com>
2024-01-02 20:17:52 +00:00
Parker Lougheed aabc9badd0 [linter] Add some not-bad examples to avoid_empty_else
Fixes https://github.com/dart-lang/site-www/issues/5341

Also migrates its tests to reflective tests.

Change-Id: I3171aedc304347bd24aa757b3f9d77351bb75cb4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/342280
Auto-Submit: Parker Lougheed <parlough@gmail.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Marya Belanger <mbelanger@google.com>
Commit-Queue: Marya Belanger <mbelanger@google.com>
2023-12-19 23:18:53 +00:00
Sam Rawlins a2151474a5 linter: UBCS: require checking the correct 'mounted' property
Fixes https://github.com/dart-lang/linter/issues/4777

Change-Id: I0c50ab1a04b8f9c704a0cf787fcf414688cd61a6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/330561
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2023-12-12 01:34:11 +00:00
Sam Rawlins 030fe115e2 linter: Allow dynamic calls on explicit dynamic- or Function-casts
Fixes https://github.com/dart-lang/linter/issues/4806

Change-Id: I6c900f9aa3d7c2cf8dc3547bfe035eab820e750b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/339101
Auto-Submit: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2023-11-30 22:40:18 +00:00
Sam Rawlins dd6c961bf0 Remove all pre-NNBD support in the linter code
In this CL we "remove" 3 linter rules, and any subsequently unused quick fixes:

* `always_require_non_null_named_parameters`
* `avoid_returning_null`
* `avoid_returning_null_for_future`

We also delete any code that branched on pre-NNBD libraries; these are
no longer supported.

Change-Id: I3bad7a44de3563e5737919c878170213ad506b82
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336244
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2023-11-21 18:55:01 +00:00
Parker Lougheed 11762189a1 [linter] Fix avoid_unstable_final_fields release version
Fixes https://github.com/dart-lang/sdk/issues/53852

Change-Id: I957373bfd9f04014a3e307f54b7e3f8e27b88564
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/331340
Auto-Submit: Parker Lougheed <parlough@gmail.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2023-11-12 19:18:03 +00:00
Sam Rawlins 5f24a631c7 linter: Add first three 'known limitation' texts to docs
Change-Id: Id6f1c95614e7de039866da40659ab7de7928faee
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/333340
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2023-11-02 16:22:01 +00:00
Sam Rawlins 7341ad214e Document unreachable_from_main for instance members
Change-Id: I37ea317ad0e1fc18d509e706a3cbc355f04005be
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/330380
Auto-Submit: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2023-10-13 03:39:23 +00:00
Erik Ernst cdc16e7d3d Create lint PR 3578 as Gerrit CL
This CL transfers the changes made by
https://github.com/dart-lang/linter/pull/3578
to Gerrit.

Change-Id: Ib1eae56d2112e25bcf9916abf27b05bd3de15735
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/326342
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-10-12 10:09:10 +00:00
Brian Wilkerson 41446971a6 Attempt to fix the pkg bots
Change-Id: I95768d444547f2ec3ae97870dfaaa0f441c63a87
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/328660
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2023-09-28 19:35:28 +00:00
Sam Rawlins c36afc2f52 Update unnecessary_this examples
I found this a little jarring; code is not idiomatic.

* field is implicit `dynamic`.
* parameter is implicit `dynamic`.
* parameter name is snake_case.

Change-Id: I49c42e5c2ea1e18bec280b2b7e04d0b4da737dcc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/327803
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Auto-Submit: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2023-09-26 15:49:23 +00:00
pq bf26e5985a update w/ latest package:lints lint sets
Fixes failure here: https://dart-ci.appspot.com/log/any/unittest-asserts-release-linux/24229/pkg/linter/test/verify_machine_json_test

Change-Id: Ifda4654e1a80a0003bada8b33e9ebd5878173421
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/327023
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2023-09-20 21:04:07 +00:00
pq 88b07ba64e annotate_redeclares since info
Change-Id: I7bae3816d72b64f3cb3a4520c90491aefa5d6437
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/326901
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-09-19 21:57:39 +00:00
pq d1b6ea9f4d +annotate_redeclares
Fixes: https://github.com/dart-lang/linter/issues/4747

Change-Id: I7bf3e83dbe279f5b1a03dc5e5806c7c0fe3e3486
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/326263
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2023-09-18 02:41:29 +00:00
Sam Rawlins 10da52b016 linter: Move sized_box_shrink_expand tests
Change-Id: I8fccc19af7ed2895b710e00feae3145e6ff8e401
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325480
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Auto-Submit: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2023-09-12 22:16:59 +00:00
Sam Rawlins 45930e3d62 linter: Mark use_build_context_synchronously stable
Fixes https://github.com/dart-lang/linter/issues/3915



Change-Id: I4909b6440859174852f85084fef4c847f0f46a94
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325365
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2023-09-12 19:50:09 +00:00
Parker Lougheed f91a4cf1b0 [linter] Link to docs for more context on enhanced enums
Change-Id: Iacfda3ea97bfe7025f0d415f06ef2b342df37dda
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325180
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-09-11 17:52:07 +00:00
Sam Rawlins 4bddf8a25f Revert "Revert "linter: Refactor prefer_collection_literals to use context type more""
This reverts commit cbdae14d2f.

In addition, Fix prefer_collection_literals for methods with expression bodies

Original description:

linter: Refactor prefer_collection_literals to use context type more

There is a basic premise in this rule which we cannot satisfy exactly:
we need to disallow `LinkedHashSet()` unless the context type requires
the developer to use `LinkedHashSet`. But the context type is long
gone when the lint rule is run.

This CL adds some logic to try to attempt figuring out the context
type in the cases where users have filed bugs, but it will never be
super accurate.

Fixes https://github.com/dart-lang/linter/issues/4736
Fixes https://github.com/dart-lang/linter/issues/3057
Fixes https://github.com/dart-lang/linter/issues/1649
Fixes https://github.com/dart-lang/linter/issues/2795

Change-Id: I958ba69a56866c18523ce6cbf62645ef8e028f6b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/324260
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2023-09-05 23:49:49 +00:00