Skip to content

Commit

Permalink
Merge pull request #258 from altheaden/pre-commit-changed-files
Browse files Browse the repository at this point in the history
Pre-commit updates and fixes
  • Loading branch information
xylar authored Jan 7, 2025
2 parents 126f453 + e8a14ef commit 48e8418
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
14 changes: 9 additions & 5 deletions .github/workflows/build_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,20 @@ jobs:
with:
python-version: "3.10"

- if: ${{ steps.skip_check.outputs.should_skip != 'true' }}
id: file_changes
uses: trilom/file-changes-action@1.2.4
with:
output: ' '

- if: ${{ steps.skip_check.outputs.should_skip != 'true' }}
# Run all pre-commit hooks on all the files.
# Getting only staged files can be tricky in case a new PR is opened
# since the action is run on a branch in detached head state
name: Install and Run Pre-commit
uses: pre-commit/action@v3.0.1
with:
extra_args: --files ${{ steps.file_changes.outputs.files}}

build:
name: test polaris - python ${{ matrix.python-version }}
Expand All @@ -52,6 +60,7 @@ jobs:
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
fail-fast: false
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@master
Expand Down Expand Up @@ -104,8 +113,3 @@ jobs:
cd docs
sphinx-multiversion . _build/html
# - if: ${{ steps.skip_check.outputs.should_skip != 'true' }}
# name: Run Tests
# env:
# CHECK_IMAGES: False
# run: pytest --pyargs polaris
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
exclude: "docs|.git"
default_stages: [commit]
default_stages: [pre-commit]
fail_fast: true

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
rev: v5.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
Expand Down Expand Up @@ -35,7 +35,7 @@ repos:

# Can run individually with `pre-commit run mypy --all-files`
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.11.2
rev: v1.14.1
hooks:
- id: mypy
args: ["--config=pyproject.toml", "--show-error-codes"]
Expand Down

0 comments on commit 48e8418

Please sign in to comment.