Skip to content

Commit

Permalink
Relax pre-commit update enforcement
Browse files Browse the repository at this point in the history
No effects were observed on Make-managed files.

Signed-off-by: Alex Nelson <alexander.nelson@nist.gov>
  • Loading branch information
ajnelson-nist committed Nov 15, 2024
1 parent 87d2d6e commit a205cd5
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 @@ -96,13 +96,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:
@$(MAKE) \
Expand Down

0 comments on commit a205cd5

Please sign in to comment.