Uncomments avoid_redundant_argument_values in analysis_options.yaml (#6163)

This commit is contained in:
Rodrigues
2022-08-09 02:52:06 +03:00
committed by GitHub
parent 2b712593b4
commit d20563f6f4
17 changed files with 29 additions and 46 deletions

View File

@ -44,7 +44,6 @@ abstract class PluginCommand extends Command<void> {
}) : _gitDir = gitDir {
argParser.addMultiOption(
_packagesArg,
splitCommas: true,
help:
'Specifies which packages the command should run on (before sharding).\n',
valueHelp: 'package1,package2,...',

View File

@ -335,7 +335,7 @@ class FirebaseTestLabCommand extends PackageLoopingCommand {
}
yield* integrationTestDir
.listSync(recursive: true, followLinks: true)
.listSync(recursive: true)
.where((FileSystemEntity file) =>
file is File && file.basename.endsWith('_test.dart'))
.cast<File>();

View File

@ -35,7 +35,7 @@ class LintAndroidCommand extends PackageLoopingCommand {
if (!pluginSupportsPlatform(platformAndroid, package,
requiredMode: PlatformSupport.inline)) {
return PackageResult.skip(
'Plugin does not have an Android implemenatation.');
'Plugin does not have an Android implementation.');
}
bool failed = false;

View File

@ -33,16 +33,13 @@ class PublishCheckCommand extends PackageLoopingCommand {
help: 'Allows the pre-release SDK warning to pass.\n'
'When enabled, a pub warning, which asks to publish the package as a pre-release version when '
'the SDK constraint is a pre-release version, is ignored.',
defaultsTo: false,
);
argParser.addFlag(_machineFlag,
help: 'Switch outputs to a machine readable JSON. \n'
'The JSON contains a "status" field indicating the final status of the command, the possible values are:\n'
' $_statusNeedsPublish: There is at least one package need to be published. They also passed all publish checks.\n'
' $_statusMessageNoPublish: There are no packages needs to be published. Either no pubspec change detected or all versions have already been published.\n'
' $_statusMessageError: Some error has occurred.',
defaultsTo: false,
negatable: true);
' $_statusMessageError: Some error has occurred.');
}
static const String _allowPrereleaseFlag = 'allow-pre-release';

View File

@ -74,7 +74,6 @@ class PublishPluginCommand extends PackageLoopingCommand {
help:
'Release all packages that contains pubspec changes at the current commit compares to the base-sha.\n'
'The --packages option is ignored if this is on.',
defaultsTo: false,
);
argParser.addFlag(
_dryRunFlag,
@ -82,14 +81,10 @@ class PublishPluginCommand extends PackageLoopingCommand {
'Skips the real `pub publish` and `git tag` commands and assumes both commands are successful.\n'
'This does not run `pub publish --dry-run`.\n'
'If you want to run the command with `pub publish --dry-run`, use `pub-publish-flags=--dry-run`',
defaultsTo: false,
negatable: true,
);
argParser.addFlag(_skipConfirmationFlag,
help: 'Run the command without asking for Y/N inputs.\n'
'This command will add a `--force` flag to the `pub publish` command if it is not added with $_pubFlagsOption\n',
defaultsTo: false,
negatable: true);
'This command will add a `--force` flag to the `pub publish` command if it is not added with $_pubFlagsOption\n');
}
static const String _pubFlagsOption = 'pub-publish-flags';

View File

