Skip to content

ci: add Ruff config, pre-commit hooks, and GitHub Actions lint workflow#43

Closed
korbonits wants to merge 2 commits into
google-deepmind:mainfrom
korbonits:ci/ruff-precommit-and-actions
Closed

ci: add Ruff config, pre-commit hooks, and GitHub Actions lint workflow#43
korbonits wants to merge 2 commits into
google-deepmind:mainfrom
korbonits:ci/ruff-precommit-and-actions

Conversation

@korbonits
Copy link
Copy Markdown

Summary

  • Add Ruff config (E/F/I rules, 120-char line length, per-file ignores for __init__.py)
  • Add .pre-commit-config.yaml with Ruff lint + format hooks
  • Add .github/workflows/lint.yml triggering on PRs and pushes to main
  • Auto-fix violations (unsorted imports, unused imports, f-string placeholders)

Note: ruff-format is excluded from pre-commit and CI — this repo uses pyink. Ruff's line-length and indent-width are set to match (80/2). F722/F821 are ignored: false positives from jaxtyping annotations (e.g. Float[Array, "b n h d"]).

Motivation

No linting or PR-level CI exists today. This PR adds lightweight enforcement using Ruff — fast, single dependency — and wires it up to run on every PR.

What's not included

  • No type checking — out of scope
  • No new lint rules beyond E/F/I selection

Testing

Ran ruff check . and ruff format --check . locally — all checks pass.

Co-Authored-By: Claude Sonnet 4.6 noreply@anthropic.com

@google-cla
Copy link
Copy Markdown

google-cla Bot commented Apr 13, 2026

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@korbonits korbonits force-pushed the ci/ruff-precommit-and-actions branch from bb4d8c5 to 01f03c7 Compare April 13, 2026 06:14
- Add Ruff config (E/F/I rules, per-file ignores for __init__.py)
- Add .pre-commit-config.yaml with ruff lint + format hooks
- Add .github/workflows/lint.yml triggering on PRs
- Auto-fix 63 violations (unsorted imports, unused imports, f-strings)
Note: ruff-format is excluded from pre-commit and CI — this repo uses pyink. F722/F821 ignored: false positives from jaxtyping annotations.
@korbonits korbonits force-pushed the ci/ruff-precommit-and-actions branch from 01f03c7 to daff97d Compare April 13, 2026 06:15
- Replace `uv pip install ruff` + `uv run ruff check` with `uvx ruff check .`
  (uv pip requires a venv; uvx runs tools directly without one)
- Run pyink on the 6 files whose import style ruff reformatted so both
  formatters agree
@korbonits korbonits force-pushed the ci/ruff-precommit-and-actions branch from 6f69be5 to 5763ae8 Compare April 15, 2026 04:57
@tomwardio
Copy link
Copy Markdown
Member

Thanks for this PR. We already have pre-commit formatting and linter checks that use pyink and pylint respectively (https://github.com/google-deepmind/alphagenome/blob/main/pyproject.toml#L121-L122).

This aligns with our formatting and linter checks we have internally.

@tomwardio tomwardio closed this Apr 15, 2026
@korbonits
Copy link
Copy Markdown
Author

korbonits commented Apr 15, 2026 via email

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.

2 participants