Skip to content

Enable Ruff flake8-annotations - #4749

Merged
svartkanin merged 5 commits into
archlinux:masterfrom
codefiles:ruff-ann
Sep 21, 2026
Merged

svartkanin merged 5 commits into
archlinux:masterfrom
codefiles:ruff-ann

Conversation

@codefiles

@codefiles codefiles commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

Use Any for missing types so ANN001, ANN002, and ANN003 can be enabled.

Reference:

https://docs.astral.sh/ruff/rules/#flake8-annotations-ann

@codefiles
codefiles requested a review from Torxed as a code owner September 1, 2026 22:24
@codefiles
codefiles force-pushed the ruff-ann branch 2 times, most recently from c7fbf36 to 1a5bfd6 Compare September 2, 2026 10:16
Comment thread docs/conf.py
Comment on lines +12 to +19
def process_docstring(
app: Sphinx,
what: str,
name: str,
obj: Any,
options: Any,
lines: list[str],
) -> None:

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@codefiles

Copy link
Copy Markdown
Contributor Author

This has overlap with mypy functionality. That is not a problem because Ruff is fast, not noticeably any slower with this enabled, and the error messages are more understandable.

@svartkanin
svartkanin merged commit 12b45c7 into archlinux:master Sep 21, 2026
12 checks passed
@codefiles
codefiles deleted the ruff-ann branch September 21, 2026 23:11
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.

2 participants