Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update package version to 2.2.0 #135

Merged
merged 3 commits into from
Aug 15, 2024
Merged

Update package version to 2.2.0 #135

merged 3 commits into from
Aug 15, 2024

Conversation

blendthink
Copy link
Member

Issue

Overview (Required)

The following commit removes the group field from machine/rules.json and adds the categories field:

dart-lang/sdk@c50c194

The above destructive change broke the automatic lint rule generation workflow and has been corrected to work.

Broken workflow:

https://github.com/yumemi-inc/flutter-yumemi-lints/actions/runs/10311663289

Lint rules added in Dart 3.5:

There are no lint rules added in Flutter 3.24.

Links

Copy link
Contributor

Ready for review 🚀

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

memo-badge
Confirmed that there is no difference in the contents of all all.yaml's in Flutter.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

memo-badge
Confirmed that there is no difference in the contents of all all.yaml's in Dart.

Test Code

import 'dart:io';

import 'package:test/test.dart';

void main() {
  final dartSdkVersions = [
    '2.17',
    '2.18',
    '2.19',
    '3.0',
    '3.1',
    '3.2',
    '3.3',
    '3.4',
  ];

  final regex = RegExp(r'^- (?<name>[a-zA-Z_]+)\s+(.*)$');

  for (final dartSdkVersion in dartSdkVersions) {
    group(
      'Whether there is a difference: $dartSdkVersion',
      () {
        final oldContent = File(
          'test/old/dart/$dartSdkVersion/all.yaml',
        ).readAsStringSync();
        final newContent = File(
          'test/new/dart/$dartSdkVersion/all.yaml',
        ).readAsStringSync();

        final newContents = newContent.split('\n');

        for (final newContent in newContents) {
          final content = newContent.trim();
          final a = regex.firstMatch(content);
          final lintName = a?.namedGroup('name');
          if (lintName == null) {
            continue;
          }

          test(
            'lint rule: $lintName',
            () {
              expect(
                oldContent.contains('- $lintName'),
                isTrue,
              );
            },
          );
        }
      },
    );
  }
}

@blendthink blendthink enabled auto-merge August 15, 2024 11:32
@blendthink blendthink mentioned this pull request Aug 15, 2024
Copy link
Contributor

@morikann morikann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for confirming that the lint rules for each of Flutter and Dart do not differ from the previous one!

LGTM!


<!-- Links -->

[Keep a Changelog]: https://keepachangelog.com
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good-badge
😍

@blendthink blendthink merged commit c9c483f into main Aug 15, 2024
2 checks passed
@blendthink blendthink deleted the release/2.2.0 branch August 15, 2024 11:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Fix update-lint-rules workflow
2 participants