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

Automatically disable error-prone logging checks for gradle plugins #389

Closed
iamdanfox opened this issue Oct 2, 2018 · 3 comments · Fixed by #790
Closed

Automatically disable error-prone logging checks for gradle plugins #389

iamdanfox opened this issue Oct 2, 2018 · 3 comments · Fixed by #790

Comments

@iamdanfox
Copy link
Contributor

What happened

We have lots of repos internally where we maintain gradle plugins, but the Slf4jLogsafeArgs and Slf4jConstantLogMessage checks are pretty redundant as they are intended for server-side or library usage, whereas Gradle plugins are used pretty much exclusively on local machines.

apply plugin: 'java-gradle-plugin'

dependencies {
    // ..
}

tasks.withType(JavaCompile) {
    options.errorprone.errorproneArgs += ['-Xep:Slf4jLogsafeArgs:OFF', '-Xep:Slf4jConstantLogMessage:OFF']
}

What should have happened

baseline-error-prone should detect when the java-gradle-plugin plugin has been applied and automatically disable these custom logging checks.

@stale stale bot added the stale label Jan 7, 2019
@iamdanfox
Copy link
Contributor Author

I still want this feature request

@stale stale bot removed the stale label Jan 8, 2019
@palantir palantir deleted a comment from stale bot Jan 15, 2019
bulldozer-bot bot pushed a commit that referenced this issue Jan 15, 2019
Fixes #389 

## Before this PR

Gradle plugins would be subjected to certain error prone checks that are only really applicable to code that will run as part of deployed services:

* Slf4jLogsafeArgs
* PreferSafeLoggableExceptions

## After this PR

These checks are disabled for gradle plugin projects, i.e. projects that apply `java-gradle-plugin`.

cc @iamdanfox
@iamdanfox
Copy link
Contributor Author

Fixed by #504

@iamdanfox iamdanfox reopened this Sep 3, 2019
@iamdanfox
Copy link
Contributor Author

I think we could add PreconditionsConstantMessage to the list of checks that are pretty pointless for gradle plugins

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant