DisableErrorsInGeneratedCode
- Dominant language
- Java
- Stars
- 7.2k
- Forks
- 820
- Avg merge
- 5h 9m
- Merged PRs (30d)
- 50
Description
Would you consider adding a `DisableErrorsInGeneratedCode` option?
As its name implies, it would, just like it's existing inspiration `DisableWarningsInGeneratedCode`, prevent errors from being raised on [anything annotated with @Generated](https://github.com/google/error-prone/pull/807).
I'm expecting you :innocent: to reply and close this as you _"NEVER!",_ because _"why would anyone possibly want to ignore errors even in generated code?!",_ but here's the rationale:
Some of error-prone's (great!) checks are not _necessarily_ flagging clear errors only. For example, [`Var` is more of a best practice style which can help prevent errors - but a violation of it is not an error.](http://errorprone.info/bugpattern/Var) I really like `Var` though, and have cleaned up an existing code base to that style (because I now have one small reason less to adopt Kotlin and Xtend which have this same concept), and would now like to enforce it to fail builds running on Gerrit code review if my colleagures re-introduce unnecessary ugly `final`.
But I cannot use e.g. `-Xep:Var:ERROR` because my project uses a code generator which is not (yet) peperring the @Var annotation over it's generated code - so I'm stuck. Of course one can try to get that code generator to comply - but, generally speaking, that is not realistic - nor neccesary.
Contributor guide
Assessment
This issue has not been assessed yet.