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>
There is much code in pkg/analyzer/lib/src/lint which is only used by
_tests_ and _tools_ in the linter package. This CL attempts to tidy up
the separation of linter lib code and non-lib code by moving some
files, and moving some source elements, which are only used in tests,
or in tools.
I originally dug into this because I saw `LinterOptions` has a public late field
(dangerous):
`late file_system.ResourceProvider resourceProvider;`
It turns out this field is only initialized in tests and tools, and
then it's read by multiple methods, and it just so happens those
methods are only called during tests or in tools.
Summary of changes:
* Mark LintDriver and DartLinter classes as only used for linter tools
and tests.
* Remove CamelCaseString class.
* Mark `DartLinter.lintPubspecSource` as `@visibleForTesting`.
* LinterOptions: mark `enabledLints` and `analysisOptions` final, and remove
`resourceProvider`.
* Remove SourceLinter; it was only used in a few `engine_test.dart` tests in
linter, but all uses could be replaced with DartLinter.
* Remove linter's `bin/linter.dart`; it is not meant to be used as any sort of
user entrypoint. The main method is moved to `cli.dart`.
* Move linter's `lib/src/cli.dart` to `tool/cli.dart`.
* analyzer's top-level function `lintFiles`, classes ErrorWatchingSink
and FileGlobFilter are moved to linter's tool/ directory.
* Delete the engine_test.dart tests which only validate basics of
linter's old entrypoint.
This reverts commit d1bc88de8f.
Change-Id: I1063aa72c640ad8ab62f76bf89f665cb8b9952dc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/334645
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
This reverts commit 31eab937f6.
Reason for revert: No way to import "tool/formatter.dart" in g3
Original change's description:
> Improve file structure of linter files.
>
> There is much code in pkg/analyzer/lib/src/lint which is only used by
> _tests_ and _tools_ in the linter package. This CL attempts to tidy up
> the separation of linter lib code and non-lib code by moving some
> files, and moving some source elements, which are only used in tests,
> or in tools.
>
> I originally dug into this because I saw `LinterOptions` has a public late field (dangerous):
>
> `late file_system.ResourceProvider resourceProvider;`
>
> It turns out this field is only initialized in tests and tools, and
> then it's read by multiple methods, and it just so happens those
> methods are only called during tests or in tools.
>
> Summary of changes:
>
> * Mark LintDriver and DartLinter classes as only used for linter tools
> and tests.
> * Remove CamelCaseString class.
> * Mark `DartLinter.lintPubspecSource` as `@visibleForTesting`.
> * LinterOptions: mark `enabledLints` and `analysisOptions` final, and remove `resourceProvider`.
> * Remove SourceLinter; it was only used in a few `engine_test.dart` tests in linter, but all uses could be replaced with DartLinter.
> * Remove linter's `bin/linter.dart`; it is not meant to be used as any sort of user entrypoint. The main method is moved to `cli.dart`.
> * Move linter's `lib/src/cli.dart` to `tool/cli.dart`.
> * analyzer's top-level function `lintFiles`, classes ErrorWatchingSink
> and FileGlobFilter are moved to linter's tool/ directory.
> * Delete engine_test.dart tests which only validate basics of
> linter's old entrypoint.
>
> Change-Id: Ifc0e70454ee2ac794bc816ef9c77d5519a93eb0a
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/333128
> Commit-Queue: Samuel Rawlins <srawlins@google.com>
> Reviewed-by: Phil Quitslund <pquitslund@google.com>
Bug: b/309643288
Change-Id: I69a731ff31507f671277d0395f4ebfbb86d8f607
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/334660
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Auto-Submit: Oleh Prypin <oprypin@google.com>
There is much code in pkg/analyzer/lib/src/lint which is only used by
_tests_ and _tools_ in the linter package. This CL attempts to tidy up
the separation of linter lib code and non-lib code by moving some
files, and moving some source elements, which are only used in tests,
or in tools.
I originally dug into this because I saw `LinterOptions` has a public late field (dangerous):
`late file_system.ResourceProvider resourceProvider;`
It turns out this field is only initialized in tests and tools, and
then it's read by multiple methods, and it just so happens those
methods are only called during tests or in tools.
Summary of changes:
* Mark LintDriver and DartLinter classes as only used for linter tools
and tests.
* Remove CamelCaseString class.
* Mark `DartLinter.lintPubspecSource` as `@visibleForTesting`.
* LinterOptions: mark `enabledLints` and `analysisOptions` final, and remove `resourceProvider`.
* Remove SourceLinter; it was only used in a few `engine_test.dart` tests in linter, but all uses could be replaced with DartLinter.
* Remove linter's `bin/linter.dart`; it is not meant to be used as any sort of user entrypoint. The main method is moved to `cli.dart`.
* Move linter's `lib/src/cli.dart` to `tool/cli.dart`.
* analyzer's top-level function `lintFiles`, classes ErrorWatchingSink
and FileGlobFilter are moved to linter's tool/ directory.
* Delete engine_test.dart tests which only validate basics of
linter's old entrypoint.
Change-Id: Ifc0e70454ee2ac794bc816ef9c77d5519a93eb0a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/333128
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
* 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>