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.

References:
* Cyber-Domain-Ontology/CDO-Shapes-Example#1

Signed-off-by: Alex Nelson <[email protected]>
  • Loading branch information
ajnelson-nist committed Feb 13, 2024
1 parent 30895c3 commit 9ddea77
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,36 @@ check-supply-chain-mypy: \
--directory tests \
check-mypy

# 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:
@rm -rf \
Expand Down

0 comments on commit 9ddea77

Please sign in to comment.