Skip to content

Commit

Permalink
Merge pull request #246 from MangoIV/mangoiv/fix-clippy
Browse files Browse the repository at this point in the history
feat: add offline option to `clippy`
  • Loading branch information
domenkozar authored Feb 23, 2023
2 parents c9495f0 + ca42ec2 commit 335c7f5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
11 changes: 1 addition & 10 deletions .envrc
Original file line number Diff line number Diff line change
@@ -1,10 +1 @@
HOST_XDG_DATA_DIRS="${XDG_DATA_DIRS:-}"
eval "$(lorri direnv)"
export XDG_DATA_DIRS="${XDG_DATA_DIRS}:${HOST_XDG_DATA_DIRS}"

# Use system PKI
unset SSL_CERT_FILE
unset NIX_SSL_CERT_FILE

# Install pre-commit hooks
eval "$shellHook"
use flake
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@ result*

# Generated by nix-pre-commit-hooks
/.pre-commit-config.yaml

# direnv
.direnv
7 changes: 6 additions & 1 deletion modules/hooks.nix
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,11 @@ in
description = lib.mdDoc "Fail when warnings are present";
default = false;
};
offline = mkOption {
type = types.bool;
description = lib.mdDoc "Run clippy offline";
default = true;
};
};

};
Expand Down Expand Up @@ -715,7 +720,7 @@ in
{
name = "clippy";
description = "Lint Rust code.";
entry = "${wrapper}/bin/cargo-clippy clippy ${cargoManifestPathArg} -- ${lib.optionalString settings.clippy.denyWarnings "-D warnings"}";
entry = "${wrapper}/bin/cargo-clippy clippy ${cargoManifestPathArg} ${lib.optionalString settings.clippy.offline "--offline"} -- ${lib.optionalString settings.clippy.denyWarnings "-D warnings"}";
files = "\\.rs$";
pass_filenames = false;
};
Expand Down

0 comments on commit 335c7f5

Please sign in to comment.