🧹 [cli] Implement fix flag for lint command - #108
Conversation
Updates `cli/src/commands/migrate.rs` to expose `migrate_source` publicly. Updates `cli/src/commands/lint.rs` to consume `migrate_source` when the `--fix` flag is true, conditionally modifying file content to remove deprecations before linting is finalized. Co-authored-by: Tcode-Motion <188012755+Tcode-Motion@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
Updates `cli/src/commands/migrate.rs` to expose `migrate_source` publicly. Updates `cli/src/commands/lint.rs` to consume `migrate_source` when the `--fix` flag is true, conditionally modifying file content to remove deprecations before linting is finalized. Co-authored-by: Tcode-Motion <188012755+Tcode-Motion@users.noreply.github.com>
🎯 What: (the code health issue addressed)
The
lintcommand advertised a--fixflag in its CLI help text ("Attempt to automatically fix lint issues", "Lints source files and optionally fixes deprecated keywords"), but the functionality was never implemented.💡 Why: (how this improves maintainability)
Implementing this flag allows developers to automatically clean up deprecated keywords (like
make,build,returnin favor ofdo,send, etc.) natively viatsc lint --fixinstead of having to rely strictly on thetsc migratecommand, aligning the CLI behavior with user expectations.✅ Verification: (how you confirmed the change is safe)
Ran
cargo test -p techscript_clito confirm that makingmigrate_sourcepublic and importing it withinlint.rsdid not introduce regressions in CLI behavior. Confirmed changes write safely to disk by only modifying files where the content actually differs.✨ Result: (the improvement achieved)
The
--fixflag ontsc lintnow correctly leverages the existing AST deprecation tracking to automate syntax migration and resolve "fix lint issues" false positives.PR created automatically by Jules for task 17829198053786084401 started by @Tcode-Motion