Commit graph

104 commits

Author SHA1 Message Date
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 716b127a1a linter: ubcs: account for when clauses in if-like nodes
Fixes https://github.com/dart-lang/linter/issues/4795

Change-Id: I4cce15ddaf8a669921646fa81dd0e455859e46e3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332361
Auto-Submit: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2023-10-26 19:56:58 +00:00
pq d239b906e9 rule generation codegen tweaks
* removes stale generated TODO
* fixes test prefixing in the all tests test for cases where tests include `_test`
* adds a file ignore for test prefixes for the all tests test

Change-Id: Ie400e275300683b8f037bb6dae62aa85a3469cff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/331201
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-10-19 16:42:25 +00:00
pq 2ae5b4f9eb add (internal) erase_dart_type_extension_types stub
Very much a WIP but hopefully provides enough scaffolding for some dev_compiler experimentation.



Change-Id: Ic0cfe3c30b189732ee10209ff8b4b6a88ef0d37d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/330995
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-10-19 16:10:19 +00:00
pq d79fd1a269 remove inTestMode declaration
Change-Id: I7fa08195db75120df4377c7529d52ba47ff3dcbb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/331090
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2023-10-19 14:48:13 +00:00
pq a6674f7b7c remove stale test mode codegen support
Change-Id: Ie3d103404e64139caa9eb2f15a4688fc94ab8e49
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/331085
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2023-10-18 17:43:05 +00:00
pq 5b7f451360 avoid_type_to_string extension type tests
Fixes: https://github.com/dart-lang/linter/issues/4783

Change-Id: I1477048ea933cdc7f11706a9caab3f0769d66f86
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/331082
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2023-10-18 16:34:34 +00:00
pq 9266dd12ed add an "internal" rule state
Change-Id: I740d95c179005b820dab01b4cd0cd7b0976f288b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/331080
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2023-10-18 16:27:22 +00:00
Sam Rawlins 20dae1a3f6 linter: catch fields referenced in a pattern field
Fixes https://github.com/dart-lang/sdk/issues/53674

Change-Id: I87effd3cc4b3d3227cd26c3fdeb68b7f7e2d0ca9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/330880
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Auto-Submit: Samuel Rawlins <srawlins@google.com>
2023-10-17 19:54:48 +00:00
Sam Rawlins 06ab207091 linter: Move many unnecessary_statements tests
Not all of them; there are too many for one change.

Change-Id: I59f6a52c03ccbc4f5f81567b0f70c32fcf4b1f2e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/329569
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2023-10-13 03:51:23 +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
pq 532e4674c6 extension type support for prefer_const_constructors_in_immutables
Fixes: https://github.com/dart-lang/linter/issues/4720

Change-Id: Ia55289f53b6191e8511664cfa5b05ebcfe42ed6c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/330180
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2023-10-12 17:41:12 +00:00
pq 3f3def4654 verify prefer_asserts_in_initializer_lists for extension types
As it happens, `prefer_asserts_in_initializer_lists` works out of the box for constructors in extension types. (Yay!) This just adds a few tests for coverage.

Fixes: https://github.com/dart-lang/linter/issues/4779

Change-Id: I1f5ffbbc968b37723b5e6894227c154563b2803c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/330031
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Kallen Tu <kallentu@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2023-10-12 16:01:28 +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
pq 0493c44a87 cleanup @immutable element checks
Having added a `hasImmutable` property in https://dart-review.googlesource.com/c/sdk/+/330048, we can do a bit of tidying up. 🎉

Change-Id: I2878a829aed1001dec90bc43859a547e8c0df3a6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/330049
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Kallen Tu <kallentu@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2023-10-12 00:52:28 +00:00
pq d9731acfda fix prefer_void_to_null false positive on extension type representations
Fixes: https://github.com/dart-lang/linter/issues/4720

