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

Default to exiting with success if the check run is successful #179

Merged
merged 2 commits into from
Feb 27, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions main/warden.hs
Original file line number Diff line number Diff line change
Expand Up @@ -233,10 +233,20 @@ fieldMatchRatioP = FieldMatchRatio <$> (option auto $

exitTypeP :: Parser ExitType
exitTypeP =
flag ExitWithCheckStatus ExitWithSuccess $
long "exit-success"
<> short 'e'
<> help "Exit with success status if no errors occur, even if checks have failures."
exitCheckStatusFlag <* exitSuccessFlag
where
exitCheckStatusFlag =
flag ExitWithSuccess ExitWithCheckStatus $
long "exit-check-status"
<> short 'x'
<> help "Exit with failure if any checks fail, even if warden has run successfully."

-- Old, kept for compatibility.
exitSuccessFlag =
flag ExitWithSuccess ExitWithSuccess $
long "exit-success"
<> short 'e'
<> help "(Deprecated: this is now the default behaviour.) Exit with success status if no errors occur, even if checks have failures."

includeDotFilesP :: Parser IncludeDotFiles
includeDotFilesP =
Expand Down
2 changes: 1 addition & 1 deletion test/cli/basic-usage/run
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ $WARDEN check .

$WARDEN check /not/a/real/view

$WARDEN check --file-format rfc4180 -e -v -r 300 -b 1000 -s ',' --text-freeform-threshold 9999 /not/a/real/view
$WARDEN check --file-format rfc4180 -x -e -v -r 300 -b 1000 -s ',' --text-freeform-threshold 9999 /not/a/real/view

$WARDEN check -s '\t' /not/a/real/view

Expand Down