Repository navigation
CI: lint and format checks - #3
Merged
Merged
Conversation
CI gains a lint job on Python 3.12 that runs `ruff check .` and `ruff format --check .`. Ruff is pinned to 0.16.9 in the dev extra, which the job installs, so contributors and CI run the same version. The config targets py39 with line length 110, the width the existing code fits best (the smallest formatter diff). It ignores the typing-modernization rules (FA100, UP006, UP035), because rewriting the public annotations would change signatures, and RUF022, because __all__ is grouped on purpose. The README is excluded so its samples keep their aligned comments. Existing code brought in line: three formatter rewraps in millionsend/_client.py and millionsend/contacts.py, which leave the parsed AST unchanged, plus one in tests. The tests also import _client with `from millionsend import _client`. Co-Authored-By: Claude Opus 5.5 <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.
What CI now runs
A new
lintjob (Python 3.12) installs the dev extra and runs:ruff check .ruff format --check .The existing
testmatrix (3.9 to 3.12) is unchanged, and both jobs run on every PR.0.16.9in thedevextra, sopip install -e ".[dev]"gives contributors the same version and Dependabot can bump it.[tool.ruff]setstarget-version = "py39"andline-length = 110. I measured the formatter diff at several widths: 88 rewrites ~650 lines and 100 rewrites ~80, while 107 to 110 rewrite 19. So 110 matches the existing code.FA100,UP006,UP035: the SDK's public signatures usetyping.Optional,DictandList, and rewriting them would change the annotations.RUF022:__all__is grouped by purpose (config, resources, errors), not alphabetized.*.mdis excluded, so the README's Python samples keep their hand-aligned comments.Code changes to pass the check
millionsend/_client.pyandmillionsend/contacts.py, plus one intests/test_resources.py. The parsed AST of every changed file is identical before and after.import millionsend._client as _clientbecamefrom millionsend import _clientinconftest.pyandtest_client.py(a safe autofix forPLR0402).The tests pass on Python 3.9 and 3.12: 60 passed, with the 2 e2e tests skipped.
🤖 Generated with Claude Code