Created
June 16, 2020 18:18
-
-
Save fredemmott/6fe221cacc1221b84264b2a476eaa2a7 to your computer and use it in GitHub Desktop.
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
[ | |
.errors[].message[] | |
| select(.descr | startswith("You cannot use HH_FIXME")) | |
| ( | |
if .path | endswith(".hackpartial") | |
then { it: ., option: "allowed_fixme_codes_partial" } | |
else { it: ., option: "allowed_fixme_codes_strict" } | |
end | |
) | |
| ( | |
if .it.descr | endswith("in declarations") | |
then | |
[ | |
{ code: .it.code, option: .option }, | |
{ code: .it.code, option: "allowed_decl_fixme_codes" } | |
] | |
else [ { code: .it.code, option: .option } ] | |
end | |
) | |
] | |
| flatten | |
| group_by(.option) | |
| .[] | |
| { | |
option: .[0].option, | |
codes: map(.code) | unique | sort | |
} | |
|.option+"="+(.codes|join(",")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Usage
hh_server --check . --json | jq -r "$(<allowed-fixmes.jq)" >> .hhconfig