Skip to content

[pycodestyle] Recognize pyrefly: as a pragma comment (E501)#24019

Merged
MichaReiser merged 2 commits intoastral-sh:mainfrom
tmimmanuel:fix/e501-account-pyrefly-ignore-comments
Mar 17, 2026
Merged

[pycodestyle] Recognize pyrefly: as a pragma comment (E501)#24019
MichaReiser merged 2 commits intoastral-sh:mainfrom
tmimmanuel:fix/e501-account-pyrefly-ignore-comments

Conversation

@tmimmanuel
Copy link
Contributor

Summary

Add "pyrefly" to the pragma prefix list in is_pragma_comment() so that
# pyrefly: ignore[...] comments are treated the same as # pyright: ignore[...]
for E501 line-length checks.

Closes #24011

Test Plan

cargo test -p ruff_python_trivia -- is_pragma_comment
cargo test -p ruff_linter -- rule_linetoolong_path_new_e501_3

@astral-sh-bot
Copy link

astral-sh-bot bot commented Mar 17, 2026

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

Formatter (stable)

✅ ecosystem check detected no format changes.

Formatter (preview)

✅ ecosystem check detected no format changes.

…__rules__pycodestyle__tests__E501_E501_3.py.snap.new
@MichaReiser MichaReiser merged commit 7255e36 into astral-sh:main Mar 17, 2026
45 checks passed
@ntBre ntBre added the rule Implementing or modifying a lint rule label Mar 17, 2026
carljm added a commit that referenced this pull request Mar 17, 2026
* main:
  [ty] Filter out unsatisfiable inference attempts during generic call narrowing (#24025)
  [ty] Avoid inferring intersection types for call arguments (#23933)
  [ty] Pin mypy_primer in `setup_primer_project.py` (#24020)
  [`pycodestyle`] Recognize `pyrefly:` as a pragma comment (`E501`) (#24019)
  Add company AI policy to contributing guide (#24021)
  [ty] Remove the mypy_primer CI workflow (#24016)
  Update prek dependencies (#23980)
  [ty] Smarter semantic token classification for attribute access on union type (#23841)
  [ty] ecosystem-analyzer: Inline diffs and panic messages (#24015)
  [ty] Improve `.toml` support in the ty playground (#23476)
  PEP 639 license information (#19661)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

rule Implementing or modifying a lint rule

Projects

None yet

Development

Successfully merging this pull request may close these issues.

E501 does account pyrefly: ignore comments as violations

4 participants