google / google/error-prone

Feature request: disable a specific rule in some scope (tests, file, etc.)

Open
#3,573 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
7.2k
Forks
820
Avg merge
5h 9m
Merged PRs (30d)
50

Description

For example, I'd like to be able to disable `InterruptedExceptionSwallowed` (and some other rules) for tests but keep it enabled for non-tests. I also don't want to disable ErrorProne entirely, just a few rules.

IMHO best would be to have something similar to https://spotbugs.readthedocs.io/en/latest/filter.html

I do like the native suppress mechanism for individual false positives, but it's not very flexible on a larger scale.
Right now, I have to add `@SuppressWarnings({"InterruptedExceptionSwallowed"})` to individual test classes, which is not very nice.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.