Skip to content

Commit

Permalink
pre-commit: rename more uses
Browse files Browse the repository at this point in the history
  • Loading branch information
sandydoo committed Nov 4, 2024
1 parent 50b93c6 commit 934e851
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/generate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ jobs:
- name: Install devenv
run: nix profile install . -L --accept-flake-config

- name: Disable pre-commit hooks
- name: Disable git-hooks
run: |
echo '{ pre-commit.default_stages = ["manual"]; }' > devenv.local.nix
echo '{ git-hooks.default_stages = ["manual"]; }' > devenv.local.nix
- name: Generate doc options
run: devenv shell devenv-generate-doc-options
Expand Down
1 change: 0 additions & 1 deletion _redirects
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/blog/2023/03/20/devenv-10-rewrite-in-rust/ /blog/2024/03/20/devenv-10-rewrite-in-rust/ 301
/blog/2024/10/22/devenv-is-switching-nix-implementation-to-tvix/ /blog/2024/10/22/devenv-is-switching-its-nix-implementation-to-tvix/ 301
/pre-commit-hooks/ /git-hooks/ 301

4 changes: 2 additions & 2 deletions docs/guides/using-with-flakes.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,12 @@ And run [tests with `devenv test`](/tests).
```console
$ devenv test
Running tasks devenv:enterShell
Succeeded devenv:pre-commit:install 10ms
Succeeded devenv:git-hooks:install 10ms
Succeeded devenv:enterShell 4ms
2 Succeeded 14.75ms
• Testing ...
Running tasks devenv:enterTest
Succeeded devenv:pre-commit:run 474ms
Succeeded devenv:git-hooks:run 474ms
Not implemented devenv:enterTest
1 Skipped, 1 Succeeded 474.62ms
```
Expand Down
2 changes: 1 addition & 1 deletion docs/integrations/github-actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ It builds the shell and runs any defined [git hooks](../git-hooks.md) against yo
This is a quick and easy way to test that your development environment works as expected and lint your code at the same time.

```yaml
- name: Build the devenv shell and run any pre-commit hooks
- name: Build the devenv shell and run any git hooks
run: devenv test
```

Expand Down
2 changes: 1 addition & 1 deletion docs/overrides/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ <h1 class="text-2xl font-bold tracking-tight text-black sm:text-4xl">Fast, Decla
<pre class="text-white text-sm"><code class="language-shell" data-shell-prefix="$">devenv shell
...
Running tasks devenv:enterShell
Succeeded devenv:pre-commit:install 15ms
Succeeded devenv:git-hooks:install 15ms
Succeeded myapp:build 23ms
Succeeded devenv:enterShell 23ms
3 Succeeded 50.14ms
Expand Down
2 changes: 1 addition & 1 deletion examples/go/devenv.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

languages.go.enable = true;

pre-commit.hooks = {
git-hooks.hooks = {
govet = {
enable = true;
pass_filenames = false;
Expand Down
4 changes: 2 additions & 2 deletions examples/modern-c/devenv.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
cmake --version
'';

pre-commit.excludes = [ ".devenv" ];
pre-commit.hooks = {
git-hooks.excludes = [ ".devenv" ];
git-hooks.hooks = {
clang-tidy.enable = true;
};
}
3 changes: 2 additions & 1 deletion examples/rust-wasm-cross/devenv.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,15 @@
components = [ "rustc" "cargo" "clippy" "rustfmt" "rust-analyzer" "rust-std" ];
};

pre-commit.hooks = {
git-hooks.hooks = {
clippy = {
enable = true;
settings.offline = false;
extraPackages = [ pkgs.openssl ];
};
rustfmt.enable = true;
};
git-hooks.settings.rust.cargoManifestPath = "./Cargo.toml";

packages = [
pkgs.wasm-pack
Expand Down
8 changes: 4 additions & 4 deletions examples/rust/devenv.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
components = [ "rustc" "cargo" "clippy" "rustfmt" "rust-analyzer" ];
};

#pre-commit.hooks = {
# rustfmt.enable = true;
# clippy.enable = true;
#};
# git-hooks.hooks = {
# rustfmt.enable = true;
# clippy.enable = true;
# };

packages = lib.optionals pkgs.stdenv.isDarwin (with pkgs.darwin.apple_sdk; [
frameworks.Security
Expand Down
6 changes: 3 additions & 3 deletions src/modules/languages/rust.nix
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,9 @@ in
CFLAGS = lib.optionalString pkgs.stdenv.isDarwin "-iframework ${config.devenv.profile}/Library/Frameworks";
};

pre-commit.tools.cargo = mkOverrideTools cfg.toolchain.cargo or null;
pre-commit.tools.rustfmt = mkOverrideTools cfg.toolchain.rustfmt or null;
pre-commit.tools.clippy = mkOverrideTools cfg.toolchain.clippy or null;
git-hooks.tools.cargo = mkOverrideTools cfg.toolchain.cargo or null;
git-hooks.tools.rustfmt = mkOverrideTools cfg.toolchain.rustfmt or null;
git-hooks.tools.clippy = mkOverrideTools cfg.toolchain.clippy or null;
}
)

Expand Down

0 comments on commit 934e851

Please sign in to comment.