mirror of
https://github.com/flutter/packages.git
synced 2025-06-29 06:06:59 +08:00
Uncomments avoid_redundant_argument_values in analysis_options.yaml (#6163)
This commit is contained in:
@ -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,...',
|
||||
|
@ -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>();
|
||||
|
@ -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;
|
||||
|
@ -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';
|
||||
|
@ -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';
|
||||
|
@ -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 '
|
||||
|
@ -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']);
|
||||
|
@ -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 =
|
||||
|
@ -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']);
|
||||
|
||||
|
@ -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),
|
||||
},
|
||||
);
|
||||
|
||||
|
@ -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);
|
||||
});
|
||||
});
|
||||
|
@ -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
|
||||
];
|
||||
|
||||
|
@ -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: '# ');
|
||||
|
@ -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.')
|
||||
],
|
||||
));
|
||||
});
|
||||
|
@ -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);
|
||||
|
@ -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 ...
|
||||
];
|
||||
|
||||
|
@ -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, '', '')
|
||||
|
Reference in New Issue
Block a user