generated from adrienaury/go-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: exclude value with template (#36)
* feat: exclude template * test(venom): exclude template * refactor: rename function to match usage
- Loading branch information
1 parent
248ec92
commit 095f70f
Showing
9 changed files
with
142 additions
and
33 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
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,4 @@ | ||
version: "1" | ||
metrics: | ||
- name: "value" | ||
excludeTemplate: '{{.email | hasSuffix ".fr"}}' |
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,52 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<title>MIMO Report</title> | ||
<meta name="viewport" content="width=device-width,initial-scale=1" /> | ||
<meta name="description" content="MIMO Report" /> | ||
</head> | ||
<body> | ||
<h1>MIMO Report</h1> | ||
<table border="1" cellspacing="0" cellpadding="5"> | ||
<thead> | ||
<th>Field</th> | ||
<th>Nil</th> | ||
<th>Ignored</th> | ||
<th>Masked</th> | ||
<th>Missed</th> | ||
<th>Masking Rate</th> | ||
<th>Coherent Rate</th> | ||
<th>Identifiable Rate</th> | ||
<th>K</th> | ||
</thead> | ||
<tbody> | ||
|
||
<tr> | ||
<td>email</td> | ||
<td>0</td> | ||
<td>0</td> | ||
<td>0</td> | ||
<td>10</td> | ||
<td style="background-color: orange">0.00 %</td> | ||
<td style="background-color: lightgreen">100.00 %</td> | ||
<td style="background-color: lightgreen">100.00 %</td> | ||
<td style="background-color: orange">1</td> | ||
</tr> | ||
|
||
<tr> | ||
<td>value</td> | ||
<td>0</td> | ||
<td>2</td> | ||
<td>8</td> | ||
<td>0</td> | ||
<td style="background-color: lightgreen">100.00 %</td> | ||
<td style="background-color: orange">50.00 %</td> | ||
<td style="background-color: orange">80.00 %</td> | ||
<td style="background-color: orange">1</td> | ||
</tr> | ||
|
||
</tbody> | ||
</table> | ||
</body> | ||
</html> |
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,32 @@ | ||
name: value exclusion | ||
testcases: | ||
- name: exclude values by template | ||
steps: | ||
- script: echo '{"value":"A","email":"[email protected]"}' > working/real.jsonl | ||
- script: echo '{"value":"A","email":"[email protected]"}' >> working/real.jsonl | ||
- script: echo '{"value":"B","email":"[email protected]"}' >> working/real.jsonl | ||
- script: echo '{"value":"B","email":"[email protected]"}' >> working/real.jsonl | ||
- script: echo '{"value":"C","email":"[email protected]"}' >> working/real.jsonl | ||
- script: echo '{"value":"C","email":"[email protected]"}' >> working/real.jsonl | ||
- script: echo '{"value":"D","email":"[email protected]"}' >> working/real.jsonl | ||
- script: echo '{"value":"D","email":"[email protected]"}' >> working/real.jsonl | ||
- script: echo '{"value":"E","email":"[email protected]"}' >> working/real.jsonl | ||
- script: echo '{"value":"E","email":"[email protected]"}' >> working/real.jsonl | ||
|
||
- script: echo '{"value":"X","email":"[email protected]"}' > working/masked.jsonl | ||
- script: echo '{"value":"Y","email":"[email protected]"}' >> working/masked.jsonl | ||
- script: echo '{"value":"C","email":"[email protected]"}' >> working/masked.jsonl | ||
- script: echo '{"value":"C","email":"[email protected]"}' >> working/masked.jsonl | ||
- script: echo '{"value":"C","email":"[email protected]"}' >> working/masked.jsonl | ||
- script: echo '{"value":"C","email":"[email protected]"}' >> working/masked.jsonl | ||
- script: echo '{"value":"W","email":"[email protected]"}' >> working/masked.jsonl | ||
- script: echo '{"value":"W","email":"[email protected]"}' >> working/masked.jsonl | ||
- script: echo '{"value":"V","email":"[email protected]"}' >> working/masked.jsonl | ||
- script: echo '{"value":"C","email":"[email protected]"}' >> working/masked.jsonl | ||
|
||
- script: cat working/masked.jsonl | mimo --config ../configs/config_exclude_template.yaml -v3 working/real.jsonl | ||
assertions: | ||
- result.code ShouldEqual 0 | ||
- result.systemerr ShouldContainSubstring value count-ignored=2 count-masked=8 count-missed=0 count-nil=0 field=value rate-coherence=0.5 rate-identifiable=0.8 rate-masking=1 | ||
|
||
- script: mv report.html ../reports/report_exclude_template.html |