-
Notifications
You must be signed in to change notification settings - Fork 221
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: add integrity tests and fix some odd merging
- Loading branch information
Showing
7 changed files
with
236 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
exec git init | ||
exec git config user.email "[email protected]" | ||
exec git config user.name "Your Name" | ||
exec git add -A | ||
exec lefthook install | ||
! exec git commit -m 'test' | ||
stderr '\s*fails: no such command\s*' | ||
|
||
-- lefthook.yml -- | ||
output: | ||
- failure | ||
pre-commit: | ||
jobs: | ||
- name: fails | ||
run: oops-no-such-command | ||
fail_text: no such command |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
[windows] skip | ||
|
||
exec git init | ||
exec git config user.email "[email protected]" | ||
exec git config user.name "Your Name" | ||
exec lefthook install | ||
chmod 777 executable | ||
symlink symlink -> results | ||
exec git add -A | ||
exec git commit -m 'test' | ||
exec lefthook run filters | ||
stdout '.*all ❯\s+executable lefthook.yml results symlink\s+┃.*' | ||
stdout '.*filter_text ❯\s+executable lefthook.yml results\s+┃.*' | ||
stdout '.*filter_executable ❯\s+executable\s+┃.*' | ||
stdout '.*filter_symlink ❯\s+symlink\s+┃.*' | ||
stdout '.*filter_not_symlink ❯\s+executable lefthook.yml results\s+┃.*' | ||
stdout '.*filter_not_executable ❯\s+lefthook.yml results symlink\s*' | ||
|
||
-- lefthook.yml -- | ||
output: | ||
- execution | ||
- skips | ||
filters: | ||
piped: true | ||
jobs: | ||
- name: all | ||
run: echo {all_files} | ||
|
||
- name: filter_text | ||
run: echo {all_files} | ||
file_types: text | ||
|
||
- name: filter_executable | ||
run: echo {all_files} | ||
file_types: executable | ||
|
||
- name: filter_symlink | ||
run: echo {all_files} | ||
file_types: symlink | ||
|
||
- name: filter_not_symlink | ||
run: echo {all_files} | ||
file_types: not symlink | ||
|
||
- name: filter_not_executable | ||
run: echo {all_files} | ||
file_types: | ||
- not executable | ||
|
||
-- results -- | ||
some text | ||
|
||
-- executable -- | ||
#!/bin/sh | ||
|
||
echo 'Executable' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
[windows] skip | ||
|
||
exec git init | ||
exec lefthook dump | ||
cmp stdout dump.yml | ||
! stderr . | ||
|
||
-- lefthook.yml -- | ||
extends: | ||
- extends/e1.yml | ||
|
||
pre-commit: | ||
jobs: | ||
- name: group | ||
group: | ||
jobs: | ||
- name: child | ||
run: named | ||
- run: 0 no-name | ||
- name: echo | ||
run: echo 0 | ||
- run: lefthook.yml | ||
|
||
-- extends/e1.yml -- | ||
extends: | ||
- extends/e2.yml | ||
|
||
pre-commit: | ||
jobs: | ||
- name: group | ||
group: | ||
jobs: | ||
- name: child | ||
run: child named | ||
- run: 1 no-name | ||
- name: echo | ||
run: echo 1 | ||
skip: true | ||
- run: e1 | ||
|
||
e1: | ||
jobs: | ||
- name: echo | ||
run: e1 | ||
|
||
-- extends/e2.yml -- | ||
extends: | ||
- extends/e3.yml | ||
|
||
pre-commit: | ||
jobs: | ||
- name: group | ||
glob: "*.rb" | ||
group: | ||
jobs: | ||
- name: child | ||
run: child named with glob | ||
- run: 2 no-name | ||
- name: echo | ||
run: echo 2 | ||
tags: ["backend"] | ||
- run: e2 | ||
|
||
e2: | ||
jobs: | ||
- name: echo | ||
run: e2 | ||
|
||
-- extends/e3.yml -- | ||
pre-commit: | ||
jobs: | ||
- name: group | ||
glob: "*.rb" | ||
group: | ||
jobs: | ||
- name: child | ||
stage_fixed: true | ||
- run: 3 no-name | ||
- name: echo | ||
glob: 3 | ||
- run: e3 | ||
|
||
e3: | ||
jobs: | ||
- name: echo | ||
run: e3 | ||
|
||
-- dump.yml -- | ||
e1: | ||
jobs: | ||
- name: echo | ||
run: e1 | ||
e2: | ||
jobs: | ||
- name: echo | ||
run: e2 | ||
e3: | ||
jobs: | ||
- name: echo | ||
run: e3 | ||
extends: | ||
- extends/e3.yml | ||
pre-commit: | ||
jobs: | ||
- name: group | ||
glob: '*.rb' | ||
group: | ||
jobs: | ||
- name: child | ||
run: child named with glob | ||
stage_fixed: true | ||
- run: 0 no-name | ||
- run: 1 no-name | ||
- run: 2 no-name | ||
- run: 3 no-name | ||
- name: echo | ||
run: echo 2 | ||
glob: "3" | ||
tags: | ||
- backend | ||
skip: true | ||
- run: lefthook.yml | ||
- run: e1 | ||
- run: e2 | ||
- run: e3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
exec git init | ||
exec lefthook install | ||
exec git config user.email "[email protected]" | ||
exec git config user.name "Your Name" | ||
exec git add -A | ||
exec git status --short | ||
exec git commit -m 'test stage_fixed' | ||
exec git status --short | ||
! stdout . | ||
|
||
-- lefthook.yml -- | ||
min_version: 1.1.1 | ||
pre-commit: | ||
jobs: | ||
- stage_fixed: true | ||
run: | | ||
echo newline >> "[file].js" | ||
echo newline >> file.txt | ||
|
||
-- file.txt -- | ||
sometext | ||
|
||
-- [file].js -- | ||
somecode |