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

🐛 Fixes a small bug in the error catch behavoir #23

Merged
merged 1 commit into from Dec 30, 2020

Conversation

rickstaa
Copy link
Member

This pull request changes the error catch behaviour. In the new version, I the black output is stored in a variable and the error is read directly after the command execution. This results in a more realibalbe error catch behavoir since when we use piping the exit code of the black formatter can be changed if reviewdog doesn't recognize a user defined flag (see this stack post).

-fail-on-error="${INPUT_FAIL_ON_ERROR}" \
${INPUT_REVIEWDOG_FLAGS} || reviewdog_error="true"
black_exit_val="${PIPESTATUS[0]}"
black_check_output="$(black --diff --quiet --check ${INPUT_WORKDIR}/${black_args})" ||
Copy link
Contributor

Choose a reason for hiding this comment

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

📝 [shellcheck] reported by reviewdog 🐶
Double quote to prevent globbing and word splitting. SC2086

-fail-on-error="${INPUT_FAIL_ON_ERROR}" \
${INPUT_REVIEWDOG_FLAGS} || reviewdog_error="true"
black_exit_val="${PIPESTATUS[0]}"
black_check_output="$(black --diff --quiet --check ${INPUT_WORKDIR}/${black_args})" ||
Copy link
Contributor

Choose a reason for hiding this comment

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

📝 [shellcheck] reported by reviewdog 🐶
Double quote to prevent globbing and word splitting. SC2086

-filter-mode="diff_context" \
-level="${INPUT_LEVEL}" \
-fail-on-error="${INPUT_FAIL_ON_ERROR}" \
${INPUT_REVIEWDOG_FLAGS} || reviewdog_exit_val="$?"
Copy link
Contributor

Choose a reason for hiding this comment

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

📝 [shellcheck] reported by reviewdog 🐶
Double quote to prevent globbing and word splitting. SC2086

-level="${INPUT_LEVEL}" \
${INPUT_REVIEWDOG_FLAGS} || reviewdog_error="true"
black_exit_val="${PIPESTATUS[0]}"
black_check_output="$(black --check ${INPUT_WORKDIR}/${black_args} 2>&1)" ||
Copy link
Contributor

Choose a reason for hiding this comment

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

📝 [shellcheck] reported by reviewdog 🐶
Double quote to prevent globbing and word splitting. SC2086

-level="${INPUT_LEVEL}" \
${INPUT_REVIEWDOG_FLAGS} || reviewdog_error="true"
black_exit_val="${PIPESTATUS[0]}"
black_check_output="$(black --check ${INPUT_WORKDIR}/${black_args} 2>&1)" ||
Copy link
Contributor

Choose a reason for hiding this comment

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

📝 [shellcheck] reported by reviewdog 🐶
Double quote to prevent globbing and word splitting. SC2086

-filter-mode="${INPUT_FILTER_MODE}" \
-fail-on-error="${INPUT_FAIL_ON_ERROR}" \
-level="${INPUT_LEVEL}" \
${INPUT_REVIEWDOG_FLAGS} || reviewdog_exit_val="$?"
Copy link
Contributor

Choose a reason for hiding this comment

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

📝 [shellcheck] reported by reviewdog 🐶
Double quote to prevent globbing and word splitting. SC2086

@rickstaa rickstaa added the bump:patch Bump the patch version on pull request label Dec 30, 2020
@github-actions
Copy link
Contributor

🏷️ [bumpr] Next version:v1.3.4 Changes:v1.3.3...reviewdog:fixes_error_catch_behavoir

@rickstaa rickstaa merged commit 8252fd2 into master Dec 30, 2020
@github-actions
Copy link
Contributor

🚀 [bumpr] Bumped! New version:v1.3.4 Changes:v1.3.3...v1.3.4

@rickstaa rickstaa deleted the fixes_error_catch_behavoir branch December 30, 2020 14:22
@rickstaa
Copy link
Member Author

🧪 Test results: Successful (see rickstaa/action-test-repo#22).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bump:patch Bump the patch version on pull request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant