Skip to content

Conversation

@Jkhall81
Copy link
Contributor

@Jkhall81 Jkhall81 commented Jan 9, 2026

Summary

Ruff's --fix for RUF100 can inadvertently remove trailing comments (e.g., pylint or mypy suppressions) by interpreting them as descriptions. This PR adds a "Conflict with other linters" section to the rule documentation to clarify this behavior and provide the double-hash (# noqa # pylint) workaround.

Fixes

Fixes #20762

@Jkhall81 Jkhall81 force-pushed the fix/ruff-100-docs-20762 branch from 9d8f047 to 7d1a644 Compare January 9, 2026 13:54
@astral-sh-bot
Copy link

astral-sh-bot bot commented Jan 9, 2026

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

@Jkhall81 Jkhall81 force-pushed the fix/ruff-100-docs-20762 branch from 7d1a644 to d835631 Compare January 9, 2026 14:26
@amyreese amyreese added the documentation Improvements or additions to documentation label Jan 9, 2026
@amyreese amyreese changed the title docs(ruff): document RUF100 trailing comment behavior (#20762) [ruff] document RUF100 trailing comment fix behavior Jan 9, 2026
@amyreese amyreese merged commit f40c578 into astral-sh:main Jan 9, 2026
41 checks passed
@MichaReiser
Copy link
Member

Makes sense. I'm surprised that pylint recognizes nested suppressions like this (without requiring # pylint

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RUF100 fix removes remaining comment

3 participants