File tree 1 file changed +24
-1
lines changed
1 file changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -74,13 +74,36 @@ check-supply-chain-mypy: \
74
74
--directory tests \
75
75
check-mypy
76
76
77
+ # Update pre-commit configuration and use the updated config file to
78
+ # review code. Only have Make exit if 'pre-commit run' modifies files.
77
79
check-supply-chain-pre-commit : \
78
80
.venv-pre-commit/var/.pre-commit-built.log
79
81
source .venv-pre-commit/bin/activate \
80
82
&& pre-commit autoupdate
81
83
git diff \
82
84
--exit-code \
83
- .pre-commit-config.yaml
85
+ .pre-commit-config.yaml \
86
+ || ( \
87
+ source .venv-pre-commit/bin/activate \
88
+ && pre-commit run \
89
+ --all-files \
90
+ --config .pre-commit-config.yaml \
91
+ ) \
92
+ || git diff \
93
+ --stat \
94
+ --exit-code \
95
+ || ( \
96
+ echo \
97
+ "WARNING:Makefile:pre-commit configuration can be updated. It appears the updated would change file formatting." \
98
+ >&2 \
99
+ ; exit 1 \
100
+ )
101
+ @git diff \
102
+ --exit-code \
103
+ .pre-commit-config.yaml \
104
+ || echo \
105
+ "INFO:Makefile:pre-commit configuration can be updated. It appears the update would not change file formatting." \
106
+ >&2
84
107
85
108
clean :
86
109
@rm -rf \
You can’t perform that action at this time.
0 commit comments