add a --fix flag and --fix-apply flag for fixing some issues#78
add a --fix flag and --fix-apply flag for fixing some issues#78reidbaker merged 7 commits intoflutter:mainfrom
Conversation
There was a problem hiding this comment.
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.
|
/gemini review |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
In #77 I added a whitespace checker. This adds a --fix-apply that will fix some issues
Pre-launch Checklist
///).