Skip to content

Commit

Permalink
Do not print "hooks up to date" message
Browse files Browse the repository at this point in the history
When using standard flake direnv integration (i.e. `use flake` in `.envrc`), the
"hooks up to date" informational message currently prints before every
prompt. This feels unnecessarily verbose.

One workaround is to perform stderr filtering within `.envrc`, replacing `use
flake` with `use flake 2> >(grep -v 'hooks up to date' >&2)`. Including that
sort of logic in `.envrc` feels like a bit of an antipattern. In extreme cases
it could also fail if `grep` is not available outside of the nix devshell.
  • Loading branch information
lafrenierejm committed Jul 4, 2023
1 parent f6a6863 commit 57b845f
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions modules/pre-commit.nix
Original file line number Diff line number Diff line change
Expand Up @@ -408,10 +408,8 @@ in
# filesystem churn. This improves performance with watch tools like lorri
# and prevents installation loops by via lorri.
if readlink "''${GIT_WC}/.pre-commit-config.yaml" >/dev/null \
&& [[ $(readlink "''${GIT_WC}/.pre-commit-config.yaml") == ${configFile} ]]; then
echo 1>&2 "pre-commit-hooks.nix: hooks up to date"
else
if ! readlink "''${GIT_WC}/.pre-commit-config.yaml" >/dev/null \
|| [[ $(readlink "''${GIT_WC}/.pre-commit-config.yaml") != ${configFile} ]]; then
echo 1>&2 "pre-commit-hooks.nix: updating $PWD repo"
[ -L .pre-commit-config.yaml ] && unlink .pre-commit-config.yaml
Expand Down

0 comments on commit 57b845f

Please sign in to comment.