Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions .github/workflows/pre-commit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@ jobs:
uses:
samueldr/lix-gha-installer-action@8c7f8a4b0f594ab8a6dc3bf71c217587bbc756b5
- name: Check stage pre-commit
run: "nix-shell -A pre-commit --run 'set -o pipefail\nset -o nounset\nset -o
errexit\npre-commit run --all-files --hook-stage pre-commit --show-diff-on-failure'"
run: "\t set -o pipefail\n\t set -o nounset\n\t set -o errexit\n\t nix-shell
--run 'pre-commit run --all-files --hook-stage pre-commit --show-diff-on-failure'\n\
\t"
- name: Check stage pre-push
run: "nix-shell -A pre-commit --run 'set -o pipefail\nset -o nounset\nset -o
errexit\npre-commit run --all-files --hook-stage pre-push --show-diff-on-failure'"
run: "\t set -o pipefail\n\t set -o nounset\n\t set -o errexit\n\t nix-shell
--run 'pre-commit run --all-files --hook-stage pre-push --show-diff-on-failure'\n\
\t"
name: Run pre-commit on all files
on:
- push
Expand Down
12 changes: 7 additions & 5 deletions workflows/pre-commit.nix
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,15 @@
}
]
# Inspired by DGNum's way of checking for pre-commit hooks.
++ (builtins.map
++ (map
(stage: {
name = "Check stage ${stage}";
run = nix-actions.lib.nix-shell {
script = "pre-commit run --all-files --hook-stage ${stage} --show-diff-on-failure";
shell = "pre-commit";
};
run = ''
set -o pipefail
set -o nounset
set -o errexit
nix-shell --run 'pre-commit run --all-files --hook-stage ${stage} --show-diff-on-failure'
'';
})
[
"pre-commit"
Expand Down