Skip to content

Commit dacd7a8

Browse files
arubiquecemde
andauthored
Update CONTRIBUTING.md (#23)
* Fix link to CONTRIBUTING.md * Added pre-commit hooks --------- Co-authored-by: cemde <c.emde@me.com>
1 parent 2f70bcc commit dacd7a8

5 files changed

Lines changed: 91 additions & 3 deletions

File tree

.pre-commit-config.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
repos:
2+
- repo: https://github.com/astral-sh/ruff-pre-commit
3+
rev: v0.14.0 # Keep in sync with pyproject.toml
4+
hooks:
5+
- id: ruff-check
6+
args: [--fix, --ignore, "F401,F841"]
7+
- id: ruff-format

CONTRIBUTING.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,18 @@ ruff check . --fix
8585

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

88+
For convenience, you can enable **pre-commit hooks** to automatically format and lint code on every commit:
89+
90+
```bash
91+
uv run pre-commit install
92+
```
93+
94+
This is optional—CI will catch any issues regardless. But if enabled, the hooks will:
95+
- **Format** code with `ruff format` (using project settings from `pyproject.toml`)
96+
- **Lint and auto-fix** issues with `ruff check --fix`
97+
98+
> **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.
99+
88100
### 3. Dependency Management
89101

90102
Dependencies are defined in `pyproject.toml` and locked in `uv.lock`. Understanding the different dependency types is important:

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ Examples are available in the [Documentation](https://maseval.readthedocs.io/en/
114114

115115
## Contribute
116116

117-
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!
117+
We welcome any contributions. Please read the [CONTRIBUTING.md](CONTRIBUTING.md) file to learn more!
118118

119119
## Benchmarks
120120

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ all = ["maseval[examples,transformers,wandb]"]
7272

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

7777
# Documentation building - for contributors only
7878
docs = [

uv.lock

Lines changed: 70 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)