Skip to content

chore: ruff and mypy --strict clean, enforced in CI - #7

Merged
giovanny07 merged 1 commit into
mainfrom
chore/lint-types
Oct 13, 2026
Merged

giovanny07 merged 1 commit into
mainfrom
chore/lint-types

Conversation

@giovanny07

Copy link
Copy Markdown
Owner

What changes

  • ruff.toml: rules E, F, W, I, UP and B for Python 3.9, line length 120. UP045/UP007 are ignored to keep typing.Optional, because X | None needs 3.10 at runtime for get_type_hints. Safe autofixes applied; the misplaced imports in oauth.py moved to the top; long lines wrapped.
  • mypy --strict: from 180 errors to 0.
    • Bare dict/list/tuple annotations are now parameterized.
    • python_version = 3.10, because mypy 2 no longer accepts 3.9 as a target; the CI tests still run on 3.9.
    • warn_return_any is off, since the methods return decoded JSON.
  • CI: a new lint job with pinned ruff==0.17.0 and mypy==2.4.0, so a new release of either tool cannot break CI on unchanged code.
  • Docs: current lint commands and how to run the integration tests.

Not applied: ruff format. It would reformat 18 files with no functional change.

Verification

  • ruff check .: clean. mypy glpi_utils: clean.
  • 336 unit tests pass.
  • Integration suite passes on GLPI 10.0.28, 11.0.9 and 12.0.0.
  • No behaviour change.

🤖 Generated with Claude Code

- ruff.toml: E, F, W, I, UP, B for py39, line length 120; UP045/UP007
  ignored to keep typing.Optional (X | None needs 3.10 at runtime).
  Safe autofixes applied (imports sorted/unused, quoted annotations,
  collections.abc), imports moved to the top of oauth.py, long lines
  wrapped.
- mypy --strict: 180 -> 0. Bare dict/list/tuple annotations
  parameterized; python_version 3.10 (mypy 2 rejects 3.9 as a target);
  warn_return_any off since methods return decoded JSON.
- tests.yaml: lint job running pinned ruff 0.17.0 and mypy 2.4.0.
- CONTRIBUTING / docs/contributing.md: current lint commands and how
  to run the integration tests.

No behaviour change: 336 unit tests pass, integration suite passes on
GLPI 10.0.28, 11.0.9 and 12.0.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Giovanny Rodriguez <giovanny.rodriguez@imagunet.com>
@giovanny07
giovanny07 merged commit 5af498a into main Oct 13, 2026
10 checks passed
@giovanny07
giovanny07 deleted the chore/lint-types branch October 13, 2026 17:33
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.

1 participant