Skip to content

add a --fix flag and --fix-apply flag for fixing some issues#78

Merged
reidbaker merged 7 commits intoflutter:mainfrom
reidbaker:r-add-fix-option
Apr 14, 2026
Merged

add a --fix flag and --fix-apply flag for fixing some issues#78
reidbaker merged 7 commits intoflutter:mainfrom
reidbaker:r-add-fix-option

Conversation

@reidbaker
Copy link
Copy Markdown
Contributor

In #77 I added a whitespace checker. This adds a --fix-apply that will fix some issues

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read the Flutter Style Guide recently, and have followed its advice.
  • I signed the CLA.
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is test-exempt.
  • All existing and new tests are passing.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a lint fixing mechanism to the dart_skills_lint tool, adding --fix (dry run) and --fix-apply flags to the CLI. It includes a new FixableRule interface and implements it for the TrailingWhitespaceRule. Feedback suggests addressing the exit code behavior when fixes are applied, refactoring duplicated rule creation logic, and using a shared constant for the SKILL.md filename. Additionally, concerns were raised regarding the potential for stale context during sequential fixes and the limitations of the current line-by-line diffing algorithm for dry runs.

Comment thread tool/dart_skills_lint/lib/src/entry_point.dart Outdated
Comment thread tool/dart_skills_lint/lib/src/entry_point.dart Outdated
Comment thread tool/dart_skills_lint/lib/src/entry_point.dart Outdated
Comment thread tool/dart_skills_lint/lib/src/entry_point.dart Outdated
Comment thread tool/dart_skills_lint/lib/src/entry_point.dart
@reidbaker
Copy link
Copy Markdown
Contributor Author

/gemini review

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a lint fixing mechanism to the dart_skills_lint tool, enabling users to preview or apply automated fixes for specific rules using new --fix and --fix-apply CLI flags. The implementation includes a FixableRule interface and provides fix logic for AbsolutePathsRule, NameFormatRule, and TrailingWhitespaceRule. Review feedback highlights an opportunity to improve the robustness of the path-fixing logic by using replaceAllMapped to avoid unintended replacements and recommends using the SkillContext.skillFileName constant for better maintainability.

Comment thread tool/dart_skills_lint/lib/src/rules/absolute_paths_rule.dart
Comment thread tool/dart_skills_lint/lib/src/rules/trailing_whitespace_rule.dart
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a lint fixing mechanism to the dart_skills_lint tool, adding --fix and --fix-apply CLI flags. It defines a FixableRule interface and provides implementations for correcting absolute paths, skill names, and trailing whitespace. Feedback focuses on improving the robustness of the AbsolutePathsRule fix implementation to avoid path corruption and suggests using a more sophisticated diffing library for the CLI output to handle potential line additions or removals in the future.

Comment thread tool/dart_skills_lint/lib/src/rules/absolute_paths_rule.dart Outdated
Comment thread tool/dart_skills_lint/lib/src/entry_point.dart
@reidbaker reidbaker merged commit 9eff6bb into flutter:main Apr 14, 2026
7 checks passed
@reidbaker reidbaker deleted the r-add-fix-option branch April 14, 2026 15:15
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.

1 participant