Replace pylint + autopep8 with ruff#1300
Draft
sbryngelson wants to merge 4 commits intoMFlowCode:masterfrom
Draft
Replace pylint + autopep8 with ruff#1300sbryngelson wants to merge 4 commits intoMFlowCode:masterfrom
sbryngelson wants to merge 4 commits intoMFlowCode:masterfrom
Conversation
This comment has been minimized.
This comment has been minimized.
- Replace autopep8 with ruff format, pylint with ruff check - Add ruff.toml config at repo root (E, F, W, I, PL rule sets) - Enable ruff check --fix in format.sh and lint.sh for safe auto-fixes - Remove all ~229 inline pylint: disable comments - Fix code violations: E731 (lambda), E741 (ambiguous var), E721 (type comparison), PLW1641 (hash), PLR1722 (sys.exit), F541 (f-string), E501 (line length), E702 (semicolons), PLW2901 (loop var overwrite) - Add ~12 noqa comments for intentional global statements (PLW0603/PLW0602) - Remove 8 zero-violation rules from ignore list to keep config minimal - Fix lint.sh symlink path resolution breaking ruff config discovery - Replace pylint and autopep8 deps with ruff in pyproject.toml Resolves MFlowCode#1281 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This comment has been minimized.
This comment has been minimized.
…-fix - Add PLW0602 (global-variable-not-assigned) to ruff.toml ignore list instead of scattering noqa comments across ~19 call sites - Change ruff check --fix to keep stderr visible (> /dev/null || true instead of > /dev/null 2>&1 || true) so config/invocation errors are not silently swallowed Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This comment has been minimized.
This comment has been minimized.
- Use dataclasses.fields() instead of dataclasses.asdict() in MFCConfig.__hash__ to avoid issues with nested types and sorted() - Delete format_python.sh which is no longer referenced by anything Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This comment has been minimized.
This comment has been minimized.
- Use ruff check --fix-only instead of --fix || true so genuine ruff failures propagate while still tolerating unfixable violations - Update CLAUDE.md: Pylint -> Ruff in lint command description - Add 4 unit tests for MFCConfig.__hash__ (hash/eq contract, set/dict usage) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This comment has been minimized.
This comment has been minimized.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Resolves #1281 — replaces pylint + autopep8 with ruff for all Python linting and formatting. Ruff is ~200-500x faster (under 0.2s vs 30-90s for the old pylint + autopep8 pipeline across 226 Python files).
What changed
ruff format. Per-filefind | xargsreplaced with direct directory-levelruff formatcalls.ruff checkwith rule sets E (pycodestyle), F (pyflakes), W (warnings), I (isort), PL (pylint-equivalent).ruff check --fixruns automatically in both./mfc.sh formatand./mfc.sh lintto fix safe issues (import sorting, unused f-prefixes, etc.) before checking.ruff.tomlat repo root (centralized, replaces scattered pylint/autopep8 config). Only 6 rules ignored — all high-count structural/style rules (too-many-branches, magic-value-comparison, etc.).# pylint: disable=comments. Added ~12 targeted# noqa:comments for intentionalglobalstatements.l→line!=→is notfor type comparison__hash__toMFCConfigdataclassexit()→sys.exit()fprefix from 40 f-strings without placeholderspylintandautopep8withruffinpyproject.toml.lint.shused$(pwd)/toolchain/which resolved symlinks and broke ruff config discovery; switched to relative paths.Config details (
ruff.toml)Per-file ignores for
examples/andbenchmarks/(permissive for user-facing case files).Test plan
./mfc.sh lintpasses (ruff check clean + 165 unit tests)./mfc.sh formatruns without errors./mfc.sh precheckpasses all 5 checks (formatting, spelling, toolchain lint, source lint, doc references)🤖 Generated with Claude Code