feat: restore pylint to the quality checks - #294
Open
farhan wants to merge 6 commits into
Open
Conversation
farhan
marked this pull request as draft
August 21, 2026 08:11
Restore pylint alongside ruff in the quality gate. Per #289, ruff is not a drop-in replacement for pylint: it doesn't run the edx_lint plugins or catch the class of issues (undefined attributes, type mismatches, etc.) pylint does. Ruff continues to handle style and import ordering. This change is integration/config only -- no source code changes: - Add `edx-lint` to the `quality` dependency group (pulls pylint plus the pylint-django / pylint-celery / pylint-plugin-utils plugins). - Add `pylintrc` and `pylintrc_tweaks` (regenerated with the current edx-lint; `load-plugins = edx_lint.pylint`, `ignore = migrations`). - Run `pylint xblocks_contrib xblock_pdf` in the `quality` tox env. - Regenerate `uv.lock` for the new dependencies (additive only). CI already runs `uv run tox` with `quality` in the matrix, so pylint runs there automatically. Re-enabling it surfaces pre-existing findings in the source, which will be addressed separately. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
farhan
force-pushed
the
farhan/restore-pylint-289
branch
from
August 21, 2026 10:47
5efa33b to
23291e6
Compare
Align the Makefile target name with the tox env it runs (`tox -e quality`) and with the quality gate terminology. The target had no external callers. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add E501 and F401 to ruff's ignore list so pylint (C0301 / W0611) is the single authority for line-length and unused-import. This resolves the ruff/pylint conflict on __init__ re-exports (ruff F401 wants a redundant `import X as X` alias, which pylint rejects as C0414) and keeps line-length enforcement in one place. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Now that ruff no longer enforces F401, drop the redundant `import X as X` re-export aliases and use plain imports (merging same-module names onto one line). This matches the pre-modernization style and clears pylint's C0414 (useless-import-alias) on these files. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Drop the `# pylint: disable=` guards that pylint now reports as useless-suppression (I0021) -- warnings that no longer fire under the current pylint, so the suppressions do nothing: - raise-missing-from guards on `raise ... from None` statements - too-many-arguments / too-many-positional-arguments guards on signatures now within the configured limits Two special cases preserved: - problem/tests/__init__.py keeps its still-needed `arguments-differ` and `unused-argument` guards; only the stale too-many-positional-arguments part is dropped. - lti/tests/helpers.py's TestToolConsumer.__init__ genuinely exceeds the positional-argument limit, so its guard is moved onto the `def` line (where it actually applies) instead of being removed. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Extract the context slice into a local so the error message f-string fits within the 120-char limit. pylint (C0301) now owns line-length since ruff cedes E501. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Important
Generated with Claude, then manually reviewed (both this PR description and the code commits).
Related
Summary
Restores
pylintto the quality gate alongsideruff. Per #289, ruff is not a drop-in replacement for pylint — it does not run theedx_lintplugins and does not catch the class of issues (undefined attributes, type mismatches, etc.) that pylint does. Ruff stays responsible for style, imports, and formatting; pylint is added back for the deeper static analysis.Ruff rules disabled in this PR
To avoid pylint/ruff double-ownership and a direct conflict, two ruff rules are disabled so pylint is the single authority for them:
F401(unused-import) — newly disabled here. Reason: ruff's F401 wants__init__.pyre-exports marked with a redundantimport X as Xalias, but pylint rejects that exact alias asC0414(useless-import-alias) — a direct, unavoidable conflict. Disabling F401 lets the__init__files use plain imports; pylint'sW0611covers unused-import instead.E501(line-too-long) — was already disabled before this PR (previously commented "handled by formatter"). Its comment is updated to reflect that pylint'sC0301now owns line-length enforcement.Everything else in ruff's
select(E,W,Fminus F401,I,B,C4,UP,DJ) stays active. This mirrors how other openedx repos that run both tools (openedx-events,openedx-filters) divide the work — pylint owns unused-import and line-length, ruff owns style.Changes, commit by commit
feat: integrate pylint into the quality checksedx-lintto thequalitydependency group (transitively pullspylint,pylint-django,pylint-celery,pylint-plugin-utils).pylintrc+pylintrc_tweaks(regenerated with currentedx-lint;load-plugins = edx_lint.pylint,ignore = migrations).pylint xblocks_contrib xblock_pdfin thequalitytox env.uv.lock(additive only).refactor: rename Makefilelinttarget toquality``linttarget toqualityto match the tox env it runs (tox -e quality). No external callers.chore: let pylint own line-length and unused-import in ruffF401andE501to ruff'signorelist with a short rationale comment (see section above).refactor: use plain imports in packageinitfilesimport X as Xre-export aliases now that ruff no longer enforces F401; use plain imports. Clears pylintC0414and restores the pre-modernization style.refactor: remove stale pylint useless-suppression comments# pylint: disable=guards pylint now reports asuseless-suppression(I0021) —raise-missing-fromguards onraise ... from None, andtoo-many-arguments/too-many-positional-argumentsguards on signatures now within limits.problem/tests/__init__.pykeeps its still-neededarguments-differ/unused-argumentguards (only the stale part dropped);lti/tests/helpers.pygenuinely exceeds the positional-arg limit, so its guard is moved onto thedefline where it actually applies.fix: wrap over-length line flagged by pylint line-too-longC0301).Testing
tox -e qualitypasses end to end:CI already runs
uv run toxwithqualityin the matrix, so pylint runs there automatically — no workflow change needed.