[ddc] Update pedantic version to 1.11.0

Apply new lints, cleanup violations, and ignore in `lib/src/js_ast` to
avoid adding additional diffs with the version it was forked from.

Change-Id: I1def25865bf195120c594223ebdc0f59139e75b7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192241
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
This commit is contained in:
Nicholas Shahan 2021-03-24 17:35:32 +00:00 committed by commit-bot@chromium.org
parent 128fef8808
commit 38e5e9bc19
10 changed files with 19 additions and 18 deletions

4
DEPS
View file

@ -130,7 +130,7 @@ vars = {
"oauth2_rev": "7cd3284049fe5badbec9f2bea2afc41d14c01057",
"package_config_rev": "a84c0d45401f215fbe9384df923a38f4022a3c45",
"path_rev": "407ab76187fade41c31e39c745b39661b710106c",
"pedantic_rev": "df177f6ae531426aaf7bbf0121c90dc89d9c57bf",
"pedantic_rev": "66f2f6c27581c7936482e83be80b27be2719901c",
"platform_rev": "c20e6fa315e9f8820e51c0ae721f63aff33b8e17",
"ply_rev": "604b32590ffad5cbb82e4afef1d305512d06ae93",
"pool_rev": "7abe634002a1ba8a0928eded086062f1307ccfae",
@ -613,7 +613,7 @@ deps = {
"version": "ebF5aRXKDananlaN4Y8b0bbCNHT1MnkGbWqfpCpiND4C",
},
],
"dep_type": "cipd",
"dep_type": "cipd",
},
Var("dart_root") + "/third_party/browsers/chrome": {
"packages": [

View file

@ -1,4 +1,4 @@
include: package:pedantic/analysis_options.1.9.0.yaml
include: package:pedantic/analysis_options.1.11.0.yaml
analyzer:
strong-mode:

View file

@ -246,11 +246,11 @@ class _RenameVisitor extends VariableDeclarationVisitor {
// If collisions become common we need a better search.
// TODO(jmesserly): what's the most readable scheme here? Maybe 1-letter
// names in some cases?
candidate = name == 'function' ? 'func' : '${name}\$';
candidate = name == 'function' ? 'func' : '$name\$';
for (var i = 0;
scopes.any((scope) => scope.used.contains(candidate));
i++) {
candidate = '${name}\$$i';
candidate = '$name\$$i';
}
}
return candidate;

View file

@ -7,6 +7,7 @@
// ignore_for_file: slash_for_doc_comments, unnecessary_new
// ignore_for_file: always_declare_return_types, prefer_single_quotes
// ignore_for_file: prefer_collection_literals, omit_local_variable_types
// ignore_for_file: unnecessary_brace_in_string_interps
// Utilities for building JS ASTs at runtime. Contains a builder class
// and a parser that parses part of the language.

View file

@ -36,7 +36,7 @@ dev_dependencies:
modular_test:
path: ../modular_test
package_config: any
pedantic: ^1.8.0
pedantic: ^1.11.0
sourcemap_testing:
path: ../sourcemap_testing
stack_trace: any

View file

@ -235,7 +235,7 @@ class TestDriver {
/// Initializes a Chrome browser instance, tab connection, and debugger.
///
/// Should be called once after creating TestDriver.
void initChrome() async {
Future<void> initChrome() async {
// Create a temporary directory for holding Chrome tests.
var systemTempDir = Directory.systemTemp;
chromeDir = await systemTempDir.createTemp('ddc_eval_test_anchor');
@ -248,14 +248,14 @@ class TestDriver {
var tab = await chrome.chromeConnection
.getTab((tab) => !tab.isBackgroundPage && !tab.isChromeExtension);
connection = await tab.connect();
debugger = (await connection).debugger;
debugger = connection.debugger;
}
/// Must be called when testing a new Dart program.
///
/// Depends on SDK artifacts (such as the sound and unsound dart_sdk.js
/// files) generated from the 'dartdevc_test' target.
void initSource(SetupCompilerOptions setup, String source) async {
Future<void> initSource(SetupCompilerOptions setup, String source) async {
this.setup = setup;
this.source = source;
testDir = await chromeDir.createTemp('ddc_eval_test');
@ -340,7 +340,7 @@ class TestDriver {
require.config({
paths: {
'dart_sdk': '$dartSdkPath',
'$moduleName': '${outputPath}'
'$moduleName': '$outputPath'
},
waitSeconds: 15
});
@ -385,13 +385,13 @@ class TestDriver {
chromeDir?.deleteSync(recursive: true);
}
void cleanupTest() async {
Future<void> cleanupTest() async {
setup.diagnosticMessages.clear();
setup.errors.clear();
await debugger.disable();
}
void check(
Future<void> check(
{String breakpointId,
String expression,
String expectedError,
@ -417,7 +417,7 @@ class TestDriver {
'Unable to find JS script corresponding to test file $output in ${debugger.scripts}.'))
.value;
// Breakpoint at the frst WIP location mapped from its Dart line.
// Breakpoint at the first WIP location mapped from its Dart line.
var dartLine = _findBreakpointLine(breakpointId);
var location = await _jsLocationFromDartLine(script, dartLine);
var bp = await debugger.setBreakpoint(location);
@ -510,7 +510,7 @@ class TestDriver {
lines.indexWhere((l) => l.endsWith('// Breakpoint: $breakpointId'));
if (lineNumber == -1) {
throw StateError(
'Unable to find breakpoint in ${input} with id: $breakpointId');
'Unable to find breakpoint in $input with id: $breakpointId');
}
return lineNumber + 1;
}

View file

@ -274,7 +274,7 @@ class TestDriver {
tempDir.delete(recursive: true);
}
void check(
Future<void> check(
{Map<String, String> scope,
String expression,
String expectedError,

View file

@ -760,7 +760,7 @@ class DDCKernelGenerator {
var dartdevc =
p.join(p.dirname(dart), 'snapshots', 'dartdevc.dart.snapshot');
Directory.fromUri(config.outputPath)..createSync();
Directory.fromUri(config.outputPath).createSync();
// generate test_library3.full.dill
var args = [

View file

@ -48,7 +48,7 @@ const txtId = DataId('txt');
String _packageConfigEntry(String name, Uri root,
{Uri packageRoot, LanguageVersion version}) {
var fields = [
'"name": "${name}"',
'"name": "$name"',
'"rootUri": "$root"',
if (packageRoot != null) '"packageUri": "$packageRoot"',
if (version != null) '"languageVersion": "$version"'

View file

@ -48,7 +48,7 @@ const txtId = DataId('txt');
String _packageConfigEntry(String name, Uri root,
{Uri packageRoot, LanguageVersion version}) {
var fields = [
'"name": "${name}"',
'"name": "$name"',
'"rootUri": "$root"',
if (packageRoot != null) '"packageUri": "$packageRoot"',
if (version != null) '"languageVersion": "$version"'