-
Notifications
You must be signed in to change notification settings - Fork 1
Add removeUnused mode
#202
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
Conversation
Generate changelog in
|
✅ Successfully generated changelog entry!What happened?Your changelog entries have been stored in the database as part of our migration to ChangelogV3. Need to regenerate?Simply interact with the changelog bot comment again to regenerate these entries. 📋Changelog Preview✨ Features
|
79ab57d to
a25c7f4
Compare
a25c7f4 to
27f96dd
Compare
|
FLUPS: #203 (comment) |
...om/palantir/gradle/suppressibleerrorprone/SuppressibleErrorPronePluginIntegrationTest.groovy
Outdated
Show resolved
Hide resolved
...om/palantir/gradle/suppressibleerrorprone/SuppressibleErrorPronePluginIntegrationTest.groovy
Show resolved
Hide resolved
...om/palantir/gradle/suppressibleerrorprone/SuppressibleErrorPronePluginIntegrationTest.groovy
Show resolved
Hide resolved
| private static final Logger log = Logger.getLogger(VisitorStateModifications.class.getName()); | ||
|
|
||
| private static final ReportedFixCache FIXES = new ReportedFixCache(); | ||
| private static final Set<CompilationUnitTree> SEEN = new HashSet<>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's give SEEN a slightly better name - maybe ALREADY_REMOVED_EXISTING_SUPPRESSIONS?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, I think we should make a new type to remove some code from VisitorStateModifications. It can hold and manage this Set, then have the removeAllSuppressionsOnErrorpronesInCompilationUnit method in there too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar to ReportedFixCache (will need to take it as a field)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, I've created a SuppressionRemover which encapsulates a weak set and the "report on everything" logic.
...error-prone/src/main/java/com/palantir/suppressibleerrorprone/VisitorStateModifications.java
Outdated
Show resolved
Hide resolved
...error-prone/src/main/java/com/palantir/suppressibleerrorprone/VisitorStateModifications.java
Show resolved
Hide resolved
5a1d8f3 to
c642485
Compare
|
👍 |
|
Released 2.24.0 |
Before this PR
See #173 for background
FLUP to #192, #200, #203
Features
removeUnusedmode removes all unused error-prone suppressions (both human-authored and for-rollout suppressions) in all compilation unitsSomeRandomSuppressionAfter this PR
==COMMIT_MSG==
Add
removeUnusedmode==COMMIT_MSG==
Possible downsides?
VisitorStateModifications, e.g. theSuppressibleErrorPronecheck used to prevent infinite recursion when callingstate.reportMatch