diff --git a/packages/google_fonts/CHANGELOG.md b/packages/google_fonts/CHANGELOG.md index b49a261fe0d..515350cbf6b 100644 --- a/packages/google_fonts/CHANGELOG.md +++ b/packages/google_fonts/CHANGELOG.md @@ -306,7 +306,6 @@ - `Wix Madefor Display` - `Wix Madefor Text` - `Ysabeau` - - Removed fonts: - `Arima Madurai` - `Fredoka One` diff --git a/packages/google_maps_flutter/google_maps_flutter/CHANGELOG.md b/packages/google_maps_flutter/google_maps_flutter/CHANGELOG.md index eb60690a37d..e631a57faa4 100644 --- a/packages/google_maps_flutter/google_maps_flutter/CHANGELOG.md +++ b/packages/google_maps_flutter/google_maps_flutter/CHANGELOG.md @@ -594,7 +594,6 @@ GoogleMapController is now uniformly driven by implementing `DefaultLifecycleObs ## 0.5.19 * Adds support for toggling Indoor View on or off. - * Allow BitmapDescriptor scaling override ## 0.5.18 diff --git a/packages/google_sign_in/google_sign_in/CHANGELOG.md b/packages/google_sign_in/google_sign_in/CHANGELOG.md index d3e6c62eb4c..90538ea199b 100644 --- a/packages/google_sign_in/google_sign_in/CHANGELOG.md +++ b/packages/google_sign_in/google_sign_in/CHANGELOG.md @@ -183,7 +183,6 @@ For every platform other than `web`, this version should be identical to `5.4.4` ## 5.1.0 * Add reAuthenticate option to signInSilently to allow re-authentication to be requested - * Updated Android lint settings. ## 5.0.7 diff --git a/packages/image_picker/image_picker/CHANGELOG.md b/packages/image_picker/image_picker/CHANGELOG.md index 8f6efb51383..de287c1c477 100644 --- a/packages/image_picker/image_picker/CHANGELOG.md +++ b/packages/image_picker/image_picker/CHANGELOG.md @@ -120,7 +120,6 @@ ## 0.8.6+2 * Updates `NSPhotoLibraryUsageDescription` description in README. - * Updates minimum Flutter version to 3.0. ## 0.8.6+1 diff --git a/packages/video_player/video_player/CHANGELOG.md b/packages/video_player/video_player/CHANGELOG.md index d01c0ec1d9a..99ab006aa46 100644 --- a/packages/video_player/video_player/CHANGELOG.md +++ b/packages/video_player/video_player/CHANGELOG.md @@ -593,14 +593,12 @@ DefaultHttpDataSourceFactory by default. ## 0.10.0+8 * iOS: Fix an issue where the player sends initialization message incorrectly. - * Fix a few other IDE warnings. ## 0.10.0+7 * Android: Fix issue where buffering status in percentage instead of milliseconds - * Android: Update buffering status everytime we notify for position change ## 0.10.0+6 diff --git a/packages/video_player/video_player_android/CHANGELOG.md b/packages/video_player/video_player_android/CHANGELOG.md index a6decfda03b..1984c2d5238 100644 --- a/packages/video_player/video_player_android/CHANGELOG.md +++ b/packages/video_player/video_player_android/CHANGELOG.md @@ -163,7 +163,6 @@ ## 2.7.2 * Updates minimum supported SDK version to Flutter 3.24/Dart 3.5. - * Re-adds Impeller support. ## 2.7.1 diff --git a/script/tool/lib/src/version_check_command.dart b/script/tool/lib/src/version_check_command.dart index 4d147cb92ba..08ea600c430 100644 --- a/script/tool/lib/src/version_check_command.dart +++ b/script/tool/lib/src/version_check_command.dart @@ -130,6 +130,10 @@ class VersionCheckCommand extends PackageLoopingCommand { hide: true); } + static final RegExp _blankLineInListRegex = RegExp( + r'(^[ \t]*[*+-]\s.*$\n)((^[ \t]*$\n)+)(^[ \t]*[*+-]\s.*$)', + multiLine: true); + static const String _againstPubFlag = 'against-pub'; static const String _prLabelsArg = 'pr-labels'; static const String _checkForMissingChanges = 'check-for-missing-changes'; @@ -377,7 +381,8 @@ ${indentation}HTTP response: ${pubVersionFinderResponse.httpResponse.body} // get first version from CHANGELOG final File changelog = package.changelogFile; - final List lines = changelog.readAsLinesSync(); + final String changelogContent = changelog.readAsStringSync(); + final List lines = changelogContent.split('\n'); String? firstLineWithText; final Iterator iterator = lines.iterator; while (iterator.moveNext()) { @@ -455,9 +460,37 @@ ${indentation}The first version listed in CHANGELOG.md is $fromChangeLog. } } + // Check for blank lines between list items in the version section. + final Match? blankLineMatch = _findBlankLineInList(changelogContent); + if (blankLineMatch != null) { + final String offendingLines = blankLineMatch + .group(0)! + .split('\n') + .map((String line) => '$indentation $line') // Add extra indentation + .join('\n'); + + printError( + '${indentation}Blank lines found between list items in CHANGELOG.\n' + '${indentation}This creates multiple separate lists on pub.dev.\n' + '${indentation}Remove blank lines to keep all items in a single list.\n' + '${indentation}The problematic section found is:\n' + '$offendingLines'); + return false; + } + return true; } + /// Validates that there are no blank lines between list items within + /// the changelog using a regex. + /// + /// Returns the first invalid match found, or null if validation passes. + Match? _findBlankLineInList(String changelogContent) { + // If the regex finds a match, it means there is an error (a blank line + // between list items). + return _blankLineInListRegex.firstMatch(changelogContent); + } + Pubspec? _tryParsePubspec(RepositoryPackage package) { try { final Pubspec pubspec = package.parsePubspec(); diff --git a/script/tool/pubspec.yaml b/script/tool/pubspec.yaml index 7bd5de4dde3..501d2499da3 100644 --- a/script/tool/pubspec.yaml +++ b/script/tool/pubspec.yaml @@ -1,7 +1,7 @@ name: flutter_plugin_tools description: Productivity and CI utils for flutter/packages repository: https://github.com/flutter/packages/tree/main/script/tool -version: 1.0.0 +version: 1.0.1 publish_to: none dependencies: diff --git a/script/tool/test/version_check_command_test.dart b/script/tool/test/version_check_command_test.dart index d23b7535fda..ed2a21bb501 100644 --- a/script/tool/test/version_check_command_test.dart +++ b/script/tool/test/version_check_command_test.dart @@ -421,6 +421,83 @@ void main() { ); }); + test('Fail if CHANGELOG list items have a blank line', () async { + const String version = '1.0.1'; + final RepositoryPackage plugin = + createFakePlugin('plugin', packagesDir, version: version); + + // Blank line breaks the list items. + const String changelog = ''' +## $version +* First item. + +* Second item. +* Third item. +'''; + plugin.changelogFile.writeAsStringSync(changelog); + gitProcessRunner.mockProcessesForExecutable['git-show'] = + [ + FakeProcessInfo(MockProcess(stdout: 'version: 1.0.0')), + ]; + Error? commandError; + final List output = await runCapturingPrint( + runner, ['version-check', '--base-sha=main'], + errorHandler: (Error e) { + commandError = e; + }); + + expect(commandError, isA()); + expect( + output, + containsAllInOrder([ + contains('Running for plugin'), + contains('1.0.0 -> 1.0.1'), + contains('Blank lines found between list items in CHANGELOG.'), + contains('CHANGELOG.md failed validation.'), + ]), + ); + }); + + test('Fail if CHANGELOG list items have a blank line with nested items', + () async { + const String version = '1.0.1'; + final RepositoryPackage plugin = + createFakePlugin('plugin', packagesDir, version: version); + + // Blank line in nested list items. + const String changelog = ''' +## $version +* Top level item. + * Nested item A. + + * Nested item B. +* Another top level item. +'''; + plugin.changelogFile.writeAsStringSync(changelog); + gitProcessRunner.mockProcessesForExecutable['git-show'] = + [ + FakeProcessInfo(MockProcess(stdout: 'version: 1.0.0')), + ]; + Error? commandError; + final List output = await runCapturingPrint( + runner, ['version-check', '--base-sha=main'], + errorHandler: (Error e) { + commandError = e; + }); + + expect(commandError, isA()); + expect( + output, + containsAllInOrder([ + contains('Running for plugin'), + contains('1.0.0 -> 1.0.1'), + contains('Blank lines found between list items in CHANGELOG.'), + contains('CHANGELOG.md failed validation.'), + ]), + ); + }); + // END OF NEW TESTS + test( 'Fail if pubspec version only matches an older version listed in CHANGELOG', () async {