Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test the Action #119

Merged
merged 5 commits into from
May 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ jobs:
fail-fast: false
matrix:
sqlfluff:
- "2.0.7"
- "3.0.7"
extra_requirements_txt:
- "testdata/test_failed_dbt/extra_requirements-1.3.txt"
- "testdata/test_failed_dbt/extra_requirements-1.4.txt"
- "testdata/test_failed_dbt/extra_requirements-1.5.txt"
- "testdata/test_failed_dbt/extra_requirements-1.6.txt"
- "testdata/test_failed_dbt/extra_requirements-1.7.txt"
- "testdata/test_failed_dbt/extra_requirements-1.8.txt"
config:
- ".sqlfluff.bigquery"
- ".sqlfluff.postgres"
Expand All @@ -29,7 +29,7 @@ jobs:
id: lint-sql
with:
github_token: ${{ secrets.github_token }}
reporter: github-check
reporter: github-pr-review
sqlfluff_version: ${{ matrix.sqlfluff }}
sqlfluff_command: lint
templater: jinja
Expand Down Expand Up @@ -57,7 +57,6 @@ jobs:
fail-fast: false
matrix:
sqlfluff:
- "2.3.0"
- "3.0.7"
extra_requirements_txt:
- "testdata/test_failed_dbt/extra_requirements-1.6.txt"
Expand All @@ -75,7 +74,7 @@ jobs:
id: lint-sql
with:
github_token: ${{ secrets.github_token }}
reporter: github-check
reporter: github-pr-review
sqlfluff_version: ${{ matrix.sqlfluff }}
sqlfluff_command: fix
templater: jinja
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
setup-dev:
SQLFLUFF_VERSION=1.2.0 pip install --force-reinstall -r requirements/requirements.txt
SQLFLUFF_VERSION=3.0.7 python -m pip install --force-reinstall -r requirements/requirements.txt
pre-commit install

lint: lint-shell lint-json lint-docker
Expand Down
230 changes: 115 additions & 115 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@ git fetch --prune --unshallow --no-tags
SQL_FILE_PATTERN="${FILE_PATTERN:?}"
SOURCE_REFERENCE="origin/${GITHUB_PULL_REQUEST_BASE_REF:?}"
changed_files=$(git diff --name-only --no-color "$SOURCE_REFERENCE" "HEAD" -- "${SQLFLUFF_PATHS:?}" |
grep -e "${SQL_FILE_PATTERN:?}" |
xargs -I% bash -c 'if [[ -f "%" ]] ; then echo "%"; fi' || :)
grep -e "${SQL_FILE_PATTERN:?}" |
xargs -I% bash -c 'if [[ -f "%" ]] ; then echo "%"; fi' || :)
Comment on lines +22 to +23
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[shfmt] reported by reviewdog 🐶

Suggested change
grep -e "${SQL_FILE_PATTERN:?}" |
xargs -I% bash -c 'if [[ -f "%" ]] ; then echo "%"; fi' || :)
grep -e "${SQL_FILE_PATTERN:?}" |
xargs -I% bash -c 'if [[ -f "%" ]] ; then echo "%"; fi' || :)

echo "Changed files:"
echo "$changed_files"
# Halt the job
if [[ "${changed_files}" == "" ]]; then
echo "There is no changed files. The action doesn't scan files."
echo "name=sqlfluff-exit-code::0" >> $GITHUB_OUTPUT
echo "name=reviewdog-return-code::0" >> $GITHUB_OUTPUT
exit 0
if [[ ${changed_files} == "" ]]; then
echo "There is no changed files. The action doesn't scan files."
echo "name=sqlfluff-exit-code::0" >>$GITHUB_OUTPUT
echo "name=reviewdog-return-code::0" >>$GITHUB_OUTPUT
exit 0
Comment on lines +28 to +31
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[shfmt] reported by reviewdog 🐶

Suggested change
echo "There is no changed files. The action doesn't scan files."
echo "name=sqlfluff-exit-code::0" >>$GITHUB_OUTPUT
echo "name=reviewdog-return-code::0" >>$GITHUB_OUTPUT
exit 0
echo "There is no changed files. The action doesn't scan files."
echo "name=sqlfluff-exit-code::0" >>$GITHUB_OUTPUT
echo "name=reviewdog-return-code::0" >>$GITHUB_OUTPUT
exit 0

fi
echo '::endgroup::'

Expand All @@ -42,127 +42,127 @@ echo '::endgroup::'
# Install extra python modules
echo '::group:: Installing extra python modules'
if [[ "x${EXTRA_REQUIREMENTS_TXT}" != "x" ]]; then
pip install --no-cache-dir -r "${EXTRA_REQUIREMENTS_TXT}" --use-deprecated=legacy-resolver
# Make sure the installed modules
pip list
pip install --no-cache-dir -r "${EXTRA_REQUIREMENTS_TXT}" --use-deprecated=legacy-resolver
# Make sure the installed modules
pip list
Comment on lines +45 to +47
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[shfmt] reported by reviewdog 🐶

Suggested change
pip install --no-cache-dir -r "${EXTRA_REQUIREMENTS_TXT}" --use-deprecated=legacy-resolver
# Make sure the installed modules
pip list
pip install --no-cache-dir -r "${EXTRA_REQUIREMENTS_TXT}" --use-deprecated=legacy-resolver
# Make sure the installed modules
pip list

fi
echo '::endgroup::'

# Install dbt packages
echo '::group:: Installing dbt packages'
if [[ -f "${INPUT_WORKING_DIRECTORY}/packages.yml" ]]; then
default_dir="$(pwd)"
cd "$INPUT_WORKING_DIRECTORY"
dbt deps --profiles-dir "${SCRIPT_DIR}/resources/dummy_profiles"
cd "$default_dir"
default_dir="$(pwd)"
cd "$INPUT_WORKING_DIRECTORY"
dbt deps --profiles-dir "${SCRIPT_DIR}/resources/dummy_profiles"
cd "$default_dir"
Comment on lines +54 to +57
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[shfmt] reported by reviewdog 🐶

Suggested change
default_dir="$(pwd)"
cd "$INPUT_WORKING_DIRECTORY"
dbt deps --profiles-dir "${SCRIPT_DIR}/resources/dummy_profiles"
cd "$default_dir"
default_dir="$(pwd)"
cd "$INPUT_WORKING_DIRECTORY"
dbt deps --profiles-dir "${SCRIPT_DIR}/resources/dummy_profiles"
cd "$default_dir"

fi
echo '::endgroup::'

