Skip to content

build: restore pylint to the quality checks - #294

Merged
kdmccormick merged 1 commit into
mainfrom
farhan/restore-pylint-289
Sep 11, 2026
Merged

kdmccormick merged 1 commit into
mainfrom
farhan/restore-pylint-289

Conversation

@farhan

@farhan farhan commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Important

Generated with Claude, then manually reviewed (both this PR description and the code commits).

Related

Summary

Restores pylint to the quality gate alongside ruff. Per #289, ruff is not a drop-in replacement for pylint — it does not run the edx_lint plugins and does not catch the class of issues (undefined attributes, type mismatches, etc.) that pylint does. Ruff stays responsible for style, imports, formatting, unused-import, and line-length; pylint is added back for the deeper static analysis.

Ruff / pylint ownership

Each check is owned by exactly one tool, so nothing is enforced twice:

  • unused-import (F401) → ruff. It's auto-fixable via ruff check --fix, so pylint disables unused-import. The package __init__ re-exports use the explicit import X as X alias idiom (PEP 484), which ruff recognizes as intentional re-exports (no F401). This idiom is used instead of __all__ because Sphinx (built with -W) re-documents __all__ re-exports under every import path, producing duplicate-object and ambiguous-cross-reference warnings that fail the docs check — the alias idiom is not re-documented by autodoc, so docs stays green. pylint's useless-import-alias (C0414) is disabled since it is a false positive on this deliberate re-export idiom.
  • line-length (E501 / C0301) → ruff. Ruff's E501 enforces the 120-char limit (its ignore list no longer skips E501); pylint's line-too-long (C0301) is disabled so the limit is checked in only one place. Ruff can auto-fix most long lines via ruff format; the few it can't (e.g. long f-strings) are split manually.

Everything else in ruff's select (E, W, F, I, B, C4, UP, DJ) stays active. This keeps pylint on its edx-lint defaults and mirrors how edx-platform runs the two tools side by side.

The change also renames the Makefile lint target to quality and removes now-redundant lint-amnesty / pylint: disable suppression comments (e.g. raise-missing-from, too-many-positional-arguments) that the restored config no longer flags.

Testing

tox -e quality passes end to end (ruff check, ruff format --check, pylint xblocks_contrib xblock_pdf), and tox -e docs builds cleanly with warnings-as-errors (-W). CI already runs uv run tox with both quality and docs in the matrix, so they run there automatically — no workflow change needed.

@farhan
farhan marked this pull request as draft August 21, 2026 08:11
@farhan
farhan force-pushed the farhan/restore-pylint-289 branch from 5efa33b to 23291e6 Compare August 21, 2026 10:47
@farhan farhan self-assigned this Aug 21, 2026
@farhan
farhan marked this pull request as ready for review August 21, 2026 13:10
@farhan farhan moved this to 👀 In review in Aximprovements Team Aug 21, 2026
@farhan
farhan requested review from a team and kdmccormick August 21, 2026 13:24
@farhan
farhan requested a review from a team August 24, 2026 10:20
@farhan
farhan force-pushed the farhan/restore-pylint-289 branch from 52f4df8 to ee34323 Compare August 24, 2026 13:24

@kdmccormick kdmccormick left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the PR!

nit: do you mind changing the commit title to build: ... ? that way, if somebody squash-merges, we end up with the correct commit message title. The commit titles matter more now that we're using them as input to semantic releases.

Comment thread pyproject.toml Outdated
@farhan
farhan force-pushed the farhan/restore-pylint-289 branch 4 times, most recently from 6b7ead8 to 0b3f0c8 Compare August 31, 2026 13:41
@farhan
farhan requested a review from kdmccormick August 31, 2026 14:07
@farhan farhan changed the title feat: restore pylint to the quality checks build: restore pylint to the quality checks Aug 31, 2026
@farhan
farhan requested a review from feanil August 31, 2026 18:12
Comment thread pyproject.toml Outdated
@farhan
farhan force-pushed the farhan/restore-pylint-289 branch 2 times, most recently from ef8a0c8 to 7d90b3b Compare September 10, 2026 14:53
Restores pylint to the quality gate alongside ruff. Ruff is not a
drop-in replacement for pylint -- it does not run the edx_lint plugins
or catch issues such as undefined attributes and type mismatches. Ruff
owns style, imports, formatting, unused-import, and line-length; pylint
provides the deeper static analysis.

Ownership is split so no check runs in both tools:

- unused-import (F401) -> ruff. It is auto-fixable, so pylint disables
  unused-import. Package __init__ re-exports use the `import X as X`
  idiom so ruff treats them as intentional re-exports (no F401) without
  Sphinx re-documenting them under -W; pylint's useless-import-alias is
  disabled as a false positive on this PEP 484 idiom.
- line-length (E501 / C0301) -> ruff, so `ruff format --fix` can
  auto-fix long lines; pylint's C0301 is disabled.

Also renames the Makefile `lint` target to `quality` and removes stale
pylint useless-suppression comments.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@farhan
farhan force-pushed the farhan/restore-pylint-289 branch from 7d90b3b to f3b718c Compare September 10, 2026 14:57
@farhan
farhan requested a review from kdmccormick September 10, 2026 15:03
@farhan

farhan commented Sep 10, 2026

Copy link
Copy Markdown
Contributor Author

@kdmccormick
Squashed & addressed, its available for next pass/merge

@kdmccormick
kdmccormick merged commit dfb97f8 into main Sep 11, 2026
12 of 13 checks passed
@kdmccormick
kdmccormick deleted the farhan/restore-pylint-289 branch September 11, 2026 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Restore pylint: ruff is not a drop-in replacement

3 participants