Skip to content

Commit

Permalink
pre-commit: try applying generated patch
Browse files Browse the repository at this point in the history
  • Loading branch information
berquist committed Oct 16, 2024
1 parent 65f5648 commit 9901920
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
11 changes: 10 additions & 1 deletion .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,13 @@ jobs:
- uses: pre-commit/action@v3.0.1
- run: |
python -m pip install 'ruamel.yaml'
python sort_regressionfiles_yaml.py
if ! python sort_regressionfiles_yaml.py > regressionfiles.diff; then
echo "difference found:"
cat regressionfiles.diff
if ! patch -p1 -i regressionfiles.diff regressionfiles.yaml; then
echo "patch didn't apply cleanly"
else
echo "patch applied cleanly"
fi
exit 1
fi
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
.idea

regressionfiles.diff
regressionfiles.yaml.orig
regressionfiles_nocomments.yaml
regressionfiles_sorted.yaml

Expand Down
4 changes: 4 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,7 @@ repos:
rev: "v5.0.0"
hooks:
- id: check-yaml
- repo: https://github.com/Mateusz-Grzelinski/actionlint-py
rev: "v1.7.3.17"
hooks:
- id: actionlint

0 comments on commit 9901920

Please sign in to comment.