From ae44f9aed5fccdc4f0ae69348dfe8e658e3ee253 Mon Sep 17 00:00:00 2001 From: "ukmo-chris.bunney" Date: Tue, 17 Sep 2024 15:10:41 +0100 Subject: [PATCH 1/4] Added repo-review CI workflow. --- .github/workflows/ci-repo-review.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .github/workflows/ci-repo-review.yml diff --git a/.github/workflows/ci-repo-review.yml b/.github/workflows/ci-repo-review.yml new file mode 100644 index 00000000..d0acb17e --- /dev/null +++ b/.github/workflows/ci-repo-review.yml @@ -0,0 +1,22 @@ +# References: +# - https://github.com/scientific-python/repo-review +# - https://pypi.org/project/sp-repo-review/ + +name: ci-repo-review + +run-name: Running repo-review checks +on: + pull_request: + + push: + branches-ignore: + - "conda-lock-auto-update" + - "pre-commit-ci-update-config" + - "dependabot/*" +jobs: + run-repo-review: + runs-on: ubuntu-latest + steps: + - uses: scientific-python/repo-review@v0.11.2 + with: + plugins: sp-repo-review From c50604bbe3d334d2e2fa86afb87843aeb5a0da62 Mon Sep 17 00:00:00 2001 From: Chris Bunney <48915820+ukmo-ccbunney@users.noreply.github.com> Date: Tue, 17 Sep 2024 16:59:44 +0100 Subject: [PATCH 2/4] Update ci-repo-review.yml Fixed dodgy indents --- .github/workflows/ci-repo-review.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci-repo-review.yml b/.github/workflows/ci-repo-review.yml index d0acb17e..90c074c5 100644 --- a/.github/workflows/ci-repo-review.yml +++ b/.github/workflows/ci-repo-review.yml @@ -15,8 +15,8 @@ on: - "dependabot/*" jobs: run-repo-review: - runs-on: ubuntu-latest - steps: - - uses: scientific-python/repo-review@v0.11.2 - with: - plugins: sp-repo-review + runs-on: ubuntu-latest + steps: + - uses: scientific-python/repo-review@v0.11.2 + with: + plugins: sp-repo-review From 7af0618482d7e401a32141f471ecaef0ca7d4077 Mon Sep 17 00:00:00 2001 From: Chris Bunney <48915820+ukmo-ccbunney@users.noreply.github.com> Date: Tue, 17 Sep 2024 17:07:22 +0100 Subject: [PATCH 3/4] Update ci-repo-review.yml Added actions/checkout --- .github/workflows/ci-repo-review.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci-repo-review.yml b/.github/workflows/ci-repo-review.yml index 90c074c5..af9e4aee 100644 --- a/.github/workflows/ci-repo-review.yml +++ b/.github/workflows/ci-repo-review.yml @@ -17,6 +17,10 @@ jobs: run-repo-review: runs-on: ubuntu-latest steps: - - uses: scientific-python/repo-review@v0.11.2 + - name: "Checkout" + uses: actions/checkout@v4 + + - name: "Run repo-review" + uses: scientific-python/repo-review@v0.11.2 with: plugins: sp-repo-review From 626fe7bdac40f7303ed3e73e15f594dd8244bef8 Mon Sep 17 00:00:00 2001 From: "ukmo-chris.bunney" Date: Wed, 18 Sep 2024 14:23:20 +0100 Subject: [PATCH 4/4] Moved repo-review from GHA to pre-commit --- .github/workflows/ci-repo-review.yml | 26 -------------------------- .pre-commit-config.yaml | 8 ++++++++ pyproject.toml | 23 +++++++++++++++++++++++ 3 files changed, 31 insertions(+), 26 deletions(-) delete mode 100644 .github/workflows/ci-repo-review.yml diff --git a/.github/workflows/ci-repo-review.yml b/.github/workflows/ci-repo-review.yml deleted file mode 100644 index af9e4aee..00000000 --- a/.github/workflows/ci-repo-review.yml +++ /dev/null @@ -1,26 +0,0 @@ -# References: -# - https://github.com/scientific-python/repo-review -# - https://pypi.org/project/sp-repo-review/ - -name: ci-repo-review - -run-name: Running repo-review checks -on: - pull_request: - - push: - branches-ignore: - - "conda-lock-auto-update" - - "pre-commit-ci-update-config" - - "dependabot/*" -jobs: - run-repo-review: - runs-on: ubuntu-latest - steps: - - name: "Checkout" - uses: actions/checkout@v4 - - - name: "Run repo-review" - uses: scientific-python/repo-review@v0.11.2 - with: - plugins: sp-repo-review diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7bfa4f59..db55a13f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,5 +1,6 @@ # See https://pre-commit.com for more information # See https://pre-commit.com/hooks.html for more hooks +# See https://github.com/scientific-python/cookie#sp-repo-review for repo-review repos: - repo: https://github.com/pre-commit/pre-commit-hooks @@ -44,3 +45,10 @@ repos: hooks: - id: sort-all types: [file, python] + +- repo: https://github.com/scientific-python/cookie + rev: 2024.08.19 + hooks: + - id: sp-repo-review + additional_dependencies: ["repo-review[cli]"] # TODO: Only neededed if extra dependencies are required + #args: ["--show=errskip"] # show everything for the moment diff --git a/pyproject.toml b/pyproject.toml index 3fd0732b..040563f6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -73,3 +73,26 @@ line_length = 79 profile = "black" skip_gitignore = "True" verbose = "False" + +[tool.repo-review] +# These are a list of the currently failing tests: +ignore = [ + "PY005", # Has tests folder + "PP003", # Does not list wheel as a build-dep + "PP304", # Sets the log level in pytest + "PP305", # Specifies xfail_strict + "PP306", # Specifies strict config + "PP307", # Specifies strict markers + "PP309", # Filter warnings specified + "GH104", # Use unique names for upload-artifact + "GH212", # Require GHA update grouping + "PC110", # Uses black or ruff-format + "PC140", # Uses a type checker + "PC160", # Uses a spell checker + "PC170", # Uses PyGrep hooks (only needed if rST present) + "PC180", # Uses a markdown formatter + "PC190", # Uses Ruff + "PC901", # Custom pre-commit CI message + "MY100", # Uses MyPy (pyproject config) + "RF001", # Uses RUFF +]