Skip to content

Commit 335c7f5

Browse files
authored
Merge pull request #246 from MangoIV/mangoiv/fix-clippy
feat: add offline option to `clippy`
2 parents c9495f0 + ca42ec2 commit 335c7f5

File tree

3 files changed

+10
-11
lines changed

3 files changed

+10
-11
lines changed

.envrc

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1 @@
1-
HOST_XDG_DATA_DIRS="${XDG_DATA_DIRS:-}"
2-
eval "$(lorri direnv)"
3-
export XDG_DATA_DIRS="${XDG_DATA_DIRS}:${HOST_XDG_DATA_DIRS}"
4-
5-
# Use system PKI
6-
unset SSL_CERT_FILE
7-
unset NIX_SSL_CERT_FILE
8-
9-
# Install pre-commit hooks
10-
eval "$shellHook"
1+
use flake

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,6 @@ result*
22

33
# Generated by nix-pre-commit-hooks
44
/.pre-commit-config.yaml
5+
6+
# direnv
7+
.direnv

modules/hooks.nix

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,11 @@ in
349349
description = lib.mdDoc "Fail when warnings are present";
350350
default = false;
351351
};
352+
offline = mkOption {
353+
type = types.bool;
354+
description = lib.mdDoc "Run clippy offline";
355+
default = true;
356+
};
352357
};
353358

354359
};
@@ -715,7 +720,7 @@ in
715720
{
716721
name = "clippy";
717722
description = "Lint Rust code.";
718-
entry = "${wrapper}/bin/cargo-clippy clippy ${cargoManifestPathArg} -- ${lib.optionalString settings.clippy.denyWarnings "-D warnings"}";
723+
entry = "${wrapper}/bin/cargo-clippy clippy ${cargoManifestPathArg} ${lib.optionalString settings.clippy.offline "--offline"} -- ${lib.optionalString settings.clippy.denyWarnings "-D warnings"}";
719724
files = "\\.rs$";
720725
pass_filenames = false;
721726
};

0 commit comments

Comments
 (0)