Skip to content

Commit 36fc480

Browse files
committed
fix(nix): disable pre-commit check in flake check, keep mypy hook
Configure git-hooks to skip the check during 'nix flake check' because mypy requires the Python environment which isn't available in the Nix sandbox. The mypy hook still works locally in 'nix develop' where the Python environment is available. Mypy is also run in CI via ci.yml. Changes: - Set pre-commit.check.enable = false to skip flake check - Keep mypy hook enabled for local development - Treefmt check still runs in flake check
1 parent 10a495f commit 36fc480

File tree

1 file changed

+15
-12
lines changed

1 file changed

+15
-12
lines changed

flake.nix

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -46,18 +46,21 @@
4646
};
4747

4848
# Git hooks configuration
49-
pre-commit.settings.hooks = {
50-
treefmt = {
51-
enable = true;
52-
package = config.treefmt.build.wrapper;
53-
};
54-
mypy = {
55-
enable = true;
56-
name = "mypy";
57-
entry = "${pkgs.uv}/bin/uv run mypy";
58-
files = "^stackone_ai/";
59-
language = "system";
60-
types = [ "python" ];
49+
pre-commit = {
50+
check.enable = false; # Skip check in flake (mypy needs Python env)
51+
settings.hooks = {
52+
treefmt = {
53+
enable = true;
54+
package = config.treefmt.build.wrapper;
55+
};
56+
mypy = {
57+
enable = true;
58+
name = "mypy";
59+
entry = "${pkgs.uv}/bin/uv run mypy";
60+
files = "^stackone_ai/";
61+
language = "system";
62+
types = [ "python" ];
63+
};
6164
};
6265
};
6366

0 commit comments

Comments
 (0)