File tree Expand file tree Collapse file tree 8 files changed +42
-45
lines changed
Expand file tree Collapse file tree 8 files changed +42
-45
lines changed Original file line number Diff line number Diff line change 1- 73cf0906ef0f6cf3d29caed7d58a7f826172d3ee593ad3510289eee2937ecd4d71074d62b0c327a7e026fd61d96d09c0b43fc40d7934b2a61fc85dbee554c210
1+ 50a671ba231a9589bee8dda3a8604e8e7304d1da0373a008a653f8000d06ba0f203accf8c0c123223a70b6b032037e4c79240f61dd0fb5046b0fe55aba5b4778
Original file line number Diff line number Diff line change 1+ [formatter .nix ]
2+ command = " nixfmt"
3+ includes = [" *.nix" ]
4+
5+ [formatter .rust ]
6+ command = " rustfmt"
7+ options = [" --edition" , " 2024" ]
8+ includes = [" *.rs" ]
Original file line number Diff line number Diff line change 11mod opts;
22
3- use std:: fs:: { set_permissions , Permissions } ;
3+ use std:: fs:: { Permissions , set_permissions } ;
44use std:: io;
55use std:: os:: unix:: fs:: PermissionsExt ;
66use std:: path:: { Path , PathBuf } ;
Original file line number Diff line number Diff line change 8383 coreutils
8484 parallel
8585 shellcheck
86+ treefmt
8687 ;
8788 # Nix
8889 inherit ( pkgs ) nixfmt-rfc-style nil ;
Original file line number Diff line number Diff line change 6464 coreutils
6565 parallel
6666 shellcheck
67+ treefmt
6768 ;
6869 # Nix
6970 inherit ( pkgs ) nixfmt-rfc-style ;
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ { lib , config , ... } :
2+ let
3+ inherit ( lib ) types ;
4+ in
5+ {
6+ options . treefmt = {
7+ enable = lib . mkEnableOption "clippy check in pre-commit hook" // {
8+ default = true ;
9+ } ;
10+ } ;
11+
12+ config = lib . mkMerge [
13+ ( lib . mkIf config . treefmt . enable {
14+ git . pre-commit . hooks = {
15+ treefmt = ''
16+ treefmt -q --fail-on-change
17+ '' ;
18+ } ;
19+ } )
20+ ] ;
21+ }
Original file line number Diff line number Diff line change @@ -60,16 +60,6 @@ function check_cargo_lock() {
6060}
6161export -f check_cargo_lock
6262
63- # NOTE: THIS FILE IS AUTO-GENERATED BY FLAKEBOX
64- function check_nixfmt() {
65- set -euo pipefail
66-
67- # we actually rely on word splitting here
68- # shellcheck disable=SC2046
69- nixfmt -c $(echo "$FLAKEBOX_GIT_LS_TEXT" | grep "\.nix$")
70- }
71- export -f check_nixfmt
72-
7363# NOTE: THIS FILE IS AUTO-GENERATED BY FLAKEBOX
7464function check_semgrep() {
7565 set -euo pipefail
@@ -148,6 +138,14 @@ function check_trailing_whitespace() {
148138}
149139export -f check_trailing_whitespace
150140
141+ # NOTE: THIS FILE IS AUTO-GENERATED BY FLAKEBOX
142+ function check_treefmt() {
143+ set -euo pipefail
144+
145+ treefmt -q --fail-on-change
146+ }
147+ export -f check_treefmt
148+
151149# NOTE: THIS FILE IS AUTO-GENERATED BY FLAKEBOX
152150function check_typos() {
153151 set -euo pipefail
@@ -164,11 +162,11 @@ parallel \
164162::: \
165163 check_cargo_fmt \
166164 check_cargo_lock \
167- check_nixfmt \
168165 check_semgrep \
169166 check_shellcheck \
170167 check_trailing_newline \
171168 check_trailing_whitespace \
169+ check_treefmt \
172170 check_typos \
173171 check_nothing
174172#
You can’t perform that action at this time.
0 commit comments