@ -115,8 +115,6 @@ class VersionCheckCommand extends PackageLoopingCommand {
help: 'Whether the version check should run against the version on pub.\n'
'Defaults to false, which means the version check only run against '
'the previous version in code.',
defaultsTo: false,
negatable: true,
);
argParser.addOption(_changeDescriptionFile,
help: 'The path to a file containing the description of the change '

View File

@ -504,7 +504,7 @@ void main() {
});
test('skips non-Flutter examples', () async {
createFakePackage('package', packagesDir, isFlutter: false);
createFakePackage('package', packagesDir);
final List<String> output = await runCapturingPrint(
runner, <String>['build-examples', '--ios']);

View File

@ -10,7 +10,7 @@ import 'package:test/test.dart';
void main() {
test('works on Posix', () async {
final FileSystem fileSystem =
MemoryFileSystem(style: FileSystemStyle.posix);
MemoryFileSystem();
final Directory base = fileSystem.directory('/').childDirectory('base');
final File file =

View File

@ -373,11 +373,9 @@ void main() {
test('skips unsupported Dart versions when requested', () async {
final RepositoryPackage excluded = createFakePackage(
'excluded_package', packagesDir,
isFlutter: false, dartConstraint: '>=2.17.0 <3.0.0');
'excluded_package', packagesDir, dartConstraint: '>=2.17.0 <3.0.0');
final RepositoryPackage included = createFakePackage(
'a_package', packagesDir,
isFlutter: false, dartConstraint: '>=2.14.0 <3.0.0');
'a_package', packagesDir);
final TestPackageLoopingCommand command = createTestCommand(
packageLoopingType: PackageLoopingType.includeAllSubpackages,
@ -409,7 +407,7 @@ void main() {
createFakePackage('package_b', packagesDir);
final TestPackageLoopingCommand command =
createTestCommand(hasLongOutput: true);
createTestCommand();
final List<String> output = await runCommand(command);
const String separator =
@ -443,7 +441,7 @@ void main() {
createFakePackage('package_b', packagesDir);
final TestPackageLoopingCommand command =
createTestCommand(hasLongOutput: true);
createTestCommand();
final List<String> output =
await runCommand(command, arguments: <String>['--log-timing']);
@ -595,7 +593,7 @@ void main() {
createFakePackage('package_b', packagesDir);
final TestPackageLoopingCommand command =
createTestCommand(hasLongOutput: true, captureOutput: true);
createTestCommand(captureOutput: true);
final List<String> output = await runCommand(command);
expect(output, isEmpty);
@ -786,7 +784,7 @@ void main() {
createFakePackage('package_f', packagesDir);
final TestPackageLoopingCommand command =
createTestCommand(hasLongOutput: true);
createTestCommand();
final List<String> output = await runCommand(command);
expect(
@ -812,7 +810,7 @@ void main() {
createFakePackage('package_a', packagesDir);
final TestPackageLoopingCommand command =
createTestCommand(hasLongOutput: true);
createTestCommand();
final List<String> output =
await runCommand(command, arguments: <String>['--exclude=package_a']);

View File

@ -223,12 +223,9 @@ void main() {
'plugin',
packagesDir,
platformSupport: <String, PlatformDetails>{
platformLinux: const PlatformDetails(PlatformSupport.inline,
hasNativeCode: true, hasDartCode: true),
platformMacOS: const PlatformDetails(PlatformSupport.inline,
hasNativeCode: true, hasDartCode: true),
platformWindows: const PlatformDetails(PlatformSupport.inline,
hasNativeCode: true, hasDartCode: true),
platformLinux: const PlatformDetails(PlatformSupport.inline, hasDartCode: true),
platformMacOS: const PlatformDetails(PlatformSupport.inline, hasDartCode: true),
platformWindows: const PlatformDetails(PlatformSupport.inline, hasDartCode: true),
},
);

View File

@ -213,7 +213,7 @@ void main() {
test('returns false for non-Flutter package', () async {
final RepositoryPackage package =
createFakePackage('a_package', packagesDir, isFlutter: false);
createFakePackage('a_package', packagesDir);
expect(package.requiresFlutter(), false);
});
});

View File

@ -146,7 +146,7 @@ void main() {
]);
processRunner.mockProcessesForExecutable['dart'] = <io.Process>[
MockProcess(exitCode: 0), // pub get
MockProcess(), // pub get
MockProcess(exitCode: 1), // test script
];
@ -306,7 +306,7 @@ void main() {
]);
processRunner.mockProcessesForExecutable['dart'] = <io.Process>[
MockProcess(exitCode: 0), // pub get
MockProcess(), // pub get
MockProcess(exitCode: 1), // test script
];

View File

@ -200,7 +200,7 @@ void main() {
test('handles the comment styles for all supported languages', () async {
final File fileA = root.childFile('file_a.cc');
fileA.createSync();
_writeLicense(fileA, comment: '// ');
_writeLicense(fileA);
final File fileB = root.childFile('file_b.sh');
fileB.createSync();
_writeLicense(fileB, comment: '# ');

View File

@ -24,7 +24,7 @@ void main() {
late RecordingProcessRunner processRunner;
setUp(() {
fileSystem = MemoryFileSystem(style: FileSystemStyle.posix);
fileSystem = MemoryFileSystem();
packagesDir = createPackagesDirectory(fileSystem: fileSystem);
mockPlatform = MockPlatform();
processRunner = RecordingProcessRunner();
@ -178,7 +178,7 @@ void main() {
containsAllInOrder(
<Matcher>[
contains(
'SKIPPING: Plugin does not have an Android implemenatation.')
'SKIPPING: Plugin does not have an Android implementation.')
],
));
});
@ -197,7 +197,7 @@ void main() {
containsAllInOrder(
<Matcher>[
contains(
'SKIPPING: Plugin does not have an Android implemenatation.')
'SKIPPING: Plugin does not have an Android implementation.')
],
));
});

View File

@ -23,7 +23,7 @@ void main() {
late RecordingProcessRunner processRunner;
setUp(() {
fileSystem = MemoryFileSystem(style: FileSystemStyle.posix);
fileSystem = MemoryFileSystem();
packagesDir = createPackagesDirectory(fileSystem: fileSystem);
mockPlatform = MockPlatform(isMacOS: true);

View File

@ -186,7 +186,7 @@ void main() {
extraFiles: <String>['example/build.excerpt.yaml']);
processRunner.mockProcessesForExecutable['dart'] = <io.Process>[
MockProcess(exitCode: 0), // dart pub get
MockProcess(), // dart pub get
MockProcess(exitCode: 1), // dart run build_runner ...
];
@ -211,8 +211,8 @@ void main() {
extraFiles: <String>['example/build.excerpt.yaml']);
processRunner.mockProcessesForExecutable['dart'] = <io.Process>[
MockProcess(exitCode: 0), // dart pub get
MockProcess(exitCode: 0), // dart run build_runner ...
MockProcess(), // dart pub get
MockProcess(), // dart run build_runner ...
MockProcess(exitCode: 1), // dart run code_excerpt_updater ...
];

View File

@ -117,7 +117,6 @@ RepositoryPackage createFakePlugin(
createFakePubspec(
package,
name: name,
isFlutter: true,
isPlugin: true,
platformSupport: platformSupport,
version: version,
@ -399,10 +398,10 @@ class RecordingProcessRunner extends ProcessRunner {
final io.Process? process = _getProcessToReturn(executable);
final List<String>? processStdout =
await process?.stdout.transform(stdoutEncoding.decoder).toList();
final String stdout = processStdout?.join('') ?? '';
final String stdout = processStdout?.join() ?? '';
final List<String>? processStderr =
await process?.stderr.transform(stderrEncoding.decoder).toList();
final String stderr = processStderr?.join('') ?? '';
final String stderr = processStderr?.join() ?? '';
final io.ProcessResult result = process == null
? io.ProcessResult(1, 0, '', '')