cloudflare/pint
Publicmirrored from https://github.com/cloudflare/pintAvailable
docs/checks/rule/owner.md
43lines · modecode
| 1 | --- |
| 2 | layout: default |
| 3 | parent: Checks |
| 4 | grand_parent: Documentation |
| 5 | --- |
| 6 | |
| 7 | # rule/owner |
| 8 | |
| 9 | This check can be used to enforce rule ownership comments used by `pint watch` |
| 10 | command when exporting metrics about problems detected in rules. |
| 11 | |
| 12 | If you see this check reports it means that `--require-owner` flag is enabled |
| 13 | for pint and a rule file is missing required ownership comment. |
| 14 | |
| 15 | To set a rule owner add a `# pint file/owner $owner` comment in a file, to set |
| 16 | an owner for all rules in that file. You can also set an owner per rule, by adding |
| 17 | `# pint rule/owner $owner` comment around given rule. |
| 18 | |
| 19 | Example: |
| 20 | |
| 21 | ```yaml |
| 22 | # pint file/owner bob |
| 23 | |
| 24 | - alert: ... |
| 25 | expr: ... |
| 26 | |
| 27 | # pint rule/owner alice |
| 28 | - alert: ... |
| 29 | expr: ... |
| 30 | ``` |
| 31 | |
| 32 | ## Configuration |
| 33 | |
| 34 | This check doesn't have any configuration options. |
| 35 | |
| 36 | ## How to enable it |
| 37 | |
| 38 | This check is enabled only if you pass `--require-owner` flag to `pint lint` |
| 39 | or `pint ci` commands. |
| 40 | |
| 41 | ## How to disable it |
| 42 | |
| 43 | Remove `--require-owner` flag from pint CLI arguments. |
| 44 | |