File tree 1 file changed +15
-2
lines changed 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change 59
59
The entry point - the executable to run. entry can also contain arguments that will not be overridden such as entry: autopep8 -i.
60
60
'' ;
61
61
} ;
62
- language =
62
+ language =
63
63
mkOption {
64
64
type = types . str ;
65
65
description =
331
331
ln -s ${ configFile } .pre-commit-config.yaml
332
332
# Remove any previously installed hooks (since pre-commit itself has no convergent design)
333
333
hooks="pre-commit pre-merge-commit pre-push prepare-commit-msg commit-msg post-checkout post-commit"
334
+ uninstall_help=$(pre-commit uninstall --help)
335
+ install_help=$(pre-commit install --help)
334
336
for hook in $hooks; do
335
- pre-commit uninstall -t $hook
337
+ # different version of pre-commit support different hooks
338
+ if [[ "$uninstall_help" =~ "$hook" ]]; then
339
+ pre-commit uninstall -t $hook
340
+ fi
336
341
done
337
342
# Add hooks for configured stages (only) ...
338
343
if [ ! -z "${ concatStringsSep " " cfg . default_stages } " ]; then
339
344
for stage in ${ concatStringsSep " " cfg . default_stages } ; do
345
+ if [[ "$stage" == "manual" ]]; then
346
+ continue
347
+ fi
348
+ # different version of pre-commit support different hooks
349
+ if [[ ! "$install_help" =~ "$stage" ]];then
350
+ echo 1>&2 "WARNING: nix-pre-commit-hooks: '$stage' is not supported by this pre-commit version."
351
+ continue
352
+ fi
340
353
case $stage in
341
354
commit | merge-commit | push)
342
355
stage="pre-"$stage
You can’t perform that action at this time.
0 commit comments