# Lint changed files if the mode is lint
if [[ "${SQLFLUFF_COMMAND:?}" == "lint" ]]; then
echo '::group:: Running sqlfluff 🐶 ...'
# Allow failures now, as reviewdog handles them
set +Eeuo pipefail
lint_results="sqlfluff-lint.json"
# shellcheck disable=SC2086,SC2046
sqlfluff lint \
--format json \
$(if [[ "x${SQLFLUFF_CONFIG}" != "x" ]]; then echo "--config ${SQLFLUFF_CONFIG}"; fi) \
$(if [[ "x${SQLFLUFF_DIALECT}" != "x" ]]; then echo "--dialect ${SQLFLUFF_DIALECT}"; fi) \
$(if [[ "x${SQLFLUFF_PROCESSES}" != "x" ]]; then echo "--processes ${SQLFLUFF_PROCESSES}"; fi) \
$(if [[ "x${SQLFLUFF_RULES}" != "x" ]]; then echo "--rules ${SQLFLUFF_RULES}"; fi) \
$(if [[ "x${SQLFLUFF_EXCLUDE_RULES}" != "x" ]]; then echo "--exclude-rules ${SQLFLUFF_EXCLUDE_RULES}"; fi) \
$(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 |
tee "$lint_results"
sqlfluff_exit_code=$?

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::'

echo '::group:: Running reviewdog 🐶 ...'
# 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" \
-reporter="${REVIEWDOG_REPORTER}" \
-filter-mode="${REVIEWDOG_FILTER_MODE}" \
-fail-on-error="${REVIEWDOG_FAIL_ON_ERROR}" \
-level="${REVIEWDOG_LEVEL}"
reviewdog_return_code="${PIPESTATUS[1]}"

echo "name=sqlfluff-results-rdjson::$(cat <"$lint_results_rdjson" | jq -r -c '.')" >> $GITHUB_OUTPUT # Convert to a single line
echo "name=reviewdog-return-code::${reviewdog_return_code}" >> $GITHUB_OUTPUT

set -Eeuo pipefail
echo '::endgroup::'

exit $sqlfluff_exit_code
if [[ ${SQLFLUFF_COMMAND:?} == "lint" ]]; then
echo '::group:: Running sqlfluff 🐶 ...'
# Allow failures now, as reviewdog handles them
set +Eeuo pipefail
lint_results="sqlfluff-lint.json"
# shellcheck disable=SC2086,SC2046
sqlfluff lint \
--format json \
$(if [[ "x${SQLFLUFF_CONFIG}" != "x" ]]; then echo "--config ${SQLFLUFF_CONFIG}"; fi) \
$(if [[ "x${SQLFLUFF_DIALECT}" != "x" ]]; then echo "--dialect ${SQLFLUFF_DIALECT}"; fi) \
$(if [[ "x${SQLFLUFF_PROCESSES}" != "x" ]]; then echo "--processes ${SQLFLUFF_PROCESSES}"; fi) \
$(if [[ "x${SQLFLUFF_RULES}" != "x" ]]; then echo "--rules ${SQLFLUFF_RULES}"; fi) \
$(if [[ "x${SQLFLUFF_EXCLUDE_RULES}" != "x" ]]; then echo "--exclude-rules ${SQLFLUFF_EXCLUDE_RULES}"; fi) \
$(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 |
tee "$lint_results"
sqlfluff_exit_code=$?

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::'

echo '::group:: Running reviewdog 🐶 ...'
# 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" \
-reporter="${REVIEWDOG_REPORTER}" \
-filter-mode="${REVIEWDOG_FILTER_MODE}" \
-fail-on-error="${REVIEWDOG_FAIL_ON_ERROR}" \
-level="${REVIEWDOG_LEVEL}"
reviewdog_return_code="${PIPESTATUS[1]}"

echo "name=sqlfluff-results-rdjson::$(cat <"$lint_results_rdjson" | jq -r -c '.')" >>$GITHUB_OUTPUT # Convert to a single line
echo "name=reviewdog-return-code::${reviewdog_return_code}" >>$GITHUB_OUTPUT

set -Eeuo pipefail
echo '::endgroup::'

exit $sqlfluff_exit_code
Comment on lines +63 to +112
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[shfmt] reported by reviewdog 🐶

Suggested change
echo '::group:: Running sqlfluff 🐶 ...'
# Allow failures now, as reviewdog handles them
set +Eeuo pipefail
lint_results="sqlfluff-lint.json"
# shellcheck disable=SC2086,SC2046
sqlfluff lint \
--format json \
$(if [[ "x${SQLFLUFF_CONFIG}" != "x" ]]; then echo "--config ${SQLFLUFF_CONFIG}"; fi) \
$(if [[ "x${SQLFLUFF_DIALECT}" != "x" ]]; then echo "--dialect ${SQLFLUFF_DIALECT}"; fi) \
$(if [[ "x${SQLFLUFF_PROCESSES}" != "x" ]]; then echo "--processes ${SQLFLUFF_PROCESSES}"; fi) \
$(if [[ "x${SQLFLUFF_RULES}" != "x" ]]; then echo "--rules ${SQLFLUFF_RULES}"; fi) \
$(if [[ "x${SQLFLUFF_EXCLUDE_RULES}" != "x" ]]; then echo "--exclude-rules ${SQLFLUFF_EXCLUDE_RULES}"; fi) \
$(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 |
tee "$lint_results"
sqlfluff_exit_code=$?
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::'
echo '::group:: Running reviewdog 🐶 ...'
# 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" \
-reporter="${REVIEWDOG_REPORTER}" \
-filter-mode="${REVIEWDOG_FILTER_MODE}" \
-fail-on-error="${REVIEWDOG_FAIL_ON_ERROR}" \
-level="${REVIEWDOG_LEVEL}"
reviewdog_return_code="${PIPESTATUS[1]}"
echo "name=sqlfluff-results-rdjson::$(cat <"$lint_results_rdjson" | jq -r -c '.')" >>$GITHUB_OUTPUT # Convert to a single line
echo "name=reviewdog-return-code::${reviewdog_return_code}" >>$GITHUB_OUTPUT
set -Eeuo pipefail
echo '::endgroup::'
exit $sqlfluff_exit_code
echo '::group:: Running sqlfluff 🐶 ...'
# Allow failures now, as reviewdog handles them
set +Eeuo pipefail
lint_results="sqlfluff-lint.json"
# shellcheck disable=SC2086,SC2046
sqlfluff lint \
--format json \
$(if [[ "x${SQLFLUFF_CONFIG}" != "x" ]]; then echo "--config ${SQLFLUFF_CONFIG}"; fi) \
$(if [[ "x${SQLFLUFF_DIALECT}" != "x" ]]; then echo "--dialect ${SQLFLUFF_DIALECT}"; fi) \
$(if [[ "x${SQLFLUFF_PROCESSES}" != "x" ]]; then echo "--processes ${SQLFLUFF_PROCESSES}"; fi) \
$(if [[ "x${SQLFLUFF_RULES}" != "x" ]]; then echo "--rules ${SQLFLUFF_RULES}"; fi) \
$(if [[ "x${SQLFLUFF_EXCLUDE_RULES}" != "x" ]]; then echo "--exclude-rules ${SQLFLUFF_EXCLUDE_RULES}"; fi) \
$(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 |
tee "$lint_results"
sqlfluff_exit_code=$?
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::'
echo '::group:: Running reviewdog 🐶 ...'
# 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" \
-reporter="${REVIEWDOG_REPORTER}" \
-filter-mode="${REVIEWDOG_FILTER_MODE}" \
-fail-on-error="${REVIEWDOG_FAIL_ON_ERROR}" \
-level="${REVIEWDOG_LEVEL}"
reviewdog_return_code="${PIPESTATUS[1]}"
echo "name=sqlfluff-results-rdjson::$(cat <"$lint_results_rdjson" | jq -r -c '.')" >>$GITHUB_OUTPUT # Convert to a single line
echo "name=reviewdog-return-code::${reviewdog_return_code}" >>$GITHUB_OUTPUT
set -Eeuo pipefail
echo '::endgroup::'
exit $sqlfluff_exit_code

# END OF lint

# Format changed files if the mode is fix
elif [[ "${SQLFLUFF_COMMAND}" == "fix" ]]; then
echo '::group:: Running sqlfluff 🐶 ...'
# Allow failures now, as reviewdog handles them
set +Eeuo pipefail
# shellcheck disable=SC2086,SC2046
sqlfluff fix --force \
$(if [[ "x${SQLFLUFF_CONFIG}" != "x" ]]; then echo "--config ${SQLFLUFF_CONFIG}"; fi) \
$(if [[ "x${SQLFLUFF_DIALECT}" != "x" ]]; then echo "--dialect ${SQLFLUFF_DIALECT}"; fi) \
$(if [[ "x${SQLFLUFF_PROCESSES}" != "x" ]]; then echo "--processes ${SQLFLUFF_PROCESSES}"; fi) \
$(if [[ "x${SQLFLUFF_RULES}" != "x" ]]; then echo "--rules ${SQLFLUFF_RULES}"; fi) \
$(if [[ "x${SQLFLUFF_EXCLUDE_RULES}" != "x" ]]; then echo "--exclude-rules ${SQLFLUFF_EXCLUDE_RULES}"; fi) \
$(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
sqlfluff_exit_code=$?
echo "name=sqlfluff-exit-code::${sqlfluff_exit_code}" >> $GITHUB_OUTPUT

set -Eeuo pipefail
echo '::endgroup::'

# SEE https://github.com/reviewdog/action-suggester/blob/master/script.sh
echo '::group:: Running reviewdog 🐶 ...'
# Allow failures now, as reviewdog handles them
set +Eeuo pipefail

# Suggest the differences
temp_file=$(mktemp)
git diff | tee "${temp_file}"
git stash -u

# shellcheck disable=SC2034
reviewdog \
-name="sqlfluff-fix" \
-f=diff \
-f.diff.strip=1 \
-reporter="${REVIEWDOG_REPORTER}" \
-filter-mode="${REVIEWDOG_FILTER_MODE}" \
-fail-on-error="${REVIEWDOG_FAIL_ON_ERROR}" \
-level="${REVIEWDOG_LEVEL}" <"${temp_file}" || exit_code=$?

# Clean up
git stash drop || true
set -Eeuo pipefail
echo '::endgroup::'

exit $sqlfluff_exit_code
# exit $exit_code
elif [[ ${SQLFLUFF_COMMAND} == "fix" ]]; then
echo '::group:: Running sqlfluff 🐶 ...'
# Allow failures now, as reviewdog handles them
set +Eeuo pipefail
# shellcheck disable=SC2086,SC2046
sqlfluff fix \
$(if [[ "x${SQLFLUFF_CONFIG}" != "x" ]]; then echo "--config ${SQLFLUFF_CONFIG}"; fi) \
$(if [[ "x${SQLFLUFF_DIALECT}" != "x" ]]; then echo "--dialect ${SQLFLUFF_DIALECT}"; fi) \
$(if [[ "x${SQLFLUFF_PROCESSES}" != "x" ]]; then echo "--processes ${SQLFLUFF_PROCESSES}"; fi) \
$(if [[ "x${SQLFLUFF_RULES}" != "x" ]]; then echo "--rules ${SQLFLUFF_RULES}"; fi) \
$(if [[ "x${SQLFLUFF_EXCLUDE_RULES}" != "x" ]]; then echo "--exclude-rules ${SQLFLUFF_EXCLUDE_RULES}"; fi) \
$(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
sqlfluff_exit_code=$?
echo "name=sqlfluff-exit-code::${sqlfluff_exit_code}" >>$GITHUB_OUTPUT

set -Eeuo pipefail
echo '::endgroup::'

# SEE https://github.com/reviewdog/action-suggester/blob/master/script.sh
echo '::group:: Running reviewdog 🐶 ...'
# Allow failures now, as reviewdog handles them
set +Eeuo pipefail

# Suggest the differences
temp_file=$(mktemp)
git diff | tee "${temp_file}"
git stash -u

# shellcheck disable=SC2034
reviewdog \
-name="sqlfluff-fix" \
-f=diff \
-f.diff.strip=1 \
-reporter="${REVIEWDOG_REPORTER}" \
-filter-mode="${REVIEWDOG_FILTER_MODE}" \
-fail-on-error="${REVIEWDOG_FAIL_ON_ERROR}" \
-level="${REVIEWDOG_LEVEL}" <"${temp_file}" || exit_code=$?

# Clean up
git stash drop || true
set -Eeuo pipefail
echo '::endgroup::'

exit $sqlfluff_exit_code
# exit $exit_code
Comment on lines +117 to +163
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[shfmt] reported by reviewdog 🐶

Suggested change
echo '::group:: Running sqlfluff 🐶 ...'
# Allow failures now, as reviewdog handles them
set +Eeuo pipefail
# shellcheck disable=SC2086,SC2046
sqlfluff fix \
$(if [[ "x${SQLFLUFF_CONFIG}" != "x" ]]; then echo "--config ${SQLFLUFF_CONFIG}"; fi) \
$(if [[ "x${SQLFLUFF_DIALECT}" != "x" ]]; then echo "--dialect ${SQLFLUFF_DIALECT}"; fi) \
$(if [[ "x${SQLFLUFF_PROCESSES}" != "x" ]]; then echo "--processes ${SQLFLUFF_PROCESSES}"; fi) \
$(if [[ "x${SQLFLUFF_RULES}" != "x" ]]; then echo "--rules ${SQLFLUFF_RULES}"; fi) \
$(if [[ "x${SQLFLUFF_EXCLUDE_RULES}" != "x" ]]; then echo "--exclude-rules ${SQLFLUFF_EXCLUDE_RULES}"; fi) \
$(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
sqlfluff_exit_code=$?
echo "name=sqlfluff-exit-code::${sqlfluff_exit_code}" >>$GITHUB_OUTPUT
set -Eeuo pipefail
echo '::endgroup::'
# SEE https://github.com/reviewdog/action-suggester/blob/master/script.sh
echo '::group:: Running reviewdog 🐶 ...'
# Allow failures now, as reviewdog handles them
set +Eeuo pipefail
# Suggest the differences
temp_file=$(mktemp)
git diff | tee "${temp_file}"
git stash -u
# shellcheck disable=SC2034
reviewdog \
-name="sqlfluff-fix" \
-f=diff \
-f.diff.strip=1 \
-reporter="${REVIEWDOG_REPORTER}" \
-filter-mode="${REVIEWDOG_FILTER_MODE}" \
-fail-on-error="${REVIEWDOG_FAIL_ON_ERROR}" \
-level="${REVIEWDOG_LEVEL}" <"${temp_file}" || exit_code=$?
# Clean up
git stash drop || true
set -Eeuo pipefail
echo '::endgroup::'
exit $sqlfluff_exit_code
# exit $exit_code
echo '::group:: Running sqlfluff 🐶 ...'
# Allow failures now, as reviewdog handles them
set +Eeuo pipefail
# shellcheck disable=SC2086,SC2046
sqlfluff fix \
$(if [[ "x${SQLFLUFF_CONFIG}" != "x" ]]; then echo "--config ${SQLFLUFF_CONFIG}"; fi) \
$(if [[ "x${SQLFLUFF_DIALECT}" != "x" ]]; then echo "--dialect ${SQLFLUFF_DIALECT}"; fi) \
$(if [[ "x${SQLFLUFF_PROCESSES}" != "x" ]]; then echo "--processes ${SQLFLUFF_PROCESSES}"; fi) \
$(if [[ "x${SQLFLUFF_RULES}" != "x" ]]; then echo "--rules ${SQLFLUFF_RULES}"; fi) \
$(if [[ "x${SQLFLUFF_EXCLUDE_RULES}" != "x" ]]; then echo "--exclude-rules ${SQLFLUFF_EXCLUDE_RULES}"; fi) \
$(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
sqlfluff_exit_code=$?
echo "name=sqlfluff-exit-code::${sqlfluff_exit_code}" >>$GITHUB_OUTPUT
set -Eeuo pipefail
echo '::endgroup::'
# SEE https://github.com/reviewdog/action-suggester/blob/master/script.sh
echo '::group:: Running reviewdog 🐶 ...'
# Allow failures now, as reviewdog handles them
set +Eeuo pipefail
# Suggest the differences
temp_file=$(mktemp)
git diff | tee "${temp_file}"
git stash -u
# shellcheck disable=SC2034
reviewdog \
-name="sqlfluff-fix" \
-f=diff \
-f.diff.strip=1 \
-reporter="${REVIEWDOG_REPORTER}" \
-filter-mode="${REVIEWDOG_FILTER_MODE}" \
-fail-on-error="${REVIEWDOG_FAIL_ON_ERROR}" \
-level="${REVIEWDOG_LEVEL}" <"${temp_file}" || exit_code=$?
# Clean up
git stash drop || true
set -Eeuo pipefail
echo '::endgroup::'
exit $sqlfluff_exit_code
# exit $exit_code

# END OF fix
else
echo 'ERROR: SQLFLUFF_COMMAND must be one of lint and fix'
exit 1
echo 'ERROR: SQLFLUFF_COMMAND must be one of lint and fix'
exit 1
Comment on lines +166 to +167
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[shfmt] reported by reviewdog 🐶

Suggested change
echo 'ERROR: SQLFLUFF_COMMAND must be one of lint and fix'
exit 1
echo 'ERROR: SQLFLUFF_COMMAND must be one of lint and fix'
exit 1

fi
1 change: 1 addition & 0 deletions testdata/test_failed_dbt/models/staging/staging_02.sql
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{{

Check warning on line 1 in testdata/test_failed_dbt/models/staging/staging_02.sql

View workflow job for this annotation

GitHub Actions / runner / sqlfluff (github-check) (3.0.7, testdata/test_failed_dbt/extra_requirements-1.6.txt, .sq...

[sqlfluff-lint] reported by reviewdog 🐶 Select targets should be on a new line unless there is only one select target. Raw Output: message:"Select targets should be on a new line unless there is only one select target." location:{path:"testdata/test_failed_dbt/models/staging/staging_02.sql" range:{start:{}}} severity:WARNING source:{name:"sqlfluff" url:"https://github.com/sqlfluff/sqlfluff"} code:{value:"LT09" url:"https://docs.sqlfluff.com/en/stable/rules.html#sqlfluff.core.rules.Rule_LT09"}

Check warning on line 1 in testdata/test_failed_dbt/models/staging/staging_02.sql

View workflow job for this annotation

GitHub Actions / runner / sqlfluff (github-check) (3.0.7, testdata/test_failed_dbt/extra_requirements-1.6.txt, .sq...

[sqlfluff-lint] reported by reviewdog 🐶 Expected line break and no indent before '2'. Raw Output: message:"Expected line break and no indent before '2'." location:{path:"testdata/test_failed_dbt/models/staging/staging_02.sql" range:{start:{}}} severity:WARNING source:{name:"sqlfluff" url:"https://github.com/sqlfluff/sqlfluff"} code:{value:"LT02" url:"https://docs.sqlfluff.com/en/stable/rules.html#sqlfluff.core.rules.Rule_LT02"}

Check warning on line 1 in testdata/test_failed_dbt/models/staging/staging_02.sql

View workflow job for this annotation

GitHub Actions / runner / sqlfluff (github-check) (3.0.7, testdata/test_failed_dbt/extra_requirements-1.6.txt, .sq...

[sqlfluff-lint] reported by reviewdog 🐶 Line 5, Position 7: Found unparsable section: '2 3' Raw Output: message:"Line 5, Position 7: Found unparsable section: '2 3'" location:{path:"testdata/test_failed_dbt/models/staging/staging_02.sql" range:{start:{}}} severity:WARNING source:{name:"sqlfluff" url:"https://github.com/sqlfluff/sqlfluff"} code:{value:"PRS" url:"https://docs.sqlfluff.com/en/stable/rules.html#sqlfluff.core.rules.Rule_PRS"}

Check warning on line 1 in testdata/test_failed_dbt/models/staging/staging_02.sql

View workflow job for this annotation

GitHub Actions / runner / sqlfluff (github-check) (3.0.7, testdata/test_failed_dbt/extra_requirements-1.6.txt, .sq...

[sqlfluff-lint] reported by reviewdog 🐶 Select targets should be on a new line unless there is only one select target. Raw Output: message:"Select targets should be on a new line unless there is only one select target." location:{path:"testdata/test_failed_dbt/models/staging/staging_02.sql" range:{start:{}}} severity:WARNING source:{name:"sqlfluff" url:"https://github.com/sqlfluff/sqlfluff"} code:{value:"LT09" url:"https://docs.sqlfluff.com/en/stable/rules.html#sqlfluff.core.rules.Rule_LT09"}

Check warning on line 1 in testdata/test_failed_dbt/models/staging/staging_02.sql

View workflow job for this annotation

GitHub Actions / runner / sqlfluff (github-check) (3.0.7, testdata/test_failed_dbt/extra_requirements-1.6.txt, .sq...

[sqlfluff-lint] reported by reviewdog 🐶 Expected line break and no indent before '2'. Raw Output: message:"Expected line break and no indent before '2'." location:{path:"testdata/test_failed_dbt/models/staging/staging_02.sql" range:{start:{}}} severity:WARNING source:{name:"sqlfluff" url:"https://github.com/sqlfluff/sqlfluff"} code:{value:"LT02" url:"https://docs.sqlfluff.com/en/stable/rules.html#sqlfluff.core.rules.Rule_LT02"}

Check warning on line 1 in testdata/test_failed_dbt/models/staging/staging_02.sql

View workflow job for this annotation

GitHub Actions / runner / sqlfluff (github-check) (3.0.7, testdata/test_failed_dbt/extra_requirements-1.6.txt, .sq...

[sqlfluff-lint] reported by reviewdog 🐶 Line 5, Position 7: Found unparsable section: '2 3' Raw Output: message:"Line 5, Position 7: Found unparsable section: '2 3'" location:{path:"testdata/test_failed_dbt/models/staging/staging_02.sql" range:{start:{}}} severity:WARNING source:{name:"sqlfluff" url:"https://github.com/sqlfluff/sqlfluff"} code:{value:"PRS" url:"https://docs.sqlfluff.com/en/stable/rules.html#sqlfluff.core.rules.Rule_PRS"}

Check warning on line 1 in testdata/test_failed_dbt/models/staging/staging_02.sql

View workflow job for this annotation

GitHub Actions / runner / sqlfluff (github-check) (3.0.7, testdata/test_failed_dbt/extra_requirements-1.6.txt, .sq...

[sqlfluff-lint] reported by reviewdog 🐶 Select targets should be on a new line unless there is only one select target. Raw Output: message:"Select targets should be on a new line unless there is only one select target." location:{path:"testdata/test_failed_dbt/models/staging/staging_02.sql" range:{start:{}}} severity:WARNING source:{name:"sqlfluff" url:"https://github.com/sqlfluff/sqlfluff"} code:{value:"LT09" url:"https://docs.sqlfluff.com/en/stable/rules.html#sqlfluff.core.rules.Rule_LT09"}

Check warning on line 1 in testdata/test_failed_dbt/models/staging/staging_02.sql

View workflow job for this annotation

GitHub Actions / runner / sqlfluff (github-check) (3.0.7, testdata/test_failed_dbt/extra_requirements-1.6.txt, .sq...

[sqlfluff-lint] reported by reviewdog 🐶 Expected line break and no indent before '2'. Raw Output: message:"Expected line break and no indent before '2'." location:{path:"testdata/test_failed_dbt/models/staging/staging_02.sql" range:{start:{}}} severity:WARNING source:{name:"sqlfluff" url:"https://github.com/sqlfluff/sqlfluff"} code:{value:"LT02" url:"https://docs.sqlfluff.com/en/stable/rules.html#sqlfluff.core.rules.Rule_LT02"}

Check warning on line 1 in testdata/test_failed_dbt/models/staging/staging_02.sql

View workflow job for this annotation

GitHub Actions / runner / sqlfluff (github-check) (3.0.7, testdata/test_failed_dbt/extra_requirements-1.6.txt, .sq...

[sqlfluff-lint] reported by reviewdog 🐶 Line 5, Position 7: Found unparsable section: '2 3' Raw Output: message:"Line 5, Position 7: Found unparsable section: '2 3'" location:{path:"testdata/test_failed_dbt/models/staging/staging_02.sql" range:{start:{}}} severity:WARNING source:{name:"sqlfluff" url:"https://github.com/sqlfluff/sqlfluff"} code:{value:"PRS" url:"https://docs.sqlfluff.com/en/stable/rules.html#sqlfluff.core.rules.Rule_PRS"}

Check warning on line 1 in testdata/test_failed_dbt/models/staging/staging_02.sql

View workflow job for this annotation

GitHub Actions / runner / sqlfluff (github-check) (3.0.7, testdata/test_failed_dbt/extra_requirements-1.6.txt, .sq...

[sqlfluff-lint] reported by reviewdog 🐶 Select targets should be on a new line unless there is only one select target. Raw Output: message:"Select targets should be on a new line unless there is only one select target." location:{path:"testdata/test_failed_dbt/models/staging/staging_02.sql" range:{start:{}}} severity:WARNING source:{name:"sqlfluff" url:"https://github.com/sqlfluff/sqlfluff"} code:{value:"LT09" url:"https://docs.sqlfluff.com/en/stable/rules.html#sqlfluff.core.rules.Rule_LT09"}

Check warning on line 1 in testdata/test_failed_dbt/models/staging/staging_02.sql

View workflow job for this annotation

GitHub Actions / runner / sqlfluff (github-check) (3.0.7, testdata/test_failed_dbt/extra_requirements-1.6.txt, .sq...

[sqlfluff-lint] reported by reviewdog 🐶 Expected line break and no indent before '2'. Raw Output: message:"Expected line break and no indent before '2'." location:{path:"testdata/test_failed_dbt/models/staging/staging_02.sql" range:{start:{}}} severity:WARNING source:{name:"sqlfluff" url:"https://github.com/sqlfluff/sqlfluff"} code:{value:"LT02" url:"https://docs.sqlfluff.com/en/stable/rules.html#sqlfluff.core.rules.Rule_LT02"}

Check warning on line 1 in testdata/test_failed_dbt/models/staging/staging_02.sql

View workflow job for this annotation

GitHub Actions / runner / sqlfluff (github-check) (3.0.7, testdata/test_failed_dbt/extra_requirements-1.6.txt, .sq...

[sqlfluff-lint] reported by reviewdog 🐶 Line 5, Position 7: Found unparsable section: '2 3' Raw Output: message:"Line 5, Position 7: Found unparsable section: '2 3'" location:{path:"testdata/test_failed_dbt/models/staging/staging_02.sql" range:{start:{}}} severity:WARNING source:{name:"sqlfluff" url:"https://github.com/sqlfluff/sqlfluff"} code:{value:"PRS" url:"https://docs.sqlfluff.com/en/stable/rules.html#sqlfluff.core.rules.Rule_PRS"}

Check warning on line 1 in testdata/test_failed_dbt/models/staging/staging_02.sql

View workflow job for this annotation

GitHub Actions / runner / sqlfluff (github-check) (3.0.7, testdata/test_failed_dbt/extra_requirements-1.6.txt, .sq...

[sqlfluff-lint] reported by reviewdog 🐶 Select targets should be on a new line unless there is only one select target. Raw Output: message:"Select targets should be on a new line unless there is only one select target." location:{path:"testdata/test_failed_dbt/models/staging/staging_02.sql" range:{start:{}}} severity:WARNING source:{name:"sqlfluff" url:"https://github.com/sqlfluff/sqlfluff"} code:{value:"LT09" url:"https://docs.sqlfluff.com/en/stable/rules.html#sqlfluff.core.rules.Rule_LT09"}

Check warning on line 1 in testdata/test_failed_dbt/models/staging/staging_02.sql

View workflow job for this annotation

GitHub Actions / runner / sqlfluff (github-check) (3.0.7, testdata/test_failed_dbt/extra_requirements-1.6.txt, .sq...

[sqlfluff-lint] reported by reviewdog 🐶 Expected line break and no indent before '2'. Raw Output: message:"Expected line break and no indent before '2'." location:{path:"testdata/test_failed_dbt/models/staging/staging_02.sql" range:{start:{}}} severity:WARNING source:{name:"sqlfluff" url:"https://github.com/sqlfluff/sqlfluff"} code:{value:"LT02" url:"https://docs.sqlfluff.com/en/stable/rules.html#sqlfluff.core.rules.Rule_LT02"}

Check warning on line 1 in testdata/test_failed_dbt/models/staging/staging_02.sql

View workflow job for this annotation

GitHub Actions / runner / sqlfluff (github-check) (3.0.7, testdata/test_failed_dbt/extra_requirements-1.6.txt, .sq...

[sqlfluff-lint] reported by reviewdog 🐶 Line 5, Position 7: Found unparsable section: '2 3' Raw Output: message:"Line 5, Position 7: Found unparsable section: '2 3'" location:{path:"testdata/test_failed_dbt/models/staging/staging_02.sql" range:{start:{}}} severity:WARNING source:{name:"sqlfluff" url:"https://github.com/sqlfluff/sqlfluff"} code:{value:"PRS" url:"https://docs.sqlfluff.com/en/stable/rules.html#sqlfluff.core.rules.Rule_PRS"}

Check warning on line 1 in testdata/test_failed_dbt/models/staging/staging_02.sql

View workflow job for this annotation

GitHub Actions / runner / sqlfluff (github-check) (3.0.7, testdata/test_failed_dbt/extra_requirements-1.7.txt, .sq...

[sqlfluff-lint] reported by reviewdog 🐶 Select targets should be on a new line unless there is only one select target. Raw Output: message:"Select targets should be on a new line unless there is only one select target." location:{path:"testdata/test_failed_dbt/models/staging/staging_02.sql" range:{start:{}}} severity:WARNING source:{name:"sqlfluff" url:"https://github.com/sqlfluff/sqlfluff"} code:{value:"LT09" url:"https://docs.sqlfluff.com/en/stable/rules.html#sqlfluff.core.rules.Rule_LT09"}

Check warning on line 1 in testdata/test_failed_dbt/models/staging/staging_02.sql

View workflow job for this annotation

GitHub Actions / runner / sqlfluff (github-check) (3.0.7, testdata/test_failed_dbt/extra_requirements-1.7.txt, .sq...

[sqlfluff-lint] reported by reviewdog 🐶 Expected line break and no indent before '2'. Raw Output: message:"Expected line break and no indent before '2'." location:{path:"testdata/test_failed_dbt/models/staging/staging_02.sql" range:{start:{}}} severity:WARNING source:{name:"sqlfluff" url:"https://github.com/sqlfluff/sqlfluff"} code:{value:"LT02" url:"https://docs.sqlfluff.com/en/stable/rules.html#sqlfluff.core.rules.Rule_LT02"}

Check warning on line 1 in testdata/test_failed_dbt/models/staging/staging_02.sql

View workflow job for this annotation

GitHub Actions / runner / sqlfluff (github-check) (3.0.7, testdata/test_failed_dbt/extra_requirements-1.7.txt, .sq...

[sqlfluff-lint] reported by reviewdog 🐶 Line 5, Position 7: Found unparsable section: '2 3' Raw Output: message:"Line 5, Position 7: Found unparsable section: '2 3'" location:{path:"testdata/test_failed_dbt/models/staging/staging_02.sql" range:{start:{}}} severity:WARNING source:{name:"sqlfluff" url:"https://github.com/sqlfluff/sqlfluff"} code:{value:"PRS" url:"https://docs.sqlfluff.com/en/stable/rules.html#sqlfluff.core.rules.Rule_PRS"}

Check warning on line 1 in testdata/test_failed_dbt/models/staging/staging_02.sql

View workflow job for this annotation

GitHub Actions / runner / sqlfluff (github-check) (3.0.7, testdata/test_failed_dbt/extra_requirements-1.7.txt, .sq...

[sqlfluff-lint] reported by reviewdog 🐶 Select targets should be on a new line unless there is only one select target. Raw Output: message:"Select targets should be on a new line unless there is only one select target." location:{path:"testdata/test_failed_dbt/models/staging/staging_02.sql" range:{start:{}}} severity:WARNING source:{name:"sqlfluff" url:"https://github.com/sqlfluff/sqlfluff"} code:{value:"LT09" url:"https://docs.sqlfluff.com/en/stable/rules.html#sqlfluff.core.rules.Rule_LT09"}

Check warning on line 1 in testdata/test_failed_dbt/models/staging/staging_02.sql

View workflow job for this annotation

GitHub Actions / runner / sqlfluff (github-check) (3.0.7, testdata/test_failed_dbt/extra_requirements-1.7.txt, .sq...

[sqlfluff-lint] reported by reviewdog 🐶 Expected line break and no indent before '2'. Raw Output: message:"Expected line break and no indent before '2'." location:{path:"testdata/test_failed_dbt/models/staging/staging_02.sql" range:{start:{}}} severity:WARNING source:{name:"sqlfluff" url:"https://github.com/sqlfluff/sqlfluff"} code:{value:"LT02" url:"https://docs.sqlfluff.com/en/stable/rules.html#sqlfluff.core.rules.Rule_LT02"}

Check warning on line 1 in testdata/test_failed_dbt/models/staging/staging_02.sql

View workflow job for this annotation

GitHub Actions / runner / sqlfluff (github-check) (3.0.7, testdata/test_failed_dbt/extra_requirements-1.7.txt, .sq...

[sqlfluff-lint] reported by reviewdog 🐶 Line 5, Position 7: Found unparsable section: '2 3' Raw Output: message:"Line 5, Position 7: Found unparsable section: '2 3'" location:{path:"testdata/test_failed_dbt/models/staging/staging_02.sql" range:{start:{}}} severity:WARNING source:{name:"sqlfluff" url:"https://github.com/sqlfluff/sqlfluff"} code:{value:"PRS" url:"https://docs.sqlfluff.com/en/stable/rules.html#sqlfluff.core.rules.Rule_PRS"}

Check warning on line 1 in testdata/test_failed_dbt/models/staging/staging_02.sql

View workflow job for this annotation

GitHub Actions / runner / sqlfluff (github-check) (3.0.7, testdata/test_failed_dbt/extra_requirements-1.7.txt, .sq...

[sqlfluff-lint] reported by reviewdog 🐶 Select targets should be on a new line unless there is only one select target. Raw Output: message:"Select targets should be on a new line unless there is only one select target." location:{path:"testdata/test_failed_dbt/models/staging/staging_02.sql" range:{start:{}}} severity:WARNING source:{name:"sqlfluff" url:"https://github.com/sqlfluff/sqlfluff"} code:{value:"LT09" url:"https://docs.sqlfluff.com/en/stable/rules.html#sqlfluff.core.rules.Rule_LT09"}

Check warning on line 1 in testdata/test_failed_dbt/models/staging/staging_02.sql

View workflow job for this annotation

GitHub Actions / runner / sqlfluff (github-check) (3.0.7, testdata/test_failed_dbt/extra_requirements-1.7.txt, .sq...

[sqlfluff-lint] reported by reviewdog 🐶 Expected line break and no indent before '2'. Raw Output: message:"Expected line break and no indent before '2'." location:{path:"testdata/test_failed_dbt/models/staging/staging_02.sql" range:{start:{}}} severity:WARNING source:{name:"sqlfluff" url:"https://github.com/sqlfluff/sqlfluff"} code:{value:"LT02" url:"https://docs.sqlfluff.com/en/stable/rules.html#sqlfluff.core.rules.Rule_LT02"}

Check warning on line 1 in testdata/test_failed_dbt/models/staging/staging_02.sql

View workflow job for this annotation

GitHub Actions / runner / sqlfluff (github-check) (3.0.7, testdata/test_failed_dbt/extra_requirements-1.7.txt, .sq...

[sqlfluff-lint] reported by reviewdog 🐶 Line 5, Position 7: Found unparsable section: '2 3' Raw Output: message:"Line 5, Position 7: Found unparsable section: '2 3'" location:{path:"testdata/test_failed_dbt/models/staging/staging_02.sql" range:{start:{}}} severity:WARNING source:{name:"sqlfluff" url:"https://github.com/sqlfluff/sqlfluff"} code:{value:"PRS" url:"https://docs.sqlfluff.com/en/stable/rules.html#sqlfluff.core.rules.Rule_PRS"}

Check warning on line 1 in testdata/test_failed_dbt/models/staging/staging_02.sql

View workflow job for this annotation

GitHub Actions / runner / sqlfluff (github-check) (3.0.7, testdata/test_failed_dbt/extra_requirements-1.7.txt, .sq...

[sqlfluff-lint] reported by reviewdog 🐶 Select targets should be on a new line unless there is only one select target. Raw Output: message:"Select targets should be on a new line unless there is only one select target." location:{path:"testdata/test_failed_dbt/models/staging/staging_02.sql" range:{start:{}}} severity:WARNING source:{name:"sqlfluff" url:"https://github.com/sqlfluff/sqlfluff"} code:{value:"LT09" url:"https://docs.sqlfluff.com/en/stable/rules.html#sqlfluff.core.rules.Rule_LT09"}

Check warning on line 1 in testdata/test_failed_dbt/models/staging/staging_02.sql

View workflow job for this annotation

GitHub Actions / runner / sqlfluff (github-check) (3.0.7, testdata/test_failed_dbt/extra_requirements-1.7.txt, .sq...

[sqlfluff-lint] reported by reviewdog 🐶 Expected line break and no indent before '2'. Raw Output: message:"Expected line break and no indent before '2'." location:{path:"testdata/test_failed_dbt/models/staging/staging_02.sql" range:{start:{}}} severity:WARNING source:{name:"sqlfluff" url:"https://github.com/sqlfluff/sqlfluff"} code:{value:"LT02" url:"https://docs.sqlfluff.com/en/stable/rules.html#sqlfluff.core.rules.Rule_LT02"}

Check warning on line 1 in testdata/test_failed_dbt/models/staging/staging_02.sql

View workflow job for this annotation

GitHub Actions / runner / sqlfluff (github-check) (3.0.7, testdata/test_failed_dbt/extra_requirements-1.7.txt, .sq...

[sqlfluff-lint] reported by reviewdog 🐶 Line 5, Position 7: Found unparsable section: '2 3' Raw Output: message:"Line 5, Position 7: Found unparsable section: '2 3'" location:{path:"testdata/test_failed_dbt/models/staging/staging_02.sql" range:{start:{}}} severity:WARNING source:{name:"sqlfluff" url:"https://github.com/sqlfluff/sqlfluff"} code:{value:"PRS" url:"https://docs.sqlfluff.com/en/stable/rules.html#sqlfluff.core.rules.Rule_PRS"}

Check warning on line 1 in testdata/test_failed_dbt/models/staging/staging_02.sql

View workflow job for this annotation

GitHub Actions / runner / sqlfluff (github-check) (3.0.7, testdata/test_failed_dbt/extra_requirements-1.7.txt, .sq...

[sqlfluff-lint] reported by reviewdog 🐶 Select targets should be on a new line unless there is only one select target. Raw Output: message:"Select targets should be on a new line unless there is only one select target." location:{path:"testdata/test_failed_dbt/models/staging/staging_02.sql" range:{start:{}}} severity:WARNING source:{name:"sqlfluff" url:"https://github.com/sqlfluff/sqlfluff"} code:{value:"LT09" url:"https://docs.sqlfluff.com/en/stable/rules.html#sqlfluff.core.rules.Rule_LT09"}

Check warning on line 1 in testdata/test_failed_dbt/models/staging/staging_02.sql

View workflow job for this annotation

GitHub Actions / runner / sqlfluff (github-check) (3.0.7, testdata/test_failed_dbt/extra_requirements-1.7.txt, .sq...

[sqlfluff-lint] reported by reviewdog 🐶 Expected line break and no indent before '2'. Raw Output: message:"Expected line break and no indent before '2'." location:{path:"testdata/test_failed_dbt/models/staging/staging_02.sql" range:{start:{}}} severity:WARNING source:{name:"sqlfluff" url:"https://github.com/sqlfluff/sqlfluff"} code:{value:"LT02" url:"https://docs.sqlfluff.com/en/stable/rules.html#sqlfluff.core.rules.Rule_LT02"}

Check warning on line 1 in testdata/test_failed_dbt/models/staging/staging_02.sql

View workflow job for this annotation

GitHub Actions / runner / sqlfluff (github-check) (3.0.7, testdata/test_failed_dbt/extra_requirements-1.7.txt, .sq...

[sqlfluff-lint] reported by reviewdog 🐶 Line 5, Position 7: Found unparsable section: '2 3' Raw Output: message:"Line 5, Position 7: Found unparsable section: '2 3'" location:{path:"testdata/test_failed_dbt/models/staging/staging_02.sql" range:{start:{}}} severity:WARNING source:{name:"sqlfluff" url:"https://github.com/sqlfluff/sqlfluff"} code:{value:"PRS" url:"https://docs.sqlfluff.com/en/stable/rules.html#sqlfluff.core.rules.Rule_PRS"}

Check warning on line 1 in testdata/test_failed_dbt/models/staging/staging_02.sql

View workflow job for this annotation

GitHub Actions / runner / sqlfluff (github-check) (3.0.7, testdata/test_failed_dbt/extra_requirements-1.8.txt, .sq...

[sqlfluff-lint] reported by reviewdog 🐶 Select targets should be on a new line unless there is only one select target. Raw Output: message:"Select targets should be on a new line unless there is only one select target." location:{path:"testdata/test_failed_dbt/models/staging/staging_02.sql" range:{start:{}}} severity:WARNING source:{name:"sqlfluff" url:"https://github.com/sqlfluff/sqlfluff"} code:{value:"LT09" url:"https://docs.sqlfluff.com/en/stable/rules.html#sqlfluff.core.rules.Rule_LT09"}

Check warning on line 1 in testdata/test_failed_dbt/models/staging/staging_02.sql

View workflow job for this annotation

GitHub Actions / runner / sqlfluff (github-check) (3.0.7, testdata/test_failed_dbt/extra_requirements-1.8.txt, .sq...

[sqlfluff-lint] reported by reviewdog 🐶 Expected line break and no indent before '2'. Raw Output: message:"Expected line break and no indent before '2'." location:{path:"testdata/test_failed_dbt/models/staging/staging_02.sql" range:{start:{}}} severity:WARNING source:{name:"sqlfluff" url:"https://github.com/sqlfluff/sqlfluff"} code:{value:"LT02" url:"https://docs.sqlfluff.com/en/stable/rules.html#sqlfluff.core.rules.Rule_LT02"}

Check warning on line 1 in testdata/test_failed_dbt/models/staging/staging_02.sql

View workflow job for this annotation

GitHub Actions / runner / sqlfluff (github-check) (3.0.7, testdata/test_failed_dbt/extra_requirements-1.8.txt, .sq...

[sqlfluff-lint] reported by reviewdog 🐶 Line 5, Position 7: Found unparsable section: '2 3' Raw Output: message:"Line 5, Position 7: Found unparsable section: '2 3'" location:{path:"testdata/test_failed_dbt/models/staging/staging_02.sql" range:{start:{}}} severity:WARNING source:{name:"sqlfluff" url:"https://github.com/sqlfluff/sqlfluff"} code:{value:"PRS" url:"https://docs.sqlfluff.com/en/stable/rules.html#sqlfluff.core.rules.Rule_PRS"}

Check warning on line 1 in testdata/test_failed_dbt/models/staging/staging_02.sql

View workflow job for this annotation

GitHub Actions / runner / sqlfluff (github-check) (3.0.7, testdata/test_failed_dbt/extra_requirements-1.8.txt, .sq...

[sqlfluff-lint] reported by reviewdog 🐶 Select targets should be on a new line unless there is only one select target. Raw Output: message:"Select targets should be on a new line unless there is only one select target." location:{path:"testdata/test_failed_dbt/models/staging/staging_02.sql" range:{start:{}}} severity:WARNING source:{name:"sqlfluff" url:"https://github.com/sqlfluff/sqlfluff"} code:{value:"LT09" url:"https://docs.sqlfluff.com/en/stable/rules.html#sqlfluff.core.rules.Rule_LT09"}

Check warning on line 1 in testdata/test_failed_dbt/models/staging/staging_02.sql

View workflow job for this annotation

GitHub Actions / runner / sqlfluff (github-check) (3.0.7, testdata/test_failed_dbt/extra_requirements-1.8.txt, .sq...

[sqlfluff-lint] reported by reviewdog 🐶 Expected line break and no indent before '2'. Raw Output: message:"Expected line break and no indent before '2'." location:{path:"testdata/test_failed_dbt/models/staging/staging_02.sql" range:{start:{}}} severity:WARNING source:{name:"sqlfluff" url:"https://github.com/sqlfluff/sqlfluff"} code:{value:"LT02" url:"https://docs.sqlfluff.com/en/stable/rules.html#sqlfluff.core.rules.Rule_LT02"}

Check warning on line 1 in testdata/test_failed_dbt/models/staging/staging_02.sql

View workflow job for this annotation

GitHub Actions / runner / sqlfluff (github-check) (3.0.7, testdata/test_failed_dbt/extra_requirements-1.8.txt, .sq...

[sqlfluff-lint] reported by reviewdog 🐶 Line 5, Position 7: Found unparsable section: '2 3' Raw Output: message:"Line 5, Position 7: Found unparsable section: '2 3'" location:{path:"testdata/test_failed_dbt/models/staging/staging_02.sql" range:{start:{}}} severity:WARNING source:{name:"sqlfluff" url:"https://github.com/sqlfluff/sqlfluff"} code:{value:"PRS" url:"https://docs.sqlfluff.com/en/stable/rules.html#sqlfluff.core.rules.Rule_PRS"}

Check warning on line 1 in testdata/test_failed_dbt/models/staging/staging_02.sql

View workflow job for this annotation

GitHub Actions / runner / sqlfluff (github-check) (3.0.7, testdata/test_failed_dbt/extra_requirements-1.8.txt, .sq...

[sqlfluff-lint] reported by reviewdog 🐶 Select targets should be on a new line unless there is only one select target. Raw Output: message:"Select targets should be on a new line unless there is only one select target." location:{path:"testdata/test_failed_dbt/models/staging/staging_02.sql" range:{start:{}}} severity:WARNING source:{name:"sqlfluff" url:"https://github.com/sqlfluff/sqlfluff"} code:{value:"LT09" url:"https://docs.sqlfluff.com/en/stable/rules.html#sqlfluff.core.rules.Rule_LT09"}

Check warning on line 1 in testdata/test_failed_dbt/models/staging/staging_02.sql

View workflow job for this annotation

GitHub Actions / runner / sqlfluff (github-check) (3.0.7, testdata/test_failed_dbt/extra_requirements-1.8.txt, .sq...

[sqlfluff-lint] reported by reviewdog 🐶 Expected line break and no indent before '2'. Raw Output: message:"Expected line break and no indent before '2'." location:{path:"testdata/test_failed_dbt/models/staging/staging_02.sql" range:{start:{}}} severity:WARNING source:{name:"sqlfluff" url:"https://github.com/sqlfluff/sqlfluff"} code:{value:"LT02" url:"https://docs.sqlfluff.com/en/stable/rules.html#sqlfluff.core.rules.Rule_LT02"}

Check warning on line 1 in testdata/test_failed_dbt/models/staging/staging_02.sql

View workflow job for this annotation

GitHub Actions / runner / sqlfluff (github-check) (3.0.7, testdata/test_failed_dbt/extra_requirements-1.8.txt, .sq...

[sqlfluff-lint] reported by reviewdog 🐶 Line 5, Position 7: Found unparsable section: '2 3' Raw Output: message:"Line 5, Position 7: Found unparsable section: '2 3'" location:{path:"testdata/test_failed_dbt/models/staging/staging_02.sql" range:{start:{}}} severity:WARNING source:{name:"sqlfluff" url:"https://github.com/sqlfluff/sqlfluff"} code:{value:"PRS" url:"https://docs.sqlfluff.com/en/stable/rules.html#sqlfluff.core.rules.Rule_PRS"}

Check warning on line 1 in testdata/test_failed_dbt/models/staging/staging_02.sql

View workflow job for this annotation

GitHub Actions / runner / sqlfluff (github-check) (3.0.7, testdata/test_failed_dbt/extra_requirements-1.8.txt, .sq...

[sqlfluff-lint] reported by reviewdog 🐶 Select targets should be on a new line unless there is only one select target. Raw Output: message:"Select targets should be on a new line unless there is only one select target." location:{path:"testdata/test_failed_dbt/models/staging/staging_02.sql" range:{start:{}}} severity:WARNING source:{name:"sqlfluff" url:"https://github.com/sqlfluff/sqlfluff"} code:{value:"LT09" url:"https://docs.sqlfluff.com/en/stable/rules.html#sqlfluff.core.rules.Rule_LT09"}

Check warning on line 1 in testdata/test_failed_dbt/models/staging/staging_02.sql

View workflow job for this annotation

GitHub Actions / runner / sqlfluff (github-check) (3.0.7, testdata/test_failed_dbt/extra_requirements-1.8.txt, .sq...

[sqlfluff-lint] reported by reviewdog 🐶 Expected line break and no indent before '2'. Raw Output: message:"Expected line break and no indent before '2'." location:{path:"testdata/test_failed_dbt/models/staging/staging_02.sql" range:{start:{}}} severity:WARNING source:{name:"sqlfluff" url:"https://github.com/sqlfluff/sqlfluff"} code:{value:"LT02" url:"https://docs.sqlfluff.com/en/stable/rules.html#sqlfluff.core.rules.Rule_LT02"}

Check warning on line 1 in testdata/test_failed_dbt/models/staging/staging_02.sql

View workflow job for this annotation

GitHub Actions / runner / sqlfluff (github-check) (3.0.7, testdata/test_failed_dbt/extra_requirements-1.8.txt, .sq...

[sqlfluff-lint] reported by reviewdog 🐶 Line 5, Position 7: Found unparsable section: '2 3' Raw Output: message:"Line 5, Position 7: Found unparsable section: '2 3'" location:{path:"testdata/test_failed_dbt/models/staging/staging_02.sql" range:{start:{}}} severity:WARNING source:{name:"sqlfluff" url:"https://github.com/sqlfluff/sqlfluff"} code:{value:"PRS" url:"https://docs.sqlfluff.com/en/stable/rules.html#sqlfluff.core.rules.Rule_PRS"}

Check warning on line 1 in testdata/test_failed_dbt/models/staging/staging_02.sql

View workflow job for this annotation

GitHub Actions / runner / sqlfluff (github-check) (3.0.7, testdata/test_failed_dbt/extra_requirements-1.8.txt, .sq...

[sqlfluff-lint] reported by reviewdog 🐶 Select targets should be on a new line unless there is only one select target. Raw Output: message:"Select targets should be on a new line unless there is only one select target." location:{path:"testdata/test_failed_dbt/models/staging/staging_02.sql" range:{start:{}}} severity:WARNING source:{name:"sqlfluff" url:"https://github.com/sqlfluff/sqlfluff"} code:{value:"LT09" url:"https://docs.sqlfluff.com/en/stable/rules.html#sqlfluff.core.rules.Rule_LT09"}

Check warning on line 1 in testdata/test_failed_dbt/models/staging/staging_02.sql

View workflow job for this annotation

GitHub Actions / runner / sqlfluff (github-check) (3.0.7, testdata/test_failed_dbt/extra_requirements-1.8.txt, .sq...

[sqlfluff-lint] reported by reviewdog 🐶 Expected line break and no indent before '2'. Raw Output: message:"Expected line break and no indent before '2'." location:{path:"testdata/test_failed_dbt/models/staging/staging_02.sql" range:{start:{}}} severity:WARNING source:{name:"sqlfluff" url:"https://github.com/sqlfluff/sqlfluff"} code:{value:"LT02" url:"https://docs.sqlfluff.com/en/stable/rules.html#sqlfluff.core.rules.Rule_LT02"}

Check warning on line 1 in testdata/test_failed_dbt/models/staging/staging_02.sql

View workflow job for this annotation

GitHub Actions / runner / sqlfluff (github-check) (3.0.7, testdata/test_failed_dbt/extra_requirements-1.8.txt, .sq...

[sqlfluff-lint] reported by reviewdog 🐶 Line 5, Position 7: Found unparsable section: '2 3' Raw Output: message:"Line 5, Position 7: Found unparsable section: '2 3'" location:{path:"testdata/test_failed_dbt/models/staging/staging_02.sql" range:{start:{}}} severity:WARNING source:{name:"sqlfluff" url:"https://github.com/sqlfluff/sqlfluff"} code:{value:"PRS" url:"https://docs.sqlfluff.com/en/stable/rules.html#sqlfluff.core.rules.Rule_PRS"}
config(
enabled=true
)
}}


SELECT
1 2 3