diff --git a/example/lint.sh b/example/lint.sh index a1aebb6..575eea8 100755 --- a/example/lint.sh +++ b/example/lint.sh @@ -83,25 +83,25 @@ bazel build ${args[@]} $@ # TODO: Maybe this could be hermetic with bazel run @aspect_bazel_lib//tools:jq or sth if [ $machine == "Windows" ]; then # jq on windows outputs CRLF which breaks this script. https://github.com/jqlang/jq/issues/92 - valid_outputs=$(jq --arg ext .txt --raw-output "$filter" "$buildevents" | tr -d '\r') + valid_reports=$(jq --arg ext .txt --raw-output "$filter" "$buildevents" | tr -d '\r') else - valid_outputs=$(jq --arg ext .txt --raw-output "$filter" "$buildevents") + valid_reports=$(jq --arg ext .txt --raw-output "$filter" "$buildevents") fi # Show the results. -while IFS= read -r output; do +while IFS= read -r report; do # Exclude coverage reports, and check if the output is empty. - if [[ "$output" == *coverage.dat ]] || [[ ! -s "$output" ]]; then + if [[ "$report" == *coverage.dat ]] || [[ ! -s "$report" ]]; then # Report is empty. No linting errors. continue fi - echo "From ${output}:" - cat "${output}" + echo "From ${report}:" + cat "${report}" echo -done <<<"$valid_outputs" +done <<<"$valid_reports" if [ -n "$fix" ]; then - valid_patches=$valid_outputs + valid_patches=$valid_reports while IFS= read -r patch; do # Exclude coverage, and check if the patch is empty. if [[ "$patch" == *coverage.dat ]] || [[ ! -s "$patch" ]]; then diff --git a/lint/eslint.bazel-formatter.js b/lint/eslint.bazel-formatter.js index b4266a5..d4ec9da 100644 --- a/lint/eslint.bazel-formatter.js +++ b/lint/eslint.bazel-formatter.js @@ -1,29 +1,7 @@ // Fork of 'compact' plugin that prints relative paths. // This allows an editor to navigate to the location of the lint warning even though we present // eslint with paths underneath a bazel sandbox folder. - -/** - * Vendored from https://github.com/eslint/eslint/blob/331cf62024b6c7ad4067c14c593f116576c3c861/lib/cli-engine/formatters/compact.js -Copyright OpenJS Foundation and other contributors, - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - */ +// from https://github.com/eslint/eslint/blob/331cf62024b6c7ad4067c14c593f116576c3c861/lib/cli-engine/formatters/compact.js const path = require("node:path"); /**