Expand ruff lint rules and rename make targets (chk→lint, fmt→format)#687
Merged
laughingman7743 merged 2 commits intomasterfrom Feb 22, 2026
Merged
Expand ruff lint rules and rename make targets (chk→lint, fmt→format)#687laughingman7743 merged 2 commits intomasterfrom
laughingman7743 merged 2 commits intomasterfrom
Conversation
Add 11 new ruff lint rule categories (UP, PIE, PERF, T20, FLY, ISC, RSE, RUF, PGH, G, PT) and fix all violations across the codebase. Key changes: - Rename `make chk` to `make lint` in Makefile, CLAUDE.md, and docs - Modernize type annotations (Union → X|Y, Optional → X|None) - Convert f-string logging to lazy % formatting (G004/G003) - Replace blanket `# type: ignore` with specific error codes (PGH003) - Add ClassVar annotations for mutable class attributes (RUF012) - Add match parameters to pytest.raises(ValueError) calls (PT011) - Extract setup from pytest.raises blocks (PT012) - Use tuple for pytest.mark.parametrize names (PT006) - Replace yield-for-loop with yield from (UP028) - Use collection unpacking instead of concatenation (RUF005) - Add per-file-ignores for SQLAlchemy naming conventions (N802, N801) - Suppress PEP 249 required names that conflict with lint rules (B027, N818) - Exclude benchmarks directory from ruff checking Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <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.
Summary
make chk→make lint,make fmt→make formatacross Makefile, CLAUDE.md, and docsmake lint(ruff check + ruff format + mypy)Key changes
Union→X | Y,Optional→X | None(UP007)%formatting (G004/G003)# type: ignorewith specific error codes like[arg-type],[override](PGH003)ClassVarfor mutable class-level constants; use# noqa: RUF012for SQLAlchemy-inherited attributesmatch=topytest.raises(ValueError)(PT011), extract setup fromraisesblocks (PT012), use tuple for parametrize names (PT006)yield from(UP028), collection unpacking (RUF005), remove unused imports (F401)N802,N801), PEP 249 required names (B027,N818)Logic changes (non-cosmetic)
Most changes are cosmetic (import cleanup, comment changes, annotation syntax). The following are the only changes that affect runtime or test behavior:
pyathena/polars/result_set.py:683for batch in ...: yield batch→yield from ...(UP028)pyathena/arrow/result_set.py:193[ISO8601] + self._timestamp_parsers→[ISO8601, *self._timestamp_parsers](RUF005)pyathena/pandas/util.py:292list[concurrent.futures.Future[Any]]tofuturesvariablepyathena/pandas/result_set.py:371# noqa: PERF203to intentional try-except-in-looppyathena/s3fs/result_set.py:20Union[type[...], type[...]]→type[...] | type[...]withfrom __future__ import annotations_logger.info(f"msg {var}")→_logger.info("msg %s", var)tests/pyathena/sqlalchemy/test_compiler.pystmt = select(...)beforewith pytest.raises(...)block (PT012)match=parameter topytest.raises(ValueError)tests/pyathena/test_cursor.py"query,description"→("query", "description")in parametrize (PT006)tests/pyathena/aio/test_cursor.py,tests/pyathena/aio/s3fs/test_cursor.pyrows = []; async for row in cursor: rows.append(row)→rows = [row async for row in cursor](PERF401)Test plan
make lintpasses cleanly (ruff check, ruff format --check, mypy)make testpassesmake test-sqlapasses🤖 Generated with Claude Code