[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:
stuartmorgan
2022-11-21 13:49:06 -05:00
committed by GitHub
parent 6a0c9ef00d
commit d404da6e85
6 changed files with 37 additions and 5 deletions

View File

@ -369,7 +369,7 @@ abstract class PackageLoopingCommand extends PackageCommand {
}
}
return await runForPackage(package);
return runForPackage(package);
}
void _printSuccess(String message) {

View File

@ -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');

View File

@ -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;
}

View File

@ -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

View File

@ -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,

View File

@ -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);