Skip to content
Open
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
24 changes: 24 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Runs the same Ruff checks as CI on the development code. Install with
# uvx pre-commit install
# Keep the Ruff revision equal to the version in uv.lock.
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.17.3
hooks:
- id: ruff-check
files: ^(scripts|src|tests)/
- id: ruff-format
files: ^(scripts|src|tests)/
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: check-yaml
exclude: ^tasks/
- id: check-toml
exclude: ^tasks/
- id: check-json
files: ^src/websitebench/.*\.json$
- id: end-of-file-fixer
exclude: ^(tasks/|assets/)
- id: trailing-whitespace
exclude: ^(tasks/|assets/)
6 changes: 6 additions & 0 deletions docs/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ Format edited development code with:
uv run ruff format scripts src tests
```

To run Ruff and basic YAML, TOML and whitespace checks on every commit, install the [pre-commit](https://pre-commit.com/) hooks:

```sh
uvx pre-commit install
```

## CI

[CI](../.github/workflows/ci.yml) runs on Python 3.12 and 3.13. It installs locked dependencies, checks source task definitions, runs the unit tests and Ruff checks, and verifies the official Harbor command's help output.
Expand Down
Loading