Skip to content

ci: Replace black, isort, pylint and pre-commit with ruff - #89

Open
kylebarron wants to merge 1 commit into
build/cython-force-regeneratefrom
modernize/ruff
Open

kylebarron wants to merge 1 commit into
build/cython-force-regeneratefrom
modernize/ruff

Conversation

@kylebarron

@kylebarron kylebarron commented Oct 5, 2026 •

Copy link
Copy Markdown
Owner

Note

This PR was written by Claude (Claude Code), not by @kylebarron.

Replaces black, isort and pylint, plus the pre-commit config that ran them, with ruff, using the same rule set as pydelatin and pymartini.

Changes

  • ruff format and ruff check pass on everything, including the README's Python examples. site/ (the React demo) is excluded.
  • Python changes are formatting, Google-style docstrings, type hints, named constants, and __all__ in the package root. Behavior is unchanged: encoded output is byte-identical before and after (checked with sha256 across all sphere methods, ellipsoids and extensions).
  • No rules were added to the global ignore list. Inline noqas, each with a reason:
    • S101: argument checks in encode, to_ecef and zig_zag_encode keep raising AssertionError, which callers may rely on.
    • PLR0913: encode keeps its keyword arguments.
    • FURB122: extensions are written with f.write, so f only needs a write method.
  • Removes .pylintrc and .pre-commit-config.yaml.
  • CI runs on pushes to main, with the dead pre-commit step removed and a Lint job (ruff check and format check) added.

For review

#74 will conflict. It touches occlusion.py, which this PR reformats and adds docstrings to. The conflict should be mechanical to resolve.

🤖 Written by Claude Code

Configure ruff with the same rule set as pydelatin and fix what it flags.
The Python changes are formatting, Google-style docstrings, type hints, and
`__all__` in the package root. Behavior is unchanged; encoded output is
byte-identical before and after this change. Where a rule would change the
public API or behavior, it is silenced inline with a reason:

- `S101`: argument checks in `encode`, `to_ecef` and `zig_zag_encode` keep
  raising `AssertionError`, which callers may rely on.
- `PLR0913`: `encode` keeps its existing keyword arguments.
- `FURB122`: extensions are written with `f.write` in a loop, so `f` only
  needs a `write` method, not `writelines`.

Exclude the `site/` React demo from ruff. Until the tests move to `tests/`,
the per-file test ignores apply to `test/`, plus `INP001`, since a
`test/__init__.py` would shadow the stdlib `test` package.

Remove the unused .pylintrc and pre-commit config. In CI, run on pushes to
the renamed `main` branch, drop the pre-commit step (it only ran on a
Python version no longer in the matrix), and add a ruff lint and format
check job.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kylebarron
kylebarron added this pull request to stack #91 October 5, 2026 21:52

This branch has not been deployed

No deployments
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