Skip to content

Add failOnError parameter - #153

Merged
klaraward merged 8 commits into
mainfrom
warningOnly
Jun 14, 2022
Merged

klaraward merged 8 commits into
mainfrom
warningOnly

Conversation

@klaraward

@klaraward klaraward commented May 24, 2022 •

Copy link
Copy Markdown
Contributor

Solves #59

Per discussions below naming parameter failOnError

@Stephan202

Copy link
Copy Markdown
Contributor

Is there a standard for naming this parameter? Some call it failOnWarning (which would be default true in our case)

It seems plugins use a wide range of variants; see this section for a number of examples.

(Thanks for picking this up; it'll allow us to drop this special treatment of fmt-maven-plugin πŸ‘.)

@danielnorberg

danielnorberg commented May 24, 2022 •

Copy link
Copy Markdown
Contributor

Indeed there does not seem to be a strong standard around naming, but some variant of failOnXYZ seem common. E.g. failOnError, failsOnError, failOnViolation, failOnWarning, etc.

I feel a bit partial towards failOnError given true will be the default. My rationale being that we normally consider formatting errors to be hard errors that should fail the build. And so failOnError with a default of true seems consistent with the expectation that errors normally cause the build to fail. And failOnWarning with a default of true would seem inconsistent with the expectation that warnings usually do not cause builds to fail.

In comparison, the maven compiler plugin choice of failOnWarning (with a default of false) seems consistent with the expectation that warnings do not normally cause the build to fail.

@klaraward

Copy link
Copy Markdown
Contributor Author

Thanks @Stephan202 and @danielnorberg for the examples πŸ‘
I think some failOnXYZ would be my preference. failOnNonComply is a bit bulky :)
Will change PR to use failOnWarning for now.

@klaraward klaraward changed the title Add warningOnly parameter Add failOnWarning parameter May 24, 2022
@klaraward
klaraward requested review from a team, knifeofdreams and tommyulfsparre May 24, 2022 13:00
@danielnorberg

Copy link
Copy Markdown
Contributor

Do we consider the formatting violations to be "warnings" or "errors"?

I believe warnings usually do not by default fail builds whereas errors do.

If we want to keep the behavior of failing the build on formatting violations by default then I'd consider them to be "errors" and call this parameter failOnError.

@klaraward

Copy link
Copy Markdown
Contributor Author

I guess since the whole job of the check goal is to find the errors, and the output is not warnings in the process of doing something else, in contrast to the compiler plugin that compiles AND shows any warnings, that failOnError, or maybe the failOnViolation, makes a lot of sense.
failOnError is a bit easier to read and write, so lets go with tag.

@danielnorberg

Copy link
Copy Markdown
Contributor

sgtm

@klaraward klaraward changed the title Add failOnWarning parameter Add failOnError parameter Jun 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants