get-woke / woke

Detect non-inclusive language in your source code.
https://docs.getwoke.tech
MIT License
457 stars 61 forks source link

Add an option "--count-only-error-for-failure" #252

Open nhosoi opened 1 year ago

nhosoi commented 1 year ago

Description: --count-only-error-for-failure Count only error items, not warning and info, for failure

We have a requirement for a word not to cause a failure when the word has a rule whose severity is warning or info.

Note

As long as the requirement is satisfied, we do not mind how it'd be implemented. So, if my proposal does not fit in the current design, please feel free to close this PR in favor of a better one. Thanks in advance!

Please check if the PR fulfills these requirements

What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)

This PR adds an option --count-only-error-for-failure. When this option is given along with --exit-1-on-failure, even if a word whose rule specifies the warning level of severity (or info) is found, it does not exit as a failure.

What is the current behavior? (You can also link to an open issue here)

Regardless of the severity level, any finding makes woke exit with 1 if --exit-1-on-failure is specified.

If you are interested in, this is the PR in which I ran into the issue. https://github.com/linux-system-roles/logging/pull/307#issuecomment-1343073890

What is the new behavior (if this is a feature change)?

If --count-only-error-for-failure is specified along with --exit-1-on-failure, findings whose rule has the warning or info level of the severity will not cause woke exit with 1.

Does this PR introduce a breaking change? (What changes might users need to make due to this PR?)

Unless --count-only-error-for-failure is specified, there are no behavioral changes.

nhosoi commented 1 year ago

Dear woke developers / maintainers,

Our project https://github.com/linux-system-roles/ is hoping to use this feature in the actions. Could you please take a look and share your thoughts? Thank you!

caitlinelfring commented 1 year ago

Hi there! Apologies for the delay, my notifications for this repo didn't seem to be working. I will take a look and respond in the next few days. I appreciate your patience!

nhosoi commented 1 year ago

Hi there! Apologies for the delay, my notifications for this repo didn't seem to be working. I will take a look and respond in the next few days. I appreciate your patience!

Thanks for your response, @caitlinelfring!

spetrosi commented 1 year ago

Hello @caitlinelfring, is there any update on this PR?

spetrosi commented 1 year ago

Hello @caitlinelfring, is there any update on this PR?

spetrosi commented 1 year ago

Hello @caitlinelfring, is there any update on this PR?