From b0de73025cf5c830159b27abb883b83daab56c0f Mon Sep 17 00:00:00 2001 From: Sam Avis Date: Wed, 21 May 2025 12:25:54 +0100 Subject: [PATCH 1/2] Add pre-commit instructions to README --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index ebfac64..6c074d4 100755 --- a/README.md +++ b/README.md @@ -83,6 +83,15 @@ The space for contribution is HUGE and OPEN! For instance: Feel free to reach out, or directly fork, change, and create pull requests, or create new branches to contribute. +All contributed code should be formatted and linted with `ruff`. We use `pre-commit` to make sure all commits satisfy this requirement. To use this run: +``` +pre-commit install +``` +You can also manually perform the formatting using: +``` +pre-commit run --all-files +``` + ### License [MIT LICENSE](https://github.com/bioatmosphere/DEMENTpy/blob/master/LICENSE) From 8117e4302533fe75abb76710cba9c630df9068f7 Mon Sep 17 00:00:00 2001 From: Sam Avis Date: Wed, 21 May 2025 12:34:44 +0100 Subject: [PATCH 2/2] Add a pre-commit CI hook --- .github/workflows/testing.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/testing.yaml b/.github/workflows/testing.yaml index e8935bf..2a7bf55 100644 --- a/.github/workflows/testing.yaml +++ b/.github/workflows/testing.yaml @@ -11,7 +11,15 @@ on: - '**.py' jobs: + qa: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + - uses: pre-commit/action@v3.0.1 + test: + needs: qa runs-on: ubuntu-latest strategy: