In particular, this makes it use the mock versions of 'flutter' and
'meta'. The other mock packages it uses aren't yet in the shared
support. I'll add support for them and move the linter over in a future
CL, then in later CLs I'll look at moving the analyzer and
analysis_server packages to the shared versions.
Change-Id: Ib0e272b48332278acf9dcfd4e4d0fc59ba9d29b9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371947
Auto-Submit: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Sam Rawlins <srawlins@google.com>
Commit-Queue: Sam Rawlins <srawlins@google.com>
Previously, this behavior was custom-wired into the Dart analyzer, but
now it is specified with TargetKinds.
In the analyzer we remove special annotation-target-verification for
`mustCallSuper`.
Change-Id: Ibd3ada0a612069c5286facffaad557671c7a85b9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/369140
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Fixes https://github.com/dart-lang/linter/issues/3023
This fix is a little unusually large because I have to add some
elements to both the mock flutter package, and the mock SDK. This
affects some completion tests.
Cq-Include-Trybots: luci.dart.try:flutter-analyze-try,analyzer-win-release-try,pkg-win-release-try
Change-Id: I44b68754f756cfe1cf99518957d74c4af56043f1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/368260
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
This change looks big, and this is because we change the range of all
of the "INVALID_x_ANNOTATION" from the whole annotation (like
`@Immutable("...")`) to just the annotation identifier (like
`Immutable`). This affects many tests.
The error range is changed so that we can consistently use the
`RemoveAnnotation` fix to fix these warnings; it just needs a
consistent error node, so that it can find the Annotation node above.
All this to support `TargetKind`s for `@immutable`, so that we can
remove the custom "INVALID_IMMUTABLE_ANNOTATION" message.
Cq-Include-Trybots: luci.dart.try:flutter-analyze-try,analyzer-win-release-try,pkg-win-release-try
Change-Id: Ifd64e154986b6cbcbafeb9420ca8d0949653e618
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367881
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
There were no tests of this component of the annotation's description:
> The annotation can also be applied to a class to implicitly
> annotate all of the valid members of the class
So I add those as well.
Bug: https://github.com/dart-lang/sdk/issues/48476
Change-Id: If5f0f4c6057f57b4dfd01d8f648110d69fbc5eb4
Cq-Include-Trybots: luci.dart.try:flutter-analyze-try,analyzer-win-release-try,pkg-win-release-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367880
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Checking for solo tests is now done as part of `verify_tests_test.dart` so solo tests currently produce two test failures.
This file did check one additional project that doesn't have `verify_tests_test.dart` does not (analyzer_cli) so it isn't exactly the same, but that project is going away (https://github.com/dart-lang/sdk/issues/48457) so it doesn't seem worth making `verify_tests_test` work there (there's a mismatch because it currently uses `all.dart` and not `test_all.dart`, but I suspect that filename may be coded into some bot configuration somewhere).
Change-Id: I7431ed0e141bab1898860f6fbe316833281d6fa5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367620
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
I did not automate this; I just copied, pasted, and then removed all
of the comments. It uncovered a bug in a test.
Cq-Include-Trybots: luci.dart.try:flutter-analyze-try,analyzer-win-release-try
Change-Id: I5f7591fc53f8137f8c4d5d0d900a6663e8b4d74e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/362842
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
The tests don't currently pass because the test framework doesn't allow
the use of the 'flutter' package. I have partial support for enabling
this, and an idea for a better solution.
What I need most is verification that the examples and fixes are
reasonable. I'm not as familiar with the more flutter-specific lints,
so I might be off-base on some of them. Of course, any other comments
are also welcome.
Change-Id: I73c8c0565ba262c88f8e363f59aef8bc749894a9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/359700
Reviewed-by: Marya Belanger <mbelanger@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
The RUNFILES environment variable is an implementation detail of the
internal build rule, while TEST_SRCDIR is set by bazel. In practice,
they are pointed to the same directory.
See go/lsc-dart-runfiles for context.
R=srawlins@google.com
Change-Id: I2f7ea1aef7ff4ce2209d001eb89054e86abf22d2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344342
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Auto-Submit: Chingjun Lau <chingjun@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
All the packages that depend on it now have constraints greater or equal to 3.0.0.
The added linter rules are taken from other analyzer packages.
Change-Id: If51f9209dab9c58525a1207534bccb6491a409c3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325904
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
The check normalises newlines from "actualContents", but "expectedContents" could also contain \r\n on Windows (at least it does for me), so this just normalises both.
The additional await/async is to prevent "Test failed after it already completed" warnings because this code is inside the call to test() (and not wrapping it, like the other .main() calls in the file).
Change-Id: Iac034efaf1a8a6dad4a21dc67a2dfdb74092dd22
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/307301
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
When running tests from analysis_server using "dart test", the Platform.script is a temporary file and this code fails like:
```
00:01 +0 -1: FlutterSnippetCompletionWithoutNullSafetyTest | test_snippets_flutterStateless_notAvailable_notTopLevel [E]
Bad state: Unable to find sdk/pkg/ in /var/folders/b1/ftm2whhj4mb3_c4nfjhq23z00000gn/T/dart_test.kernel.VYZHoV/test.dart_1.dill
```
This change allows using the working directory to find `pkg` if all of the previous attempts fail, before giving up.
Change-Id: Idb29029e6f14ec4bab3569018771ed0e10586ecc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/307120
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
With the parser code in the same library as the DOM classes, the
`pkg/analyzer/tool/messages/generate.dart` program, which generates all
of the diagnostic classes and diagnostics, _depends_ on a library
with a `parse` method which depends on these diagnostic classes (in
order to report errors while parsing HTML). This means that if
there is any existing error (like an unknown identifier) in the
existing error codes, it is impossible to generate the error codes.
Since we don't need the `parse` method to generate diagnostics, we
split up the library and remove the indirect dependency.
Separating the parser code out removes the loop.
Change-Id: Ifb9e9fd979e341ae64a1ed49aaf3758d3dcf1dee
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287220
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Some notes.
* There are a number of tests that should get decoupled from the linter being pulled into `DEPS`. Instead of depending on the state of lints there, we should update the tests instead to use a more hermetic environment. (See for example `options_rule_validator_test.dart` for how that might look.)
Downstream (blocking) fixes:
* https://github.com/flutter/flutter/pull/119736
* https://github.com/flutter/gallery/pull/878
Change-Id: I5671b0abde3eeda75513abaaf9fef3bcd5115f9b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280054
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
* Stop using `implicit-casts: false`
* Don't list rules which are found in package:lints
* Fix strict-inference issues
Change-Id: Ibe350548e3d6bef486ef2ef82430cda23d684baf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/271780
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
These will replace eventually FileState.exported/importedFiles,
because only libraries or augmentation can have them. Also, we will
build Export/ImportElement(s) from them, when google3 switches to
using AnalysisDriver.buildPackageBundle(), so we are free to make
changes to the way linker works.
Change-Id: I66674dc7720aa704cfc36d16fc78e17dd05a8b93
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/246681
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
It should not be necessary to ever run `pub get` for a package which is
not published. All packages used in the SDK are controlled by a single
package config, so it's not necessary to declare versions or paths for
any packages.
Remove all dependency overrides.
R=devoncarew@google.com
Change-Id: Icb328813b471f35ee4c99995f4e90aac4d8ed438
Tested: Covered by existing static analysis.
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/244767
Commit-Queue: Nate Bosch <nbosch@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
ignore prefer_interpolation_to_compose_strings and
constant_identifier_names in generated files.
Change-Id: I963504e298f8e439734522fed9ac09911750f419
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/243646
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
There are clients, like `built_value` that cannot be updated.
Change-Id: I27371018039f22cd7ca2cb82b30ec33469aa6e4e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/238002
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
* Add team "groups" in tools/OWNERS_<group name>.
* Add top-level OWNERS as a fallback.
* Add OWNERS for all top-level directories.
* Add OWNERS to all packages.
For additional background information see go/dart-sdk-owners.
TEST=No op until code-owners is enabled.
Bug: b/200915407
Change-Id: I7fe6116cc599c749cd50ca16151d6d6a801d99d7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/229147
Reviewed-by: Jonas Termansen <sortie@google.com>
Specifically, to include replacement ranges, which we did not test
consistently, and to merge all check that we have into one matcher
instead of having two limited methods looking for suggestions.
I started initially looking at https://github.com/dart-lang/sdk/issues/34672,
and realized that it is somewhat scary to make more invasive changes
without checks for replacement ranges.
Change-Id: I303cd066989f2a137013ac8dac0614b24e52071d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/225800
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>