From 7fcc319d5ee9e66b161ee64635e7771f96911864 Mon Sep 17 00:00:00 2001 From: aleksana Date: Sun, 28 Jul 2024 00:28:21 +0800 Subject: [PATCH] workflows/check-nixf-tidy.yml: temporarily ignore sema-escaping-with --- .github/workflows/check-nixf-tidy.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/check-nixf-tidy.yml b/.github/workflows/check-nixf-tidy.yml index a6be72d3332a..5a8fdbc96248 100644 --- a/.github/workflows/check-nixf-tidy.yml +++ b/.github/workflows/check-nixf-tidy.yml @@ -41,6 +41,16 @@ jobs: run: "nix-env -f '' -iAP nixf jq" - name: Check that Nix files pass nixf-tidy run: | + # Filtering error messages we don't like + nixf_wrapper(){ + nixf-tidy --variable-lookup < "$1" | jq -r ' + [ + "sema-escaping-with" + ] + as $ignored_errors|[.[]|select(.sname as $s|$ignored_errors|index($s)|not)] + ' + } + failedFiles=() # Don't report errors to file overview @@ -74,11 +84,11 @@ jobs: continue esac - if [[ -n "$source" ]] && [[ "$(nixf-tidy --variable-lookup < ${{ env.base }}/"$source")" != '[]' ]] 2>/dev/null; then + if [[ -n "$source" ]] && [[ "$(nixf_wrapper ${{ env.base }}/"$source")" != '[]' ]] 2>/dev/null; then echo "Ignoring file $file because it doesn't pass nixf-tidy in the base commit" echo # insert blank line else - nixf_report="$(nixf-tidy --variable-lookup < "$dest")" + nixf_report="$(nixf_wrapper "$dest")" if [[ "$nixf_report" != '[]' ]]; then echo "$dest doesn't pass nixf-tidy. Reported by nixf-tidy:" errors=$(echo "$nixf_report" | jq -r --arg dest "$dest" '