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

fix: Version String Format Change Fix #148

Merged
merged 4 commits into from
Jan 24, 2025
Merged

fix: Version String Format Change Fix #148

merged 4 commits into from
Jan 24, 2025

Conversation

blendthink
Copy link
Member

Issue

Overview (Required)

This PR addresses the issue where lint rules were not being generated correctly due to a format change in the version strings from "major.minor.patch" (e.g., "2.2.0") to "major.minor" (e.g., "2.2") in the source data.

Changes

  • Updated version string parsing logic to handle the new format
  • Regenerated lint rules with the fixed parser

Important Notes

⚠️ While regenerating the rules, we noticed some breaking changes where existing lint rules (such as package_api_docs and unsafe_html) were removed from the generated output. Due to these breaking changes, we plan to hold off on releasing until Issue #138 is resolved.

Scope

This PR specifically focuses on the version string parsing fix. Updates for the latest Dart/Flutter lint rules will be discussed and handled separately to keep the changes focused and manageable.

Links

Screenshot

N/A

Update version string parsing logic to handle new format in rules.json
where sinceDartSdk field changed from "major.minor.patch" (e.g. "2.2.0")
to "major.minor" format (e.g. "2.2").
Copy link
Contributor

Ready for review 🚀

@blendthink blendthink requested review from masa-futa and removed request for Yamasaki-pan961, morikann, YumNumm, trm11tkr and K9i-0 January 23, 2025 00:09
Copy link
Contributor

@masa-futa masa-futa 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 the great improvements!!
So it was a problem with sinceDartSdk. It was a blind spot for me.
All the workarounds seemed fine, so I accepted them!! 🙌

(It might be a good idea to raise an issue with pub_semver, since I'm sure there are at least a few people with the same problem.🤔)


- Removed lint rules as they are now marked as "removed" in the upstream Dart SDK [dart-lang/sdk/pkg/linter/tool/machine/rules.json@762a4c7]. This is an intentional change as these rules have been officially deprecated:
- `package_api_docs`
- `unsafe_html`
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
👍

// NOTE:
// This is a workaround for the fact that the `sinceDartSdk` field in the [rules.json] is not always a valid version.
// Expected format: "1.0", "2.1", etc.
// Unexpected format examples: "3.3-wip", "3.5-dev", etc.
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 9cc2a8c into main Jan 24, 2025
2 checks passed
@blendthink blendthink deleted the fix/version-format branch January 24, 2025 00:17
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.

[Feature Request]: Support for new lint rule definition files
2 participants