Skip to content

CI: lint and format checks - #3

Merged
heliocosta-dev merged 1 commit into
mainfrom
ci-lint
Oct 8, 2026
Merged

heliocosta-dev merged 1 commit into
mainfrom
ci-lint

Conversation

@heliocosta-dev

Copy link
Copy Markdown
Member

What CI now runs

A new lint job (Python 3.12) installs the dev extra and runs:

  • ruff check .
  • ruff format --check .

The existing test matrix (3.9 to 3.12) is unchanged, and both jobs run on every PR.

  • Ruff is pinned to exactly 0.16.9 in the dev extra, so pip install -e ".[dev]" gives contributors the same version and Dependabot can bump it.
  • [tool.ruff] sets target-version = "py39" and line-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.
  • Ruff's default rule set applies, except:
    • FA100, UP006, UP035: the SDK's public signatures use typing.Optional, Dict and List, and rewriting them would change the annotations.
    • RUF022: __all__ is grouped by purpose (config, resources, errors), not alphabetized.
  • *.md is excluded, so the README's Python samples keep their hand-aligned comments.

Code changes to pass the check

  • Formatter: three rewrapped statements in millionsend/_client.py and millionsend/contacts.py, plus one in tests/test_resources.py. The parsed AST of every changed file is identical before and after.
  • Tests: import millionsend._client as _client became from millionsend import _client in conftest.py and test_client.py (a safe autofix for PLR0402).

The tests pass on Python 3.9 and 3.12: 60 passed, with the 2 e2e tests skipped.

🤖 Generated with Claude Code

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>
@heliocosta-dev
heliocosta-dev merged commit bc41034 into main Oct 8, 2026
5 checks passed
@heliocosta-dev
heliocosta-dev deleted the ci-lint branch October 8, 2026 23:05
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