Change-Id: Ie3a736cbd4d190135eb77932ec8ba9352683226e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/330200
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2023-10-11 19:04:08 +00:00
Sam Rawlins ac7059a832 Support extension types in unreachable_from_main
Work towards https://github.com/dart-lang/linter/issues/3625

Change-Id: I41a28795f16eb19b41f864ef512cf10936c2e11f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/327713
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Auto-Submit: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2023-10-11 01:11:28 +00:00
Parker Lougheed 07bb4d1f82 [linter] Don't mark linter rule files as executable
As far as I can tell, these shouldn't be marked executable. The rest of the rules are not.

Change-Id: Iefcf85488f04cf44b2616f8cc5c98f99fd54c35c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/329863
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-10-10 20:59:11 +00:00
Parker Lougheed fd59a1c33f [linter] Reduce cases where dynamic is inferred
Doesn't enable strict-inference but fixes a few of the more impactful cases.

Change-Id: Ife08f1839036c420108bf603f4bce3ab7bfea5c4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/330000
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2023-10-10 18:07:59 +00:00
Parker Lougheed 47474c695e [linter] Add 3.2 linter changes to changelogs
Change-Id: Ib918b6bb1ebb527933672c5a598aacb4b3835769
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/329860
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-10-10 04:13:12 +00:00
Sam Rawlins 9ed15c1552 linter: move prefer_const_constructors_in_immutables tests
Change-Id: I554788acea66bfd148f8f2a381046e4f1acae3f7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/329141
Auto-Submit: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2023-10-09 18:16:47 +00:00
Sam Rawlins 8d80d978ad linter: Move avoid_multiple_declarations_per_line tests
Change-Id: I92271ad7999c521ea343c3199dc09f32a897b0c7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/329140
Auto-Submit: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2023-10-06 23:23:52 +00:00
Sam Rawlins a6eb0d08db Linter: move control_flow_in_finally tests
Change-Id: Idf1aaea14ead44969fb8d978b74d33e77aa2dc68
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/328767
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Auto-Submit: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2023-10-04 21:51:14 +00:00
pq abe76b0fd9 disable rules.json validation
See: https://github.com/dart-lang/linter/issues/4756

Change-Id: I9e2d5858f313adcd6cd8323d696f3c82b460fc55
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/328684
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2023-09-29 17:49:43 +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
pq beeda0df80 unregister "check" tests after running
The side effect of these checks persisting in the registry were causing downstream verifications to fail.

See: https://github.com/dart-lang/linter/issues/4754

Change-Id: I3128be284599fc160f14df0c832cace5f6e98d6d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/328101
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2023-09-28 00:39:49 +00:00
pq 0742604758 clean up references to dart test
See: https://github.com/dart-lang/linter/issues/4754

Change-Id: Ib875e1640dd15f321362f2dba76b3d5d8524497c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/328183
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2023-09-27 21:54:09 +00:00
Sam Rawlins 731d7dc1c6 [linter] Simplify some test support
* UseBuildContextSynchronously no longer needs an `inTestMode`
  parameter, since the test_data tests are migrated.
* `testRule`'s `debug` and `failOnErrors` parameters are never
  anything but the default, so removed, and simplified bool logic
  that follows.


Change-Id: I79653df45388a4eae655a38c16a41c0dcb43d73a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/327709
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Auto-Submit: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2023-09-26 17:08:57 +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
Sam Rawlins bdb450bd03 Move avoid_web_libraries_in_flutter tests
Work towards https://github.com/dart-lang/linter/issues/3535

Change-Id: I7adf8986b3e3ab5329599d608df6f90db8046179
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/327281
Auto-Submit: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2023-09-25 22:04:58 +00:00
Sam Rawlins e28faa2462 linter: use_build_context_synchronously: fix or
This PR fixes the case demonstrated in the new test, where
a mounted check occurs on the right side of an or-binary
expression.

Fixes https://github.com/dart-lang/linter/issues/4753

