From 29b89f621e0b67f09833eb8e53b8698d178ba62d Mon Sep 17 00:00:00 2001 From: Katelyn FitzGerald <7872563+kafitzgerald@users.noreply.github.com> Date: Tue, 8 Oct 2024 11:52:36 -0600 Subject: [PATCH] Update pre-commit (#247) * Update .pre-commit-config.yaml versions and add pre-commit.ci with autoupdate * remove old pre-commit workflow that has been replace by pre-commit.ci * update release notes * adjust yapf config temporarily because of yapf issue #1164 * formatting --- .github/workflows/pre-commit.yml | 15 --------------- .pre-commit-config.yaml | 16 +++++++++++----- docs/release-notes.rst | 3 ++- src/geocat/viz/taylor.py | 3 ++- 4 files changed, 15 insertions(+), 22 deletions(-) delete mode 100644 .github/workflows/pre-commit.yml diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml deleted file mode 100644 index 0731d88b..00000000 --- a/.github/workflows/pre-commit.yml +++ /dev/null @@ -1,15 +0,0 @@ -name: pre-commit - -on: - pull_request: - push: - branches: - - main - -jobs: - pre-commit: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 - - uses: pre-commit/action@v3.0.1 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 81743682..4efe2085 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,18 +1,19 @@ repos: -- repo: https://github.com/pre-commit/mirrors-yapf # To format the code to conform YAPF - rev: v0.31.0 +- repo: https://github.com/google/yapf # To format the code to conform YAPF + rev: v0.40.2 hooks: - id: yapf args: ['--in-place', '--recursive', '--style', 'google'] + require_serial: true -- repo: https://github.com/myint/docformatter # To format the doc strings to conform PEP257 - rev: v1.4 +- repo: https://github.com/PyCQA/docformatter # To format the doc strings to conform PEP257 + rev: v1.7.5 hooks: - id: docformatter args: [--in-place] - repo: https://github.com/pre-commit/pre-commit-hooks # Some common pre-commit hooks - rev: v3.4.0 + rev: v4.6.0 hooks: - id: check-yaml # Checks the syntax of .yaml files. args: [--allow-multiple-documents] @@ -20,3 +21,8 @@ repos: - id: end-of-file-fixer # Makes sure files end with a newline. - id: trailing-whitespace # Checks for any tabs or spaces after the last non-whitespace character on the line. - id: check-docstring-first # Checks that code comes after the docstrings. + - id: check-yaml # Check valid yml file + +ci: + autofix_prs: false + autoupdate_schedule: monthly diff --git a/docs/release-notes.rst b/docs/release-notes.rst index 21ee2d5e..fb839e7b 100644 --- a/docs/release-notes.rst +++ b/docs/release-notes.rst @@ -5,11 +5,12 @@ Release Notes ============= -v2024.07.0 (unreleased) +v2024.xx.0 (unreleased) --------------------------- Internal Changes ^^^^^^^^^^^^^^^^ +* Update pre-commit versions and configuration by `Katelyn FitzGerald`_ in (:pr:`247`) * Remove M1 workaround for CI and tokens that are no longer needed by `Katelyn FitzGerald`_ in (:pr:`232`) Testing diff --git a/src/geocat/viz/taylor.py b/src/geocat/viz/taylor.py index ee77fc4f..0911c2d6 100644 --- a/src/geocat/viz/taylor.py +++ b/src/geocat/viz/taylor.py @@ -506,7 +506,8 @@ def add_ygrid(self, *arr*. - This method will be deprecated in favor of `TaylorDiagram.add_std_grid()` + This method will be deprecated in favor of + `TaylorDiagram.add_std_grid()` """ warnings.warn(