Skip to content

Commit

Permalink
Add pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
thalassemia committed Dec 17, 2024
1 parent 04ba75d commit 2c56c09
Show file tree
Hide file tree
Showing 4 changed files with 112 additions and 9 deletions.
12 changes: 12 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.8.3
hooks:
# Run the linter.
- id: ruff
types_or: [ python, pyi ]
args: [ --fix ]
# Run the formatter.
- id: ruff-format
types_or: [ python, pyi ]
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,19 @@ finishes, close and reopen your terminal before continuing with the
> **Tip:** If any step in the `nextflow` installation fails,
> try rerunning a few times to see if that fixes the issue.
If you are installing the model for active development, we strongly
recommend that you also install the development dependencies using:

uv sync --frozen --extra dev

After that, you can run ``uv run pre-commit install`` to install
a pre-commit hook that will run the ``ruff`` linter and formatter
before all of your commits.

The development dependencies also include ``pytest``, which lets
you run the test suite, and ``mypy``, which can be invoked to
perform static type checking.

## Test Installation

To test your installation, from the top-level of the cloned repository, invoke:
Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ dev = [
"pytest",
"pytest-cov",
"mypy",
"ruff"
"ruff",
"pre-commit",
]
docs = [
"Sphinx",
Expand Down
93 changes: 85 additions & 8 deletions uv.lock

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

0 comments on commit 2c56c09

Please sign in to comment.