Skip to content

Improve --fix mode for lint scripts#229

Merged
kovtcharov merged 1 commit intomainfrom
kalin/linter
Jan 23, 2026
Merged

Improve --fix mode for lint scripts#229
kovtcharov merged 1 commit intomainfrom
kalin/linter

Conversation

@kovtcharov
Copy link
Collaborator

Changes

Updates util/lint.py and util/lint.ps1 so that --fix (or -Fix) runs only the fixable checks (Black + isort) instead of all 7 checks.

Improvements:

  • --fix alone now only runs Black and isort (faster)
  • Shows which files were actually fixed
  • Displays simplified "FIX SUMMARY" instead of full report
  • Updated header to show "Fixing Code Formatting Issues"

Usage

# Quick fix (only Black + isort)
python util/lint.py --fix

# Full lint check
python util/lint.py

# Fix + run all checks
python util/lint.py --all --fix

@kovtcharov kovtcharov added this to the v0.15.2 milestone Jan 22, 2026
@kovtcharov kovtcharov requested a review from itomek-amd January 22, 2026 22:06
@kovtcharov kovtcharov self-assigned this Jan 22, 2026
@kovtcharov kovtcharov added the devops DevOps/infrastructure changes label Jan 22, 2026
@kovtcharov
Copy link
Collaborator Author

@claude review this PR.

@github-actions
Copy link

github-actions bot commented Jan 22, 2026

Claude finished @kovtcharov's task —— View job


PR Review

  • Read the changed files
  • Review code quality and correctness
  • Provide feedback

Summary

This PR improves the --fix mode in both util/lint.py and util/lint.ps1 to run only fixable checks (Black + isort) when used alone, making it faster and more focused.

Review Feedback

🟢 Good

  1. Clean implementation - The fix-only mode detection is straightforward:

    • lint.py:548: fix_only = args.fix and not specific_checks
    • lint.ps1:413: $FixOnly = $Fix -and -not ($RunPylint -or ...)
  2. Consistent behavior - Both Python and PowerShell scripts now behave identically

  3. Helpful user feedback - Shows which files were actually fixed and provides clear next steps

  4. Progress indicators updated - Shows [1/2] and [2/2] in fix mode vs [1/7], [2/7] in full mode

🟡 Suggestions (Minor)

  1. lint.py:76 - The import re inside the function could be moved to the module level for consistency (though it's fine as-is for lazy loading)

  2. lint.py:505-514 - The print_fix_summary() function could include counts of files fixed (already tracked in the results):

    def print_fix_summary(results: list[CheckResult]) -> None:
        # Could iterate results to show actual fix counts
  3. lint.ps1:62-64 - The $cmd variable is constructed but only used for display. This is fine but could be extracted to a helper for DRY if more commands are added later.

🟢 Edge Cases Handled

  • --fix --all runs all checks with fixing enabled ✓
  • --fix --black runs only black with fixing enabled ✓
  • --fix alone runs only Black + isort ✓

Verdict

Looks good to merge! The changes are well-implemented and achieve the stated goal of making --fix faster when used standalone.


@kovtcharov kovtcharov enabled auto-merge January 22, 2026 22:15
@kovtcharov kovtcharov added this pull request to the merge queue Jan 23, 2026
Merged via the queue into main with commit 6bfaeba Jan 23, 2026
62 checks passed
@kovtcharov kovtcharov deleted the kalin/linter branch January 23, 2026 08:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

devops DevOps/infrastructure changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants