Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ jobs:
- uses: actions/checkout@v6
- name: Lint
uses: astral-sh/ruff-action@v2
with:
args: "check"
- name: Format Check
uses: astral-sh/ruff-action@v2
with:
args: "format --check"
test:
runs-on: ubuntu-latest
steps:
Expand Down
7 changes: 7 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.9.2
hooks:
- id: ruff
args: [--fix]
- id: ruff-format
14 changes: 12 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,18 @@ Please make sure that your PR passes all tests by running `pytest ./src/` on you
local machine. Also, you can run only tests that are affected by your code
changes, but you will need to select them manually.

Metrax uses [ruff](https://github.com/astral-sh/ruff) for linting. Before
sending a PR please run `ruff check` to catch any issues.
Metrax uses [ruff](https://github.com/astral-sh/ruff) for linting and formatting, managed via [pre-commit](https://pre-commit.com/).

To set up pre-commit hooks locally:
```bash
pip install -e ".[dev]"
pre-commit install
```

Once installed, pre-commit will automatically run `ruff` linting and formatting checks whenever you commit changes. You can also run the hooks manually on all files:
```bash
pre-commit run --all-files
```

## Community Guidelines

Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ dev = [
"nltk>=3.9.1",
"pytest>=8.4.1",
"Pillow>=9.0.0",
"pre-commit",
"protobuf>=5.29.5",
"rouge-score>=0.1.2",
"scikit-learn>=1.7.1",
Expand Down
Loading