diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml deleted file mode 100644 index 9981cdf..0000000 --- a/.github/workflows/pre-commit.yml +++ /dev/null @@ -1,14 +0,0 @@ -name: pre-commit - -on: - pull_request: - push: - branches: [master] - -jobs: - pre-commit: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 - - uses: pre-commit/action@v2.0.2 diff --git a/.github/workflows/style.yaml b/.github/workflows/style.yaml new file mode 100644 index 0000000..dcaa2ae --- /dev/null +++ b/.github/workflows/style.yaml @@ -0,0 +1,35 @@ +name: Style + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +on: + pull_request: + + workflow_dispatch: + + push: + branches: + - master + +jobs: + prek: + runs-on: ubuntu-24.04 + steps: + - name: Checkout + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + - name: prek + uses: glotzerlab/workflows/prek@1fe577d5430222a9793694a14cdb316cf8f720e1 # 0.9.0 + + # This job is used to provide a single requirement for branch merge conditions. + tests_complete: + name: All style checks + if: always() + needs: [prek] + runs-on: ubuntu-24.04 + + steps: + - run: jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}' + - name: Done + run: exit 0 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e5cb7f8..a0d4fae 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,9 +1,6 @@ -ci: - autoupdate_schedule: quarterly - repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: 'v5.0.0' + rev: 'v6.0.0' hooks: - id: end-of-file-fixer - id: trailing-whitespace @@ -21,10 +18,10 @@ repos: - --py36-plus - repo: https://github.com/astral-sh/ruff-pre-commit # Ruff version. - rev: v0.12.2 + rev: v0.13.0 hooks: # Run the linter. - - id: ruff + - id: ruff-check types_or: [ python, pyi, jupyter ] args: [ --fix ] # Run the formatter. diff --git a/cmaps/cubeellipse/cubeellipse.py b/cmaps/cubeellipse/cubeellipse.py index ce4ff7f..931205a 100644 --- a/cmaps/cubeellipse/cubeellipse.py +++ b/cmaps/cubeellipse/cubeellipse.py @@ -1,7 +1,7 @@ import matplotlib.pyplot as plt +import numpy.linalg as la import numpy as np -import numpy.linalg as la """ This helper script generates a cyclic colormap based on D.A. Green's diff --git a/renovate.json b/renovate.json new file mode 100644 index 0000000..fa241a2 --- /dev/null +++ b/renovate.json @@ -0,0 +1,6 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "extends": [ + "local>glotzerlab/renovate-config" + ] +}