Skip to content

Commit

Permalink
simplify script
Browse files Browse the repository at this point in the history
  • Loading branch information
pkwarren committed Mar 21, 2024
1 parent cd697e5 commit 414435f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions make/go/scripts/checknolintlint.bash
Expand Up @@ -37,19 +37,21 @@ fi
# require-specific: true
#

if [[ `yq '.linters-settings.nolintlint.allow-unused // false' .golangci.yml` != "false" ]]; then
declare allow_unused= require_explanation= require_specific= allow_no_explanation_0=
eval $(yq --output-format shell '.linters-settings.nolintlint' .golangci.yml)
if [[ "${allow_unused}" != "false" ]]; then
echo ".golangci.yml: nolintlint allow-unused must be set to false" >&2
exit 1
fi
if [[ `yq '.linters-settings.nolintlint.require-explanation // false' .golangci.yml` != "true" ]]; then
if [[ "${require_explanation}" != "true" ]]; then
echo ".golangci.yml: nolintlint require-explanation must be set to true" >&2
exit 1
fi
if [[ `yq '.linters-settings.nolintlint.require-specific // false' .golangci.yml` != "true" ]]; then
if [[ "${require_specific}" != "true" ]]; then
echo ".golangci.yml: nolintlint require-specific must be set to true" >&2
exit 1
fi
if [[ `yq '.linters-settings.nolintlint.allow-no-explanation // [] | length' .golangci.yml` != "0" ]]; then
if [[ -n "${allow_no_explanation_0}" ]]; then
echo ".golangci.yml: nolintlint allow-no-explanation must be empty" >&2
exit 1
fi
Expand Down

0 comments on commit 414435f

Please sign in to comment.