-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdevshell.toml
More file actions
45 lines (35 loc) · 799 Bytes
/
devshell.toml
File metadata and controls
45 lines (35 loc) · 799 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
imports = [ "git.hooks" ]
[devshell]
name = "miniguest"
[[commands]]
package = "bash"
[[commands]]
package = "nixFlakes"
[[commands]]
package = "nixpkgs-fmt"
category = "formatters"
[[commands]]
package = "shfmt"
category = "formatters"
[[commands]]
package = "argbash"
category = "preprocessors"
[[commands]]
package = "shellcheck"
category = "linters"
[git.hooks]
enable = true
pre-commit.text = """
if git rev-parse --verify HEAD >/dev/null 2>&1
then
against=HEAD
else
# Initial commit: diff against an empty tree object
against=$(git hash-object -t tree /dev/null)
fi
function find_staged {
git diff-index --name-only --cached $against --diff-filter d -- "$@"
}
find_staged '*.nix' | xargs -r nixpkgs-fmt --check || exit
find_staged '*.bash' | xargs -r shfmt -d -s || exit
"""