-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(ignore): apply sorting when displaying all ignores (#1407)
* fix(ignore): apply sorting when displaying all ignores * test: add some coverage for ignore * chore: pr feedback
- Loading branch information
Showing
5 changed files
with
149 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
|
||
-- | ||
|
||
5b926801859e02e36224dc3a648a2fda_0 | ||
├─ Ignored At: 2023-10-13T14:57:07Z | ||
├─ Author: gotbadger | ||
├─ False positive? Yes | ||
└─ Comment: variable is safe | ||
|
||
dc369468d8a5d5bb522d023ae7485376_0 | ||
├─ Ignored At: 2023-11-13T14:45:21Z | ||
├─ Author: gotbadger | ||
├─ False positive? Yes | ||
└─ Comment: secret placeholder | ||
|
||
fff78d76f2c44a5768dcb4d55a3bd276_0 | ||
├─ Ignored At: 2023-11-13T14:48:31Z | ||
├─ Author: gotbadger | ||
├─ False positive? No | ||
└─ Comment: data hash | ||
|
||
23d5ed741c83e2e54cc77bdf597bd15d_0 | ||
├─ Ignored At: 2023-11-13T14:52:08Z | ||
├─ Author: gotbadger | ||
├─ False positive? Yes | ||
└─ Comment: token generation | ||
|
||
68a86d90f28db878612eb5f699c06543_0 | ||
├─ Ignored At: 2023-11-13T15:00:28Z | ||
├─ Author: gotbadger | ||
├─ False positive? No | ||
└─ Comment: low risk | ||
|
||
6c3dd0e4ba8f4c427dffaea6c6696986_0 | ||
├─ Ignored At: 2023-11-15T11:51:54Z | ||
├─ Author: gotbadger | ||
├─ False positive? Yes | ||
└─ Comment: token gen | ||
|
||
|
||
|
||
|
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 @@ | ||
|
||
-- | ||
|
||
68a86d90f28db878612eb5f699c06543_0 | ||
├─ Ignored At: 2023-11-13T15:00:28Z | ||
├─ Author: gotbadger | ||
├─ False positive? No | ||
└─ Comment: low risk | ||
|
||
|
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 @@ | ||
package ignore_test | ||
|
||
import ( | ||
"path/filepath" | ||
"testing" | ||
|
||
"github.com/bearer/bearer/e2e/internal/testhelper" | ||
) | ||
|
||
func newIgnoreTest(name string, arguments []string) testhelper.TestCase { | ||
arguments = append([]string{ | ||
"ignore"}, | ||
arguments..., | ||
) | ||
return testhelper.NewTestCase(name, arguments, testhelper.TestCaseOptions{ | ||
DisplayProgressBar: true, | ||
DisplayStdErr: true, | ||
IgnoreForce: true, | ||
}) | ||
} | ||
|
||
func TestShowAll(t *testing.T) { | ||
tests := []testhelper.TestCase{ | ||
newIgnoreTest("show-all", []string{ | ||
"show", | ||
"--all", | ||
"--ignore-file", | ||
filepath.Join("e2e", "ignore", "testdata/test.ignore"), | ||
}), | ||
} | ||
|
||
testhelper.RunTests(t, tests) | ||
} | ||
|
||
func TestShowIndividual(t *testing.T) { | ||
tests := []testhelper.TestCase{ | ||
newIgnoreTest("show-individual", []string{ | ||
"show", | ||
"68a86d90f28db878612eb5f699c06543_0", | ||
"--ignore-file", | ||
filepath.Join("e2e", "ignore", "testdata/test.ignore"), | ||
}), | ||
} | ||
|
||
testhelper.RunTests(t, tests) | ||
} |
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,38 @@ | ||
{ | ||
"23d5ed741c83e2e54cc77bdf597bd15d_0": { | ||
"author": "gotbadger", | ||
"comment": "token generation", | ||
"false_positive": true, | ||
"ignored_at": "2023-11-13T14:52:08Z" | ||
}, | ||
"5b926801859e02e36224dc3a648a2fda_0": { | ||
"author": "gotbadger", | ||
"comment": "variable is safe", | ||
"false_positive": true, | ||
"ignored_at": "2023-10-13T14:57:07Z" | ||
}, | ||
"68a86d90f28db878612eb5f699c06543_0": { | ||
"author": "gotbadger", | ||
"comment": "low risk", | ||
"false_positive": false, | ||
"ignored_at": "2023-11-13T15:00:28Z" | ||
}, | ||
"6c3dd0e4ba8f4c427dffaea6c6696986_0": { | ||
"author": "gotbadger", | ||
"comment": "token gen", | ||
"false_positive": true, | ||
"ignored_at": "2023-11-15T11:51:54Z" | ||
}, | ||
"dc369468d8a5d5bb522d023ae7485376_0": { | ||
"author": "gotbadger", | ||
"comment": "secret placeholder", | ||
"false_positive": true, | ||
"ignored_at": "2023-11-13T14:45:21Z" | ||
}, | ||
"fff78d76f2c44a5768dcb4d55a3bd276_0": { | ||
"author": "gotbadger", | ||
"comment": "data hash", | ||
"false_positive": false, | ||
"ignored_at": "2023-11-13T14:48:31Z" | ||
} | ||
} |
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