-
-
Notifications
You must be signed in to change notification settings - Fork 234
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
feat: control fail severity and result display #540
Conversation
6a9e2c6
to
b452e9d
Compare
df663cd
to
f817006
Compare
f817006
to
b20865b
Compare
--version Show version number [boolean] | ||
--help Show help [boolean] | ||
--encoding, -e text encoding to use [string] [default: "utf8"] | ||
--format, -f formatter to use for outputting results [string] [default: "stylish"] |
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.
Is the lack of available formats expected?
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.
it's not no. damn where'd they go.
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.
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.
Alrighty, sounds good.
--skip-rule, -s ignore certain rules if they are causing trouble [string] | ||
--fail-severity, -F results of this level or above will trigger a failure exit code | ||
[string] [choices: "error", "warn", "info", "hint"] [default: "hint"] | ||
--display-only-failures, -D only output results equal to or greater than --fail-severity |
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.
greater
sounds a bit unfortunate, given DiagnosticSeverity.Error
equals 0, Warn 1 etc.
I know what the intention is, but perhaps there is a way to make it more clear, i.e. more severe
or higher/lower
?
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.
greater and higher are synonomous and i dont think anyone knows what the internal ints are? This is probably find, if anyone gets confused we can ask them for suggestions.
}, | ||
'display-only-failures': { | ||
alias: 'D', | ||
description: 'only output results equal to or greater than --fail-severity', |
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.
As in docs.
.then(results => { | ||
if (results.length) { | ||
process.exitCode = 1; | ||
process.exitCode = severeEnoughToFail(results, failSeverity) ? 1 : 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.
process.exitCode = severeEnoughToFail(results, failSeverity) ? 1 : 0; | |
process.exitCode = isSevereEnoughToFail(results, failSeverity) ? 1 : 0; |
const expectedStatus = replaceVars(scenario.status.trim(), replacements); | ||
const expectedStdout = replaceVars(scenario.stdout.trim(), replacements); | ||
const expectedStderr = replaceVars(scenario.stderr.trim(), replacements); | ||
const status = commandHandle.status; |
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.
let's maybe differentiate between expected
and actual
to be consistent? here, actualStatus
would tell more than just status
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.
The actualStatus is the status. I think t's ok.
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.
left a couple of suggestions, looks cool 👍
Co-Authored-By: lag-of-death <[email protected]> Co-Authored-By: Jakub Rożek <[email protected]>
449551e
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.
Re-approving.
Fixes #368
Let folks control what results are displayed, and what level off severity constitutes a failure. This PR respects the existing behavior and does not break BC, but we should raise the default
--fail-severity
towarn
in v5.0.Checklist
Does this PR introduce a breaking change?
Screenshots