Change-Id: I3c4ac8a42f7f87502fb217763506fa5294f6b017
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/326864
Auto-Submit: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2023-09-20 21:49:54 +00:00
Sam Rawlins 83c145aec4 linter: Move avoid_catching_errors tests
Change-Id: I60f8e15cb5e2e647d63094cc61cb0594cddb2321
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/326867
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Auto-Submit: Samuel Rawlins <srawlins@google.com>
2023-09-20 21:41:51 +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
Sam Rawlins 42516e3c6e linter: Move close_sinks tests
Work towards https://github.com/dart-lang/linter/issues/3535

Change-Id: I5c2b076d5d01037aa50b829d29a899834e105181
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/326861
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Auto-Submit: Samuel Rawlins <srawlins@google.com>
2023-09-19 20:17:13 +00:00
Sam Rawlins 66d220935b linter: Remove mock_packages
Change-Id: I3c964a6e92138605f80ef7a9a71304044877a3c8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/326881
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Auto-Submit: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2023-09-19 20:09:08 +00:00
Sam Rawlins 29f78ef98c linter: Move final use_build_context_synchronously tests
Most of the tests removed here already are covered in the new tests.

And also two test cases are added.

Change-Id: I3d6e15d2b9fde14a2b2249a3422ca1508a0d7572
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/326726
Auto-Submit: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2023-09-19 16:34:59 +00:00
Sam Rawlins b72f968334 Move avoid_print tests
In this CL, I also add the foundation file, and move some existing
elements into it, and correct all of the necessary tests.

Change-Id: I772f76d6eaf64612667a445270f86741a4771ce8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/326684
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Auto-Submit: Samuel Rawlins <srawlins@google.com>
2023-09-19 15:56:48 +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 6170698492 [linter] Move avoid_unnecessary_containers tests
Change-Id: Id516f3543a0bc319a2513e739828f563fa91afe3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/326560
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Auto-Submit: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2023-09-18 01:03:59 +00:00
Sam Rawlins 45f7b438bd linter: Move sort_child_properties_last tests
Change-Id: I5d369a3a911695681713060ebf0bfb1239078087
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/326541
Auto-Submit: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2023-09-18 01:03:11 +00:00
Sam Rawlins 6d6ce9c1c3 linter: Move use_decorated_box tests
Change-Id: Ie2b37e54546806da0da362f29ac6a654146d4ede
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/326244
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Auto-Submit: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2023-09-15 23:27:13 +00:00
pq 240ef465e6 fix unsafe cast
Change-Id: If2a2f72c62e8bda14c04de88cb37bf416e5b0c86
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/326181
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2023-09-14 19:27:58 +00:00
Sam Rawlins 66b58414eb Move diagnostic_describe_all_properties tests
Change-Id: I541f7e9a39b3b0f3de60cf68117e643ba5b661b7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325966
Auto-Submit: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2023-09-14 17:33:34 +00:00
Sam Rawlins 30c98b7c36 linter: Migrate fixnum-related tests to be reflective
Change-Id: I2dbe12c2d2c66d08a2439a37c112cd08e5414204
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325902
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Auto-Submit: Samuel Rawlins <srawlins@google.com>
2023-09-13 23:34:59 +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
Sam Rawlins 02dba4189f linter: Move prefer_foreach tests
Change-Id: I0a6beae9d4983c8bef3445b569fc163c41f66faa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325361
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Auto-Submit: Samuel Rawlins <srawlins@google.com>
2023-09-11 23:17:30 +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
Parker Lougheed 08a1093cd4 [linter] Focus omit_local_variable_types on type itself
The lint was being reported on the entire expression, making it potentially hard to identify the source of the lint. This change moves the range to the type itself, now matching the existing behavior of the lint in for each loops.

Change-Id: Id4a7c487aadb6282515c7ef5bb0fd8ebf923d8eb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325161
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-09-11 17:51:59 +00:00