Skip to content

Commit

Permalink
Relax pre-commit update enforcement
Browse files Browse the repository at this point in the history
References:
* Cyber-Domain-Ontology/CDO-Shapes-Example#1

Signed-off-by: Alex Nelson <alexander.nelson@nist.gov>
  • Loading branch information
ajnelson-nist committed Feb 14, 2024
1 parent 779ca70 commit 6468272
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 @@ -171,13 +171,36 @@ check-supply-chain-cdo-profile:
"x$$(git rev-parse _CHECK_SUPPLY_CHAIN_upstream/base)" \
|| (echo "ERROR:Makefile:The current branch is behind the upstream 'base' branch. Please merge the upstream 'base' commit into the current branch." >&2 ; exit 1)

# 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

check-supply-chain-submodules: \
.git_submodule_init.done.log
Expand Down

0 comments on commit 6468272

Please sign in to comment.