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

[Enhancement] Add allChecksAsErrors and override by disabling some after what you don’t want. #4808

Open
alexandrenavarro opened this issue Feb 4, 2025 · 0 comments

Comments

@alexandrenavarro
Copy link

[Enhancement] Add allChecksAsErrors and override by disabling some after what you don’t want.

I will explain what I did today in my different projects with errorprone checks.

Today, I consider I should use a maximum of errorprone checks because in my experience on my different projects where I recently used errorprone, around 98-99% of the checks of errorprone are good.

So in my gradle build,  I added some configuration generated by this magnificent commandline
curl [https://errorprone.info/bugpatterns|grep](https://errorprone.info/bugpatterns%7Cgrep) "bugpattern"| awk -F'[/\"]' ' {print "error(\"" $3 "\")" }'

After, at first in any project, I just disable all the checks where I have an error
and in a second time, I reactivate a check and examine the different violation to determine

  1. if I should fix directly or by configuring some options and fix it

  2. if I should disable it because I don't consider it is not a really good practise notably on some controversial checks,

  3. if I can't fix it (so I disable it) because  

    3.1. there are some false positives I can't fix by modifying code or configuring some options 
    3.2. it does not depend on me but a third library I used not well coded.

The majority is clearly 1 at the end.

I saw some people using -Werror but I don't want to use it because I have some warnings not generated by errorprone in my build and I don't want to fix at the same time like some @Deprecated methods.

Adding this feature is "a nice to have" but not a blocker issue because what I do works but I need to add a lot of boilerplate configuration in my gradle. 
I will commonize some configuration in a gradle plugin for all my projects to reduce the boilerplate configuration.
I understand not to activate by default all the checks but with this kind of option and of course if you can disable / warn by overriding the configuration on a check and if you know what you want to do, I think it should be a nice feature and personally I like to use erroprone with this approach.

Don't hesitate if you have some questions or any comments, thank you for your amazing checker.

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

No branches or pull requests

1 participant