-
-
Notifications
You must be signed in to change notification settings - Fork 8
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
Support reviewdog command line argument changes (--fail-level) #72
Support reviewdog command line argument changes (--fail-level) #72
Conversation
a324957
to
091455a
Compare
Co-authored-by: Shoma Okamoto <[email protected]>
Co-authored-by: Shoma Okamoto <[email protected]>
script.sh
Outdated
if [[ -n "${INPUT_FAIL_LEVEL}" ]]; then | ||
fail_level="--fail-level=${INPUT_FAIL_LEVEL}" | ||
elif [[ "${INPUT_FAIL_ON_ERROR}" = "true" ]]; then | ||
# For backward compatibility, default to any if fail-on-error is true | ||
# Deprecated | ||
fail_level="--fail-level=any" | ||
else | ||
fail_level="" | ||
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.
I don’t think it makes sense for reviewdog users to include conditional branching based on options.
The reviewdog code seems to include code to take care when fail-on-error is true. You can just pass the two options as is and there will be no problem.
func failLevel(opt *option) reviewdog.FailLevel {
if opt.failOnError {
slog.Warn("reviewdog: -fail-on-error is deprecated. Use -fail-level=any, or -fail-level=error for github-[pr-]check reporter instead. See also https://github.com/reviewdog/reviewdog/blob/master/CHANGELOG.md")
if opt.failLevel == reviewdog.FailLevelDefault {
switch opt.reporter {
default:
return reviewdog.FailLevelAny
case "github-check", "github-pr-check":
return reviewdog.FailLevelError
}
}
}
return opt.failLevel
}
reviewdog/reviewdog#1854
https://github.com/reviewdog/action-rubocop/blob/master/script.sh#L135-L136
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.
Thank you! Fixed!
Co-authored-by: Shoma Okamoto <[email protected]>
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.
LGTM 🚀
🚀 [bumpr] Bumped! New version:v1.13.4 Changes:v1.13.3...v1.13.4 |
Support reviewdog command line argument changes.
New: support fail-level
Deprecated: fail-on-error
See: #70
See also: https://github.com/reviewdog/reviewdog/blob/master/CHANGELOG.md#rotating_light-deprecation-warnings