Skip to content

Commit

Permalink
Merge pull request #104 from casework/relax_pre_commit_update_enforce…
Browse files Browse the repository at this point in the history
…ment

Relax pre-commit update enforcement
  • Loading branch information
ajnelson-nist authored May 22, 2024
2 parents 63a66e7 + 45824e6 commit 59094c9
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,37 @@ check-supply-chain: \
check-supply-chain-pre-commit

# This target is scheduled to run as part of prerelease review.
#
# Update pre-commit configuration and use the updated config file to
# review code. Only have Make exit if 'pre-commit run' modifies files.
check-supply-chain-pre-commit: \
.venv-pre-commit/var/.pre-commit-built.log
source .venv-pre-commit/bin/activate \
&& pre-commit autoupdate
git diff \
--exit-code \
.pre-commit-config.yaml
.pre-commit-config.yaml \
|| ( \
source .venv-pre-commit/bin/activate \
&& pre-commit run \
--all-files \
--config .pre-commit-config.yaml \
) \
|| git diff \
--stat \
--exit-code \
|| ( \
echo \
"WARNING:Makefile:pre-commit configuration can be updated. It appears the updated would change file formatting." \
>&2 \
; exit 1 \
)
@git diff \
--exit-code \
.pre-commit-config.yaml \
|| echo \
"INFO:Makefile:pre-commit configuration can be updated. It appears the update would not change file formatting." \
>&2

clean: \
clean-figures \
Expand Down

0 comments on commit 59094c9

Please sign in to comment.