-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #641 from cloudflare/issue-609
Add exclude option to ci block
- Loading branch information
Showing
11 changed files
with
185 additions
and
21 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
mkdir testrepo | ||
cd testrepo | ||
exec git init --initial-branch=main . | ||
|
||
cp ../src/.pint.hcl . | ||
env GIT_AUTHOR_NAME=pint | ||
env GIT_AUTHOR_EMAIL=pint@example.com | ||
env GIT_COMMITTER_NAME=pint | ||
env GIT_COMMITTER_EMAIL=pint@example.com | ||
exec git add . | ||
exec git commit -am 'import rules and config' | ||
|
||
exec git checkout -b v1 | ||
cp ../src/a.yml a.yml | ||
exec git add a.yml | ||
exec git commit -am 'v1' | ||
|
||
exec git checkout -b v2 | ||
cp ../src/b.yml b.yml | ||
exec git add b.yml | ||
exec git commit -am 'v2' | ||
|
||
pint.ok -l debug --no-color ci | ||
! stdout . | ||
stderr 'level=debug msg="Got branch information" base=main current=v2' | ||
stderr 'level=debug msg="Found commit to scan" commit=.*' | ||
stderr 'level=debug msg="Found commit to scan" commit=.*' | ||
stderr 'level=debug msg="Git file change" change=A commit=.* path=a.yml' | ||
stderr 'level=debug msg="Git file change" change=A commit=.* path=b.yml' | ||
stderr 'level=debug msg="Skipping file due to include/exclude rules" path=a.yml' | ||
stderr 'level=debug msg="Skipping file due to include/exclude rules" path=b.yml' | ||
|
||
-- src/a.yml -- | ||
- record: rule1 | ||
expr: sum(foo) bi() | ||
-- src/b.yml -- | ||
- record: rule1 | ||
expr: sum(foo) bi() | ||
-- src/.pint.hcl -- | ||
ci { | ||
baseBranch = "main" | ||
exclude = [".*.yml"] | ||
} | ||
parser { | ||
relaxed = [".*"] | ||
} |
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,47 @@ | ||
mkdir testrepo | ||
cd testrepo | ||
exec git init --initial-branch=main . | ||
|
||
cp ../src/.pint.hcl . | ||
env GIT_AUTHOR_NAME=pint | ||
env GIT_AUTHOR_EMAIL=pint@example.com | ||
env GIT_COMMITTER_NAME=pint | ||
env GIT_COMMITTER_EMAIL=pint@example.com | ||
exec git add . | ||
exec git commit -am 'import rules and config' | ||
|
||
exec git checkout -b v1 | ||
cp ../src/a.yml a.yml | ||
exec git add a.yml | ||
exec git commit -am 'v1' | ||
|
||
exec git checkout -b v2 | ||
cp ../src/b.yml b.yml | ||
exec git add b.yml | ||
exec git commit -am 'v2' | ||
|
||
pint.ok -l debug --no-color ci | ||
! stdout . | ||
stderr 'level=debug msg="Got branch information" base=main current=v2' | ||
stderr 'level=debug msg="Found commit to scan" commit=.*' | ||
stderr 'level=debug msg="Found commit to scan" commit=.*' | ||
stderr 'level=debug msg="Git file change" change=A commit=.* path=a.yml' | ||
stderr 'level=debug msg="Git file change" change=A commit=.* path=b.yml' | ||
stderr 'level=debug msg="Skipping file due to include/exclude rules" path=a.yml' | ||
stderr 'level=debug msg="Skipping file due to include/exclude rules" path=b.yml' | ||
|
||
-- src/a.yml -- | ||
- record: rule1 | ||
expr: sum(foo) bi() | ||
-- src/b.yml -- | ||
- record: rule1 | ||
expr: sum(foo) bi() | ||
-- src/.pint.hcl -- | ||
ci { | ||
baseBranch = "main" | ||
include = [".*.yml"] | ||
exclude = [".*.yml"] | ||
} | ||
parser { | ||
relaxed = [".*"] | ||
} |
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
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
Oops, something went wrong.