-
Notifications
You must be signed in to change notification settings - Fork 220
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add extra integrity tests (#493)
- Loading branch information
Showing
8 changed files
with
132 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
exec git init | ||
exec lefthook install | ||
exec git config user.email "you@example.com" | ||
exec git config user.name "Your Name" | ||
|
||
exec lefthook run edit_file | ||
exec git add -A | ||
exec lefthook run edit_file | ||
exec git status --short | ||
stdout 'AM newfile.txt' | ||
|
||
exec git commit -m 'test hide unstaged changes' | ||
exec git status --short | ||
stdout 'M newfile.txt' | ||
|
||
-- lefthook.yml -- | ||
min_version: 1.1.1 | ||
pre-commit: | ||
commands: | ||
edit_file: | ||
run: echo newline >> file.txt | ||
stage_fixed: true | ||
|
||
edit_file: | ||
commands: | ||
echo: | ||
run: echo newline >> newfile.txt | ||
|
||
-- file.txt -- | ||
firstline |
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,10 @@ | ||
exec git init | ||
! exec lefthook run pre-commit | ||
stdout 'required Lefthook version is higher than current' | ||
|
||
-- lefthook.yml -- | ||
min_version: 13.1.1 | ||
pre-commit: | ||
commands: | ||
echo: | ||
run: echo |
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,21 @@ | ||
exec git init | ||
exec lefthook install | ||
|
||
exec lefthook dump | ||
cmp stdout lefthook-dump.yml | ||
|
||
-- lefthook.yml -- | ||
remote: | ||
git_url: https://github.com/evilmartians/lefthook | ||
config: examples/with_scripts/lefthook.yml | ||
ref: v1.4.0 | ||
|
||
-- lefthook-dump.yml -- | ||
pre-commit: | ||
scripts: | ||
good_job.js: | ||
runner: node | ||
remote: | ||
config: examples/with_scripts/lefthook.yml | ||
git_url: https://github.com/evilmartians/lefthook | ||
ref: v1.4.0 |
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,22 @@ | ||
exec git init | ||
exec git config user.email "you@example.com" | ||
exec git config user.name "Your Name" | ||
exec git add -A | ||
exec lefthook install | ||
exec git commit -m 'test' | ||
stderr '\s*Hi there from script\s*' | ||
|
||
-- lefthook.yml -- | ||
skip_output: | ||
- meta | ||
- summary | ||
- execution_info | ||
pre-commit: | ||
scripts: | ||
"file.sh": | ||
runner: sh | ||
|
||
-- .lefthook/pre-commit/file.sh -- | ||
#!/usr/bin/env sh | ||
|
||
echo Hi there from scripts |
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 |
---|---|---|
|
@@ -15,4 +15,3 @@ skip_output = [ | |
|
||
[pre-commit.commands.echo] | ||
run = "echo Hi there from Lefthook" | ||
|
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,20 @@ | ||
exec git init | ||
exec lefthook install | ||
exec git config user.email "you@example.com" | ||
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: | ||
commands: | ||
edit_file: | ||
run: echo newline >> file.txt | ||
stage_fixed: true | ||
|
||
-- file.txt -- | ||
firstline |