Skip to content

Commit

Permalink
catch up with naming
Browse files Browse the repository at this point in the history
  • Loading branch information
domenkozar committed Nov 2, 2022
1 parent 7ba4a4d commit c070b47
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions modules/pre-commit.nix
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ let
} ''
{
echo '# DO NOT MODIFY';
echo '# This file was generated by nix-pre-commit-hooks';
echo '# This file was generated by pre-commit-hooks.nix';
jq . <"$rawJSONPath"
} >$out
'';
Expand Down Expand Up @@ -217,7 +217,7 @@ in
nix-pre-commit comes with its own set of packages for this purpose.
'';
defaultText =
literalExample ''nix-pre-commit-hooks-pkgs.callPackage tools-dot-nix { inherit (pkgs) system; }'';
literalExample ''pre-commit-hooks.nix-pkgs.callPackage tools-dot-nix { inherit (pkgs) system; }'';
};

hooks =
Expand Down Expand Up @@ -332,24 +332,24 @@ in
export PATH=$PATH:${cfg.package}/bin
if ! type -t git >/dev/null; then
# This happens in pure shells, including lorri
echo 1>&2 "WARNING: nix-pre-commit-hooks: git command not found; skipping installation."
echo 1>&2 "WARNING: pre-commit-hooks.nix: git command not found; skipping installation."
else
# These update procedures compare before they write, to avoid
# filesystem churn. This improves performance with watch tools like lorri
# and prevents installation loops by via lorri.
if readlink .pre-commit-config.yaml >/dev/null \
&& [[ $(readlink .pre-commit-config.yaml) == ${configFile} ]]; then
echo 1>&2 "nix-pre-commit-hooks: hooks up to date"
echo 1>&2 "pre-commit-hooks.nix: hooks up to date"
else
echo 1>&2 "nix-pre-commit-hooks: updating $PWD repo"
echo 1>&2 "pre-commit-hooks.nix: updating $PWD repo"
[ -L .pre-commit-config.yaml ] && unlink .pre-commit-config.yaml
if [ -e .pre-commit-config.yaml ]; then
echo 1>&2 "nix-pre-commit-hooks: WARNING: Refusing to install because of pre-existing .pre-commit-config.yaml"
echo 1>&2 "pre-commit-hooks.nix: WARNING: Refusing to install because of pre-existing .pre-commit-config.yaml"
echo 1>&2 " 1. Translate .pre-commit-config.yaml contents to the new syntax in your Nix file"
echo 1>&2 " see https://github.com/hercules-ci/nix-pre-commit-hooks#getting-started"
echo 1>&2 " see https://github.com/cachix/pre-commit-hooks.nix#getting-started"
echo 1>&2 " 2. remove .pre-commit-config.yaml"
echo 1>&2 " 3. add .pre-commit-config.yaml to .gitignore"
else
Expand All @@ -375,7 +375,7 @@ in
pre-commit install -t $stage
;;
*)
echo 1>&2 "ERROR: nix-pre-commit-hooks: either $stage is not a valid stage or pre-commit-hooks.nix doesn't yet support it."
echo 1>&2 "ERROR: pre-commit-hooks.nix: either $stage is not a valid stage or pre-commit-hooks.nix doesn't yet support it."
exit 1
;;
esac
Expand Down

0 comments on commit c070b47

Please sign in to comment.