-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't use a special case for message formatting based on policyID (#7)
- Loading branch information
James Alseth
authored
Dec 3, 2020
1 parent
389db7f
commit 722870f
Showing
2 changed files
with
10 additions
and
15 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 |
---|---|---|
@@ -1,10 +1,13 @@ | ||
package always_warn | ||
|
||
warn[msg] { | ||
msg := { | ||
"msg": "a warning! you should probably fix this", | ||
"details": {"policyID": "P0000"} | ||
} | ||
|
||
msg := format_with_id("a warning! you should probably fix this", "P0000") | ||
true | ||
} | ||
|
||
format_with_id(msg, id) = msg_fmt { | ||
msg_fmt := { | ||
"msg": sprintf("%s: %s", [id, msg]), | ||
"details": {"policyID": id} | ||
} | ||
} |
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