From c26783b4da43846176b849cd9f247229a141a0b1 Mon Sep 17 00:00:00 2001 From: kaczmarj Date: Thu, 22 Feb 2024 15:21:08 -0500 Subject: [PATCH] add pre-commit and instructions --- .pre-commit-config.yaml | 14 ++++++++++++++ README.md | 3 +++ docs/installing.rst | 3 +++ pyproject.toml | 1 + 4 files changed, 21 insertions(+) create mode 100644 .pre-commit-config.yaml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..9de3ed0 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,14 @@ +repos: + - repo: 'https://github.com/pre-commit/pre-commit-hooks' + rev: v2.3.0 + hooks: + - id: check-yaml + - id: end-of-file-fixer + - id: trailing-whitespace + - repo: 'https://github.com/astral-sh/ruff-pre-commit' + rev: v0.2.2 + hooks: + - id: ruff + args: + - '--fix' + - id: ruff-format diff --git a/README.md b/README.md index 669578f..c8e4f1e 100644 --- a/README.md +++ b/README.md @@ -86,8 +86,11 @@ Clone this GitHub repository and install the package (in editable mode with the git clone https://github.com/SBU-BMI/wsinfer.git cd wsinfer python -m pip install --editable .[dev] +pre-commit install ``` +We use `pre-commit` to automatically run various checks during `git commit`. + # Citation If you find our work useful, please cite [our paper](https://doi.org/10.1038/s41698-024-00499-9)! diff --git a/docs/installing.rst b/docs/installing.rst index 43f43a1..1d3d912 100644 --- a/docs/installing.rst +++ b/docs/installing.rst @@ -84,6 +84,9 @@ Clone the GitHub repository and install the package in editable mode with the :c git clone https://github.com/SBU-BMI/wsinfer.git cd wsinfer python -m pip install --editable .[dev] + pre-commit install + +We use :code:`pre-commit` to automatically run various checks during :code:`git commit`. Supported slide backends diff --git a/pyproject.toml b/pyproject.toml index 426bfcf..5707a8a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -66,6 +66,7 @@ dev = [ "geojson", "mypy", "pandas-stubs", + "pre-commit", "pytest", "ruff", "tiffslide",