Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
[
.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(","))
@fredemmott

This comment has been minimized.

Copy link
Owner Author

@fredemmott fredemmott commented Jun 16, 2020

Usage

hh_server --check . --json | jq -r "$(<allowed-fixmes.jq)" >> .hhconfig

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.