Skip to content

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

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

ci: add Ruff config, pre-commit hooks, and GitHub Actions lint workflow#205
korbonits wants to merge 1 commit into
huggingface: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 config lives in ruff.toml rather than pyproject.tomlpyproject.toml is listed in .gitignore. Added # noqa: F821 to one intentional availability-probe import in evaluation.py.

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

Note: ruff config uses ruff.toml (pyproject.toml is gitignored). Added noqa: F821 to one intentional missing-import probe.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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