Skip to content

Enable ruff PL (pylint) rules#2006

Merged
iMicknl merged 2 commits intov2/mainfrom
v2/ruff-pl
Apr 19, 2026
Merged

Enable ruff PL (pylint) rules#2006
iMicknl merged 2 commits intov2/mainfrom
v2/ruff-pl

Conversation

@iMicknl
Copy link
Copy Markdown
Owner

@iMicknl iMicknl commented Apr 19, 2026

Summary

  • Add pylint rule set with targeted ignores for legitimate patterns:
    • PLR0913 globally (model constructors have many args by design)
    • PLC0415 globally (intentional lazy imports for boto3/warrant-lite)
    • PLR0911 globally (factory functions with many return statements)
    • PLR2004 in tests (magic values are fine in assertions)
    • PLR0912/PLR0915 in utils (generator scripts are inherently complex)
  • Add noqa for well-known HTTP status codes (204, 503) and JWT segment check

Test plan

  • ruff check . passes
  • pytest — 280 tests pass
  • mypy passes

@iMicknl iMicknl added enhancement New feature or request v2 labels Apr 19, 2026
Copilot AI review requested due to automatic review settings April 19, 2026 17:22
@iMicknl iMicknl requested a review from tetienne as a code owner April 19, 2026 17:22
@iMicknl iMicknl added enhancement New feature or request v2 labels Apr 19, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Enables Ruff’s pylint (PL) rule set and configures a small set of global and per-path ignores to accommodate established patterns in the codebase (constructors with many args, lazy imports, factory-style returns, and complex generator scripts).

Changes:

  • Enable Ruff pylint rules (PL) and add targeted global ignores (PLR0913, PLC0415, PLR0911) in pyproject.toml.
  • Add per-file ignores for tests (PLR2004) and utils (PLR0912, PLR0915).
  • Add # noqa: PLR2004 suppressions for a few intentional “magic value” comparisons (HTTP status codes and JWT segment count).

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
pyproject.toml Turns on PL lint rules and configures global + per-path ignores to keep lint signal actionable.
pyoverkiz/response_handler.py Suppresses PLR2004 for an explicit 503 status handling branch.
pyoverkiz/client.py Suppresses PLR2004 for explicit 204 (No Content) response handling.
pyoverkiz/auth/strategies.py Suppresses PLR2004 for explicit 204 handling and JWT segment-count validation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

- Add targeted ignores for API model patterns (too many args, lazy imports, many returns)
- Allow magic values in tests and complex logic in utils
- Suppress PLR2004 for HTTP status code and JWT segment comparisons
Use http.HTTPStatus instead of raw integers for status code
comparisons, eliminating all PLR2004 noqa suppressions.
@iMicknl iMicknl merged commit b034971 into v2/main Apr 19, 2026
8 checks passed
@iMicknl iMicknl deleted the v2/ruff-pl branch April 19, 2026 18:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request v2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants