Skip to content
Merged
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
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.14.0 # Keep in sync with pyproject.toml
hooks:
- id: ruff-check
args: [--fix, --ignore, "F401,F841"]
- id: ruff-format
12 changes: 12 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,18 @@ ruff check . --fix

If you haven't activated your virtual environment, you can use `uv run ruff format .` and `uv run ruff check . --fix` instead.

For convenience, you can enable **pre-commit hooks** to automatically format and lint code on every commit:

```bash
uv run pre-commit install
```

This is optional—CI will catch any issues regardless. But if enabled, the hooks will:
- **Format** code with `ruff format` (using project settings from `pyproject.toml`)
- **Lint and auto-fix** issues with `ruff check --fix`

> **Note**: The pre-commit hooks intentionally skip removing unused imports (`F401`) and unused variables (`F841`) to avoid disrupting work-in-progress code. Run `uv run ruff check . --fix` manually before opening a PR to clean these up.

### 3. Dependency Management

Dependencies are defined in `pyproject.toml` and locked in `uv.lock`. Understanding the different dependency types is important:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ Examples are available in the [Documentation](https://maseval.readthedocs.io/en/

## Contribute

We welcome any contributions. Please read the [CONTRIBUTING.md](https://github.com/parameterlab/MASEval/tree/fix-porting-issue?tab=contributing-ov-file) file to learn more!
We welcome any contributions. Please read the [CONTRIBUTING.md](CONTRIBUTING.md) file to learn more!

## Benchmarks

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ all = ["maseval[examples,transformers,wandb]"]

[dependency-groups]
# Development tools (linting, testing) - for contributors only
dev = ["pytest>=9.0.0", "pytest-cov>=7.0.0", "ruff>=0.14.0", "ty>=0.0.5"]
dev = ["pytest>=9.0.0", "pytest-cov>=7.0.0", "ruff>=0.14.0", "ty>=0.0.5", "pre-commit>=4.0.0"]

# Documentation building - for contributors only
docs = [
Expand Down
71 changes: 70 additions & 1 deletion uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading