Skip to content

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

Open
korbonits wants to merge 1 commit into
facebookresearch:mainfrom
korbonits:ci/ruff-precommit-and-actions
Open

ci: add Ruff config, pre-commit hooks, and GitHub Actions lint workflow#152
korbonits wants to merge 1 commit into
facebookresearch: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 black. Ruff's line-length is set to match (119).

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

- 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 35 violations (unsorted imports, unused imports, f-strings)

Note: ruff-format is excluded from pre-commit and CI — this repo uses black.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Apr 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant