Skip to content

Commit c840984

Browse files
committed
docs: note that nix flake check is a poor choice for auto-formatters
1 parent 2a2b75f commit c840984

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,14 +90,17 @@ Enter a development shell with pre-commit hooks enabled:
9090
nix develop
9191
```
9292

93-
Run all hooks sandboxed (no internet access):
93+
Run all hooks sandboxed:
9494

9595
```shell
9696
nix flake check
9797
```
9898

99-
Some hooks require access to the internet or local filesystem, which is not possible when using `nix flake check`.
100-
If the hook doesn't expose options to pre-package its impure access or it's too cumbersome to do so, you can run `pre-commit` through `nix develop` instead:
99+
Keep in mind that `nix flake check` runs in a sandbox.
100+
It doesn't have access to the internet and cannot modify files.
101+
This makes it a poor choice for formatting hooks that attempt to fix files automatically, or hooks that cannot easily be packaged to avoid impure access to the internet.
102+
103+
A better alternative in such cases is to run `pre-commit` through `nix develop`:
101104

102105
```shell
103106
nix develop -c pre-commit run -a

0 commit comments

Comments
 (0)