Skip to content

Commit

Permalink
feat: minimal pre-commit task (prefix-dev#1984)
Browse files Browse the repository at this point in the history
By running `pixi run pre-commit-install-minimal`, only the pre-commit
hooks are installed, which don't include rust anymore. With `pixi run
pre-commit-install` rust lints are also run before pushing.
  • Loading branch information
Hofer-Julian authored Sep 5, 2024
1 parent 7dbeb60 commit a3e1b3f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,19 +58,21 @@ repos:
- id: fmt
name: fmt
language: system
stages: [push, manual]
types: [file, rust]
entry: cargo fmt
pass_filenames: false
- id: clippy
name: clippy
language: system
stages: [push, manual]
types: [file, rust]
entry: cargo clippy --all-targets --workspace -- -D warnings -Dclippy::dbg_macro # Use -D warnings option to ensure the job fails when encountering warnings
pass_filenames: false
- id: test
name: test
language: system
stages: [push]
stages: [push, manual]
types: [file, rust]
entry: cargo test
pass_filenames: false
3 changes: 2 additions & 1 deletion pixi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ typos = ">=1.23.1,<2"
[feature.lint.tasks]
lint = { depends-on = ["pre-commit-run"] }
pre-commit-install = "pre-commit install"
pre-commit-run = "pre-commit run --all"
pre-commit-install-minimal = "pre-commit install -t=pre-commit"
pre-commit-run = "pre-commit run --all-files"
toml-format = { cmd = "taplo fmt", env = { RUST_LOG = "warn" } }
toml-lint = "taplo lint --verbose **/pixi.toml"

Expand Down

0 comments on commit a3e1b3f

Please sign in to comment.