Changes the test logic in `analysis_server` and `analyzer_testing` so
that after printing `To accept the current state, expect:`, it prints
diagnostic codes in their proper camelCase format.
Also removes some bogus code from
`pkg/analyzer_testing/lib/analysis_rule/analysis_rule.dart` that
erroneously suggested passing a `name:` parameter to the top level
`error` function. This function does not accept any parameter called
`name`.
Previously, only tests in `pkg/analyzer/test` printed the diagnostic
codes correctly.
Fixes https://github.com/dart-lang/sdk/issues/62651.
Change-Id: I6a6a6964b17cf798c1355e09f9a4633e1fbe388c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/480041
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
These extensions were previously in `pkg/analyzer_utilities`, which is
not published on `pub`. That meant they could not be used from within
the `lib` directory of any package that *is* published on
`pub`. Specifically, they could not be used from within
`pkg/analyzer_testing/lib`.
In a follow-up CL, I will modify the testing logic so that after
printing `To accept the current state, expect:`, it prints diagnostic
codes in their proper camelCase format.
Change-Id: I6a6a696432d7162906b2c235ea88310dc0aa1fa9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/480040
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Changes the behavior of the `analysisOptionsContent` function so that
unless `propagateLinterExceptions: false` is passed to it, it creates
an analysis options file that specifies a `true` value for
`propagate-linter-exceptions`.
This ensures that when tests that use `package:analyzer_testing` are
run, exceptions that occur while processing lint rules will cause the
test to fail. Previously, such exceptions would be silently swallowed
by the analyzer, and the test would pass.
Change-Id: I6a6a69643d76cf15d801eab5c4ce6a77c7dbac96
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/460220
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
This change is only meant to improve consistency and readability in the test code. The `analysisOptionsContent` function had more parameters and now both take the same things. Also, `createAnalysisOptionsFile` now doesn't implement the same behaviour as `analysisOptionsContent` because it simply invokes it instead.
Change-Id: Ie84f30f4affc1fb106598d636cd6fcf263e6520e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/445100
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Auto-Submit: Felipe Morschel <git@fmorschel.dev>