Enable avoid_redundant_argument_values lint (#91409)

This commit is contained in:
Ian Hickson
2021-10-07 20:13:02 -07:00
committed by GitHub
parent 4bf7179e51
commit 5fd259be24
667 changed files with 1693 additions and 3385 deletions

View File

@@ -30,14 +30,12 @@ Future<void> main(List<String> arguments) async {
final ArgParser argParser = ArgParser();
argParser.addOption(
'temp',
defaultsTo: null,
help: 'A location where temporary files may be written. Defaults to a '
'directory in the system temp folder. If specified, will not be '
'automatically removed at the end of execution.',
);
argParser.addFlag(
'verbose',
defaultsTo: false,
negatable: false,
help: 'Print verbose output for the analysis process.',
);
@@ -52,12 +50,10 @@ Future<void> main(List<String> arguments) async {
argParser.addFlag(
'include-dart-ui',
defaultsTo: true,
negatable: true,
help: 'Includes the dart:ui code supplied by the engine in the analysis.',
);
argParser.addFlag(
'help',
defaultsTo: false,
negatable: false,
help: 'Print help for this command.',
);
@@ -69,7 +65,6 @@ Future<void> main(List<String> arguments) async {
argParser.addFlag(
'global-activate-snippets',
defaultsTo: true,
negatable: true,
help: 'Whether or not to "pub global activate" the snippets package. If set, will '
'activate version $_snippetsActivateVersion',
);
@@ -476,7 +471,6 @@ class SampleChecker {
if (!Platform.environment.containsKey('FLUTTER_ROOT')) 'FLUTTER_ROOT': _flutterRoot,
if (_flutterVersion!.isNotEmpty) 'FLUTTER_VERSION': _flutterVersion!,
},
includeParentEnvironment: true,
);
}
@@ -1155,7 +1149,7 @@ class Sample {
final StringBuffer buf = StringBuffer('sample ${args.join(' ')}\n');
int count = start.line;
for (final String line in input) {
buf.writeln(' ${count.toString().padLeft(4, ' ')}: $line');
buf.writeln(' ${count.toString().padLeft(4)}: $line');
count++;
}
return buf.toString();

View File

@@ -94,8 +94,6 @@ class AppServer {
debugPort: browserDebugPort,
url: appUrl,
userDataDirectory: userDataDirectory.path,
windowHeight: 1024,
windowWidth: 1024,
), onError: chromeErrorCompleter.complete);
return AppServer._(server, chrome, chromeErrorCompleter.future);
}

View File

@@ -687,7 +687,6 @@ class ArchivePublisher {
try {
await _runGsUtil(
<String>['stat', cloudPath],
failOk: false,
);
} on PreparePackageException {
// `gsutil stat gs://path/to/file` will exit with 1 if file does not exist
@@ -737,7 +736,6 @@ Future<void> main(List<String> rawArguments) async {
final ArgParser argParser = ArgParser();
argParser.addOption(
'temp_dir',
defaultsTo: null,
help: 'A location where temporary files may be written. Defaults to a '
'directory in the system temp folder. Will write a few GiB of data, '
'so it should have sufficient free space. If a temp_dir is not '
@@ -745,18 +743,15 @@ Future<void> main(List<String> rawArguments) async {
'removed automatically.',
);
argParser.addOption('revision',
defaultsTo: null,
help: 'The Flutter git repo revision to build the '
'archive with. Must be the full 40-character hash. Required.');
argParser.addOption(
'branch',
defaultsTo: null,
allowed: Branch.values.map<String>((Branch branch) => getBranchName(branch)),
help: 'The Flutter branch to build the archive with. Required.',
);
argParser.addOption(
'output',
defaultsTo: null,
help: 'The path to the directory where the output archive should be '
'written. If --output is not specified, the archive will be written to '
"the current directory. If the output directory doesn't exist, it, and "
@@ -764,7 +759,6 @@ Future<void> main(List<String> rawArguments) async {
);
argParser.addFlag(
'publish',
defaultsTo: false,
help: 'If set, will publish the archive to Google Cloud Storage upon '
'successful creation of the archive. Will publish under this '
'directory: $baseUrl$releaseFolder',
@@ -772,18 +766,15 @@ Future<void> main(List<String> rawArguments) async {
argParser.addFlag(
'force',
abbr: 'f',
defaultsTo: false,
help: 'Overwrite a previously uploaded package.',
);
argParser.addFlag(
'dry_run',
defaultsTo: false,
negatable: false,
help: 'Prints gsutil commands instead of executing them.',
);
argParser.addFlag(
'help',
defaultsTo: false,
negatable: false,
help: 'Print help for this command.',
);

View File

@@ -645,7 +645,7 @@ Future<void> _runFrameworkTests() async {
Future<void> runLibraries() async {
final List<String> tests = Directory(path.join(flutterRoot, 'packages', 'flutter', 'test'))
.listSync(followLinks: false, recursive: false)
.listSync(followLinks: false)
.whereType<Directory>()
.where((Directory dir) => dir.path.endsWith('widgets') == false)
.map<String>((Directory dir) => path.join('test', path.basename(dir.path)) + path.separator)
@@ -1215,7 +1215,7 @@ Future<void> _ensureChromeDriverIsRunning() async {
final Uri chromeDriverUrl = Uri.parse('http://localhost:4444/status');
final HttpClientRequest request = await client.getUrl(chromeDriverUrl);
final HttpClientResponse response = await request.close();
final Map<String, dynamic> webDriverStatus = json.decode(await response.transform(utf8.decoder).join('')) as Map<String, dynamic>;
final Map<String, dynamic> webDriverStatus = json.decode(await response.transform(utf8.decoder).join()) as Map<String, dynamic>;
client.close();
final bool webDriverReady = (webDriverStatus['value'] as Map<String, dynamic>)['ready'] as bool;
if (!webDriverReady) {

View File

@@ -193,6 +193,6 @@ void main() {
const Hash256(0xA8100AE6AA1940D0, 0xB663BB31CD466142, 0xEBBDBD5187131B92, 0xD93818987832EB89), // sha256("\xff")
const Hash256(0x155644D3F13D98BF, 0, 0, 0),
},
), exitCode: 0);
));
});
}

View File

@@ -266,7 +266,6 @@ void main() {
tempDir,
testRef,
Branch.dev,
strict: true,
processManager: processManager,
subprocessOutput: false,
platform: platform,
@@ -495,7 +494,7 @@ void main() {
'$gsutilCall -- stat $gsArchivePath': <ProcessResult>[ProcessResult(0, 0, '', '')],
};
processManager.addCommands(convertResults(calls));
expect(() async => publisher.publishArchive(false), throwsException);
expect(() async => publisher.publishArchive(), throwsException);
});
test('publishArchive does not throw if forceUpload is true and artifact already exists on cloud storage', () async {

View File

@@ -401,7 +401,6 @@ Future<void> main(List<String> rawArguments) async {
final ArgParser argParser = ArgParser();
argParser.addOption(
'temp_dir',
defaultsTo: null,
help: 'A location where temporary files may be written. Defaults to a '
'directory in the system temp folder. If a temp_dir is not '
'specified, then by default a generated temporary directory will be '
@@ -431,7 +430,6 @@ Future<void> main(List<String> rawArguments) async {
);
argParser.addFlag(
'confirm',
defaultsTo: false,
help: 'If set, will actually remove the archive from Google Cloud Storage '
'upon successful execution of this script. Published archives will be '
'removed from this directory: $baseUrl$releaseFolder. This option '
@@ -440,7 +438,6 @@ Future<void> main(List<String> rawArguments) async {
);
argParser.addFlag(
'help',
defaultsTo: false,
negatable: false,
help: 'Print help for this command.',
);