From c75478855804395e449c548869d1b3a882c156cd Mon Sep 17 00:00:00 2001 From: mongolyy Date: Sun, 21 Jan 2024 19:38:56 +0900 Subject: [PATCH 1/2] add truncated pattern --- testdata/error/js/format-truncate.js | 76 ++++++++++++++++++++++++++++ testdata/error/{ => js}/format.js | 0 testdata/error/{ => js}/lint.js | 0 testdata/error/{ => ts}/format.ts | 0 4 files changed, 76 insertions(+) create mode 100644 testdata/error/js/format-truncate.js rename testdata/error/{ => js}/format.js (100%) rename testdata/error/{ => js}/lint.js (100%) rename testdata/error/{ => ts}/format.ts (100%) diff --git a/testdata/error/js/format-truncate.js b/testdata/error/js/format-truncate.js new file mode 100644 index 0000000..8b4f486 --- /dev/null +++ b/testdata/error/js/format-truncate.js @@ -0,0 +1,76 @@ +// truncate format result pattern +console.log('This line is detected by diagnostics.'); +console.log('This line is detected by diagnostics.'); +console.log('This line is detected by diagnostics.'); +console.log('This line is detected by diagnostics.'); +console.log('This line is detected by diagnostics.'); +console.log('This line is detected by diagnostics.'); +console.log('This line is detected by diagnostics.'); +console.log('This line is detected by diagnostics.'); +console.log('This line is detected by diagnostics.'); +console.log('This line is detected by diagnostics.'); +console.log('This line is detected by diagnostics.'); +console.log('This line is detected by diagnostics.'); +console.log('This line is detected by diagnostics.'); +console.log('This line is detected by diagnostics.'); +console.log('This line is detected by diagnostics.'); +console.log('This line is detected by diagnostics.'); +console.log('This line is detected by diagnostics.'); +console.log('This line is detected by diagnostics.'); +console.log('This line is detected by diagnostics.'); +console.log('This line is detected by diagnostics.'); +console.log('This line is detected by diagnostics.'); +console.log('This line is detected by diagnostics.'); +console.log('This line is detected by diagnostics.'); +console.log('This line is detected by diagnostics.'); +console.log('This line is detected by diagnostics.'); +console.log('This line is detected by diagnostics.'); +console.log('This line is detected by diagnostics.'); +console.log('This line is detected by diagnostics.'); +console.log('This line is detected by diagnostics.'); +console.log('This line is detected by diagnostics.'); +console.log('This line is detected by diagnostics.'); +console.log('This line is detected by diagnostics.'); +console.log('This line is detected by diagnostics.'); +console.log('This line is detected by diagnostics.'); +console.log('This line is detected by diagnostics.'); +console.log('This line is detected by diagnostics.'); +console.log('This line is detected by diagnostics.'); +console.log('This line is detected by diagnostics.'); +console.log('This line is detected by diagnostics.'); +console.log('This line is detected by diagnostics.'); +console.log('This line is detected by diagnostics.'); +console.log('This line is detected by diagnostics.'); +console.log('This line is detected by diagnostics.'); +console.log('This line is detected by diagnostics.'); +console.log('This line is detected by diagnostics.'); +console.log('This line is detected by diagnostics.'); +console.log('This line is detected by diagnostics.'); +console.log('This line is detected by diagnostics.'); +console.log('This line is detected by diagnostics.'); +console.log('This line is detected by diagnostics.'); +console.log('This line is detected by diagnostics.'); +console.log('This line is detected by diagnostics.'); +console.log('This line is detected by diagnostics.'); +console.log('This line is detected by diagnostics.'); +console.log('This line is detected by diagnostics.'); +console.log('This line is detected by diagnostics.'); +console.log('This line is detected by diagnostics.'); +console.log('This line is detected by diagnostics.'); +console.log('This line is detected by diagnostics.'); +console.log('This line is detected by diagnostics.'); +console.log('This line is detected by diagnostics.'); +console.log('This line is detected by diagnostics.'); +console.log('This line is detected by diagnostics.'); +console.log('This line is detected by diagnostics.'); +console.log('This line is detected by diagnostics.'); +console.log('This line is detected by diagnostics.'); +console.log('This line is detected by diagnostics.'); +console.log('This line is detected by diagnostics.'); +console.log('This line is detected by diagnostics.'); +console.log('This line is detected by diagnostics.'); +console.log('This line is detected by diagnostics.'); +console.log('This line is detected by diagnostics.'); +console.log('This line is detected by diagnostics.'); +console.log('This line is detected by diagnostics.'); +console.log('This line is detected by diagnostics.'); diff --git a/testdata/error/format.js b/testdata/error/js/format.js similarity index 100% rename from testdata/error/format.js rename to testdata/error/js/format.js diff --git a/testdata/error/lint.js b/testdata/error/js/lint.js similarity index 100% rename from testdata/error/lint.js rename to testdata/error/js/lint.js diff --git a/testdata/error/format.ts b/testdata/error/ts/format.ts similarity index 100% rename from testdata/error/format.ts rename to testdata/error/ts/format.ts From 00ce33a9dd64fa545659ee675d635f6bf691c2e4 Mon Sep 17 00:00:00 2001 From: mongolyy Date: Tue, 23 Jan 2024 22:13:31 +0900 Subject: [PATCH 2/2] fix truncate pattern --- script.sh | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/script.sh b/script.sh index 8494ded..6d213d8 100755 --- a/script.sh +++ b/script.sh @@ -24,9 +24,7 @@ echo '::group:: Running Biome with reviewdog 🐶 ...' if [ "$INPUT_REPORTER" = "github-pr-review" ]; then # shellcheck disable=SC2086 "$(npm root)"/.bin/biome check --apply ${INPUT_BIOME_FLAGS} 2>&1 1>/dev/null | - sed 's/ *$//' | - sed -z 's/\n\n\([^\n]*│\)/\n\n ```\n\1/g' | - sed -z 's/\(│[^\n]*\)\n\n/\1\n ```\n\n/g' | + awk 'BEGIN { RS=""; ORS="\n\n" } { if (index($0, "│") > 0) { print " ```\n" $0 "\n ```" } else { print $0 } }' | reviewdog \ -efm="%-G%f ci ━%#" \ -efm="%-G%f lint ━%#" \ @@ -47,8 +45,7 @@ else # shellcheck disable=SC2086 "$(npm root)"/.bin/biome ci --max-diagnostics=30 ${INPUT_BIOME_FLAGS} 2>&1 1>/dev/null | sed 's/ *$//' | - sed -z 's/\n\n\([^\n]*│\)/\n\n ```\n\1/g' | - sed -z 's/\(│[^\n]*\)\n\n/\1\n ```\n\n/g' | + awk 'BEGIN { RS=""; ORS="\n\n" } { if (index($0, "│") > 0) { print " ```\n" $0 "\n ```" } else { print $0 } }' | reviewdog \ -efm="%-G%f ci ━%#" \ -efm="%-G%f lint ━%#" \