mirror of
https://github.com/flutter/packages.git
synced 2025-06-17 19:11:11 +08:00
[ci] Improve analysis_options alignment with flutter/packages (#6728)
* Add more options that are in flutter/packages * Fix unnecessary awaits * More option alignment * Add and locally supress avoid_implementing_value_types * Fix release-info for test-only changes * Fix update-release-info handling of 'minimal' * Update release metadata
This commit is contained in:
@ -369,7 +369,7 @@ abstract class PackageLoopingCommand extends PackageCommand {
|
||||
}
|
||||
}
|
||||
|
||||
return await runForPackage(package);
|
||||
return runForPackage(package);
|
||||
}
|
||||
|
||||
void _printSuccess(String message) {
|
||||
|
@ -107,6 +107,7 @@ Future<PackageChangeState> checkPackageChangeState(
|
||||
|
||||
bool _isTestChange(List<String> pathComponents) {
|
||||
return pathComponents.contains('test') ||
|
||||
pathComponents.contains('integration_test') ||
|
||||
pathComponents.contains('androidTest') ||
|
||||
pathComponents.contains('RunnerTests') ||
|
||||
pathComponents.contains('RunnerUITests');
|
||||
|
@ -140,6 +140,9 @@ class UpdateReleaseInfoCommand extends PackageLoopingCommand {
|
||||
if (!state.hasChanges) {
|
||||
return PackageResult.skip('No changes to package');
|
||||
}
|
||||
if (!state.needsVersionChange && !state.needsChangelogChange) {
|
||||
return PackageResult.skip('No non-exempt changes to package');
|
||||
}
|
||||
if (state.needsVersionChange) {
|
||||
versionChange = _VersionIncrementType.bugfix;
|
||||
}
|
||||
|
@ -285,8 +285,7 @@ ${indentation}HTTP response: ${pubVersionFinderResponse.httpResponse.body}
|
||||
final String gitPath = path.style == p.Style.windows
|
||||
? p.posix.joinAll(path.split(relativePath))
|
||||
: relativePath;
|
||||
return await _gitVersionFinder.getPackageVersion(gitPath,
|
||||
gitRef: _mergeBase);
|
||||
return _gitVersionFinder.getPackageVersion(gitPath, gitRef: _mergeBase);
|
||||
}
|
||||
|
||||
/// Returns the state of the verison of [package] relative to the comparison
|
||||
|
@ -143,7 +143,7 @@ void main() {
|
||||
runner = CommandRunner<void>('test_package_looping_command',
|
||||
'Test for base package looping functionality');
|
||||
runner.addCommand(command);
|
||||
return await runCapturingPrint(
|
||||
return runCapturingPrint(
|
||||
runner,
|
||||
<String>[command.name, ...arguments],
|
||||
errorHandler: errorHandler,
|
||||
|
@ -388,7 +388,7 @@ $originalChangelog''';
|
||||
createFakePackage('a_package', packagesDir, version: '1.0.1');
|
||||
processRunner.mockProcessesForExecutable['git-diff'] = <io.Process>[
|
||||
MockProcess(stdout: '''
|
||||
packages/different_package/test/plugin_test.dart
|
||||
packages/different_package/lib/foo.dart
|
||||
'''),
|
||||
];
|
||||
final String originalChangelog = package.changelogFile.readAsStringSync();
|
||||
@ -411,6 +411,35 @@ packages/different_package/test/plugin_test.dart
|
||||
]));
|
||||
});
|
||||
|
||||
test('skips for "minimal" when there are only test changes', () async {
|
||||
final RepositoryPackage package =
|
||||
createFakePackage('a_package', packagesDir, version: '1.0.1');
|
||||
processRunner.mockProcessesForExecutable['git-diff'] = <io.Process>[
|
||||
MockProcess(stdout: '''
|
||||
packages/a_package/test/a_test.dart
|
||||
packages/a_package/example/integration_test/another_test.dart
|
||||
'''),
|
||||
];
|
||||
final String originalChangelog = package.changelogFile.readAsStringSync();
|
||||
|
||||
final List<String> output = await runCapturingPrint(runner, <String>[
|
||||
'update-release-info',
|
||||
'--version=minimal',
|
||||
'--changelog',
|
||||
'A change.',
|
||||
]);
|
||||
|
||||
final String version = package.parsePubspec().version?.toString() ?? '';
|
||||
expect(version, '1.0.1');
|
||||
expect(package.changelogFile.readAsStringSync(), originalChangelog);
|
||||
expect(
|
||||
output,
|
||||
containsAllInOrder(<Matcher>[
|
||||
contains('No non-exempt changes to package'),
|
||||
contains('Skipped 1 package')
|
||||
]));
|
||||
});
|
||||
|
||||
test('fails if CHANGELOG.md is missing', () async {
|
||||
createFakePackage('a_package', packagesDir, includeCommonFiles: false);
|
||||
|
||||
|
Reference in New Issue
Block a user