File tree Expand file tree Collapse file tree 3 files changed +39
-1
lines changed Expand file tree Collapse file tree 3 files changed +39
-1
lines changed Original file line number Diff line number Diff line change @@ -95,6 +95,17 @@ eval "$shellHook"
95
95
96
96
- [ elm-format] ( https://github.com/avh4/elm-format )
97
97
98
+ ## Rust
99
+
100
+ - [ rustfmt] ( https://github.com/rust-lang/rustfmt )
101
+ - [ clippy] ( https://github.com/rust-lang/rust-clippy )
102
+ - cargo-check: Runs ` cargo check `
103
+
104
+ * Warning* : running ` clippy ` after ` cargo check ` hides
105
+ (https://github.com/rust-lang/rust-clippy/issues/4612 ) all clippy specific
106
+ errors. Clippy subsumes ` cargo check ` so only one of these two checks should by
107
+ used at the same time.
108
+
98
109
## Shell
99
110
100
111
- [ shellcheck] ( https://github.com/koalaman/shellcheck )
Original file line number Diff line number Diff line change 140
140
types = [ "file" "yaml" ] ;
141
141
entry = "${ tools . yamllint } /bin/yamllint" ;
142
142
} ;
143
+ rustfmt =
144
+ {
145
+ name = "rustfmt" ;
146
+ description = "Format Rust code." ;
147
+ entry = "${ tools . rustfmt } /bin/cargo-fmt fmt -- --check --color always" ;
148
+ files = "\\ .rs$" ;
149
+ pass_filenames = false ;
150
+ } ;
151
+ clippy =
152
+ {
153
+ name = "clippy" ;
154
+ description = "Lint Rust code." ;
155
+ entry = "${ tools . clippy } /bin/cargo-clippy clippy" ;
156
+ files = "\\ .rs$" ;
157
+ pass_filenames = false ;
158
+ } ;
159
+ cargo-check =
160
+ {
161
+ name = "cargo-check" ;
162
+ description = "Check the cargo package for errors" ;
163
+ entry = "${ tools . cargo } /bin/cargo check" ;
164
+ files = "\\ .rs$" ;
165
+ pass_filenames = false ;
166
+ } ;
143
167
} ;
144
168
}
Original file line number Diff line number Diff line change 17
17
, nix-linter
18
18
, callPackage
19
19
, pythonPackages
20
+ , rustfmt
21
+ , clippy
22
+ , cargo
20
23
} :
21
24
22
25
{
23
- inherit ansible-lint hlint shellcheck ormolu hindent cabal-fmt nixpkgs-fmt nixfmt nix-linter ;
26
+ inherit ansible-lint hlint shellcheck ormolu hindent cabal-fmt nixpkgs-fmt nixfmt nix-linter rustfmt clippy cargo ;
24
27
inherit ( elmPackages ) elm-format ;
25
28
inherit ( haskellPackages ) brittany hpack ;
26
29
inherit ( pythonPackages ) yamllint ;
You can’t perform that action at this time.
0 commit comments