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 ━%#" \ 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