-
-
Notifications
You must be signed in to change notification settings - Fork 27
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
Test the Action #119
Conversation
Signed-off-by: Yu Ishikawa <yu-iskw@users.noreply.github.com>
Warning Rate Limit Exceeded@yu-iskw has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 6 minutes and 39 seconds before requesting another review. How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. WalkthroughThe changes primarily focus on updating SQLFluff versions and paths for additional requirements in the GitHub Actions workflow file. Additionally, the SQL linting reporter has been switched from Changes
Poem
Tip Early Access Features
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (2)
- .github/workflows/test.yml (4 hunks)
- testdata/test_failed_dbt/models/staging/staging_02.sql (1 hunks)
Additional Context Used
GitHub Check Runs (3)
runner / sqlfluff (github-check) (3.0.7, testdata/test_failed_dbt/extra_requirements-1.8.txt, .sq... success (3)
testdata/test_failed_dbt/models/staging/staging_02.sql: [warning] 1-1:
[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"}
testdata/test_failed_dbt/models/staging/staging_02.sql: [warning] 1-1:
[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"}
testdata/test_failed_dbt/models/staging/staging_02.sql: [warning] 1-1:
[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"}runner / sqlfluff (github-check) (3.0.7, testdata/test_failed_dbt/extra_requirements-1.7.txt, .sq... success (3)
testdata/test_failed_dbt/models/staging/staging_02.sql: [warning] 1-1:
[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"}
testdata/test_failed_dbt/models/staging/staging_02.sql: [warning] 1-1:
[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"}
testdata/test_failed_dbt/models/staging/staging_02.sql: [warning] 1-1:
[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"}runner / sqlfluff (github-check) (3.0.7, testdata/test_failed_dbt/extra_requirements-1.6.txt, .sq... success (3)
testdata/test_failed_dbt/models/staging/staging_02.sql: [warning] 1-1:
[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"}
testdata/test_failed_dbt/models/staging/staging_02.sql: [warning] 1-1:
[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"}
testdata/test_failed_dbt/models/staging/staging_02.sql: [warning] 1-1:
[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"}
Additional comments not posted (4)
testdata/test_failed_dbt/models/staging/staging_02.sql (1)
7-7
: Correct the SQL syntax to adhere to best practices.- SELECT - 1 2 3 + SELECT + 1, + 2, + 3This change addresses the issues flagged by SQLFluff, ensuring each select target is on a new line and properly separated by commas.
Likely invalid or redundant comment.
.github/workflows/test.yml (3)
15-15
: Updated SQLFluff version to 3.0.7.This update is crucial for staying up-to-date with the latest features and fixes from SQLFluff.
17-19
: Updated paths for extra requirements files.These updates ensure that the workflow uses the correct versions of additional requirements, aligning with the updated SQLFluff version.
32-32
: Changed reporter fromgithub-check
togithub-pr-review
.This change will alter how linting results are reported, potentially improving the integration with GitHub PR reviews.
Also applies to: 77-77
grep -e "${SQL_FILE_PATTERN:?}" | | ||
xargs -I% bash -c 'if [[ -f "%" ]] ; then echo "%"; fi' || :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[shfmt] reported by reviewdog 🐶
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 "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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[shfmt] reported by reviewdog 🐶
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 |
pip install --no-cache-dir -r "${EXTRA_REQUIREMENTS_TXT}" --use-deprecated=legacy-resolver | ||
# Make sure the installed modules | ||
pip list |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[shfmt] reported by reviewdog 🐶
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 |
default_dir="$(pwd)" | ||
cd "$INPUT_WORKING_DIRECTORY" | ||
dbt deps --profiles-dir "${SCRIPT_DIR}/resources/dummy_profiles" | ||
cd "$default_dir" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[shfmt] reported by reviewdog 🐶
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" |
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[shfmt] reported by reviewdog 🐶
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 |
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[shfmt] reported by reviewdog 🐶
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 |
echo 'ERROR: SQLFLUFF_COMMAND must be one of lint and fix' | ||
exit 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[shfmt] reported by reviewdog 🐶
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 |
No description provided.