Skip to content

Instantly share code, notes, and snippets.

@fredemmott
Created June 16, 2020 18:18
Show Gist options
  • Save fredemmott/6fe221cacc1221b84264b2a476eaa2a7 to your computer and use it in GitHub Desktop.
Save fredemmott/6fe221cacc1221b84264b2a476eaa2a7 to your computer and use it in GitHub Desktop.
[
.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
Copy link
Author

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