Skip to content

Commit

Permalink
rollback changes (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
elliottrabac authored Jun 12, 2024
1 parent 84cfd2f commit e8eacf4
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ if [[ "${SQLFLUFF_COMMAND:?}" == "lint" ]]; then
# Allow failures now, as reviewdog handles them
set +Eeuo pipefail
lint_results="sqlfluff-lint.json"
lint_results_rdjson="sqlfluff-lint.rdjson"
# shellcheck disable=SC2086,SC2046
sqlfluff lint \
--format json \
Expand All @@ -76,10 +75,13 @@ if [[ "${SQLFLUFF_COMMAND:?}" == "lint" ]]; then
$(if [[ "x${SQLFLUFF_TEMPLATER}" != "x" ]]; then echo "--templater ${SQLFLUFF_TEMPLATER}"; fi) \
$(if [[ "x${SQLFLUFF_DISABLE_NOQA}" != "x" ]]; then echo "--disable-noqa ${SQLFLUFF_DISABLE_NOQA}"; fi) \
$(if [[ "x${SQLFLUFF_DIALECT}" != "x" ]]; then echo "--dialect ${SQLFLUFF_DIALECT}"; fi) \
$changed_files | tail -n +2 | jq -r -f "${SCRIPT_DIR}/to-rdjson.jq" | tee > "$lint_results_rdjson"
$changed_files | tail -n +2 >> "$lint_results"

sqlfluff_exit_code=$?
cat "$lint_results_rdjson"
cat "$lint_results"

echo "name=sqlfluff-results::$(cat <"$lint_results" | jq -r -c '.')" >> $GITHUB_OUTPUT # Convert to a single line
echo "name=sqlfluff-exit-code::${sqlfluff_exit_code}" >> $GITHUB_OUTPUT

set -Eeuo pipefail
echo '::endgroup::'
Expand All @@ -88,6 +90,11 @@ if [[ "${SQLFLUFF_COMMAND:?}" == "lint" ]]; then
# Allow failures now, as reviewdog handles them
set +Eeuo pipefail

lint_results_rdjson="sqlfluff-lint.rdjson"
cat <"$lint_results" |
jq -r -f "${SCRIPT_DIR}/to-rdjson.jq" |
tee >"$lint_results_rdjson"

cat <"$lint_results_rdjson" |
reviewdog -f=rdjson \
-name="sqlfluff-lint" \
Expand Down

0 comments on commit e8eacf4

Please sign in to comment.