mirror of
https://github.com/flutter/packages.git
synced 2025-08-06 00:42:13 +08:00
Revert "Enable lints library_private_types_in_public_api
, sort_child_properties_last
and use_key_in_widget_constructors
" (#5691)
This reverts commit 5d92a4717a7a266f485974ff5403122ef2570935. This includes a fix for a latent bug in the version-check repo tooling command that caused it to fail when reverting a package that previously had a NEXT section, so that tests will pass.
This commit is contained in:
@ -319,14 +319,14 @@ String _pluginPlatformSection(
|
||||
return entry;
|
||||
}
|
||||
|
||||
typedef ErrorHandler = void Function(Error error);
|
||||
typedef _ErrorHandler = void Function(Error error);
|
||||
|
||||
/// Run the command [runner] with the given [args] and return
|
||||
/// what was printed.
|
||||
/// A custom [errorHandler] can be used to handle the runner error as desired without throwing.
|
||||
Future<List<String>> runCapturingPrint(
|
||||
CommandRunner<void> runner, List<String> args,
|
||||
{ErrorHandler? errorHandler}) async {
|
||||
{_ErrorHandler? errorHandler}) async {
|
||||
final List<String> prints = <String>[];
|
||||
final ZoneSpecification spec = ZoneSpecification(
|
||||
print: (_, __, ___, String message) {
|
||||
|
@ -44,7 +44,7 @@ class MockProcessResult extends Mock implements io.ProcessResult {}
|
||||
|
||||
void main() {
|
||||
const String indentation = ' ';
|
||||
group('$VersionCheckCommand', () {
|
||||
group('VersionCheckCommand', () {
|
||||
late FileSystem fileSystem;
|
||||
late MockPlatform mockPlatform;
|
||||
late Directory packagesDir;
|
||||
@ -602,7 +602,7 @@ This is necessary because of X, Y, and Z
|
||||
);
|
||||
});
|
||||
|
||||
test('Fail if the version changes without replacing NEXT', () async {
|
||||
test('fails if the version increases without replacing NEXT', () async {
|
||||
final RepositoryPackage plugin =
|
||||
createFakePlugin('plugin', packagesDir, version: '1.0.1');
|
||||
|
||||
@ -632,6 +632,33 @@ This is necessary because of X, Y, and Z
|
||||
);
|
||||
});
|
||||
|
||||
test('allows NEXT for a revert', () async {
|
||||
final RepositoryPackage plugin =
|
||||
createFakePlugin('plugin', packagesDir, version: '1.0.0');
|
||||
|
||||
const String changelog = '''
|
||||
## NEXT
|
||||
* Some changes that should be listed as part of 1.0.1.
|
||||
## 1.0.0
|
||||
* Some other changes.
|
||||
''';
|
||||
createFakeCHANGELOG(plugin, changelog);
|
||||
createFakeCHANGELOG(plugin, changelog);
|
||||
processRunner.mockProcessesForExecutable['git-show'] = <io.Process>[
|
||||
MockProcess(stdout: 'version: 1.0.1'),
|
||||
];
|
||||
|
||||
final List<String> output = await runCapturingPrint(
|
||||
runner, <String>['version-check', '--base-sha=main']);
|
||||
expect(
|
||||
output,
|
||||
containsAllInOrder(<Matcher>[
|
||||
contains('New version is lower than previous version. '
|
||||
'This is assumed to be a revert.'),
|
||||
]),
|
||||
);
|
||||
});
|
||||
|
||||
test(
|
||||
'fails gracefully if the version headers are not found due to using the wrong style',
|
||||
() async {
|
||||
|
Reference in New Issue
Block a user