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

Add an ErrorProne check for raw types #1197

Merged
merged 7 commits into from
Feb 1, 2020
Merged

Conversation

AlexLandau
Copy link
Contributor

This adds an ErrorProne check that fails when it detects raw types. Currently, javac has a built-in warning type for this, but it's not as flexible as ErrorProne; for example, you can't fail on raw-types errors without also failing on deprecation warnings, and you can't add exemptions for generated code.

Upstream ErrorProne doesn't seem to have any check for this or requests for such a check, beyond this issue: google/error-prone#253

For @SuppressWarnings, the check respects "rawtypes", which is already used by javac and Eclipse.

The current level is "warning"; feel free to change that.

I added the check to the BaselineErrorProneExtension due to seeing it in another PR adding a check.

@changelog-app
Copy link

changelog-app bot commented Jan 29, 2020

Generate changelog in changelog/@unreleased

Type

  • Feature
  • Improvement
  • Fix
  • Break
  • Deprecation
  • Manual task
  • Migration

Description

Add an ErrorProne check for raw types

Check the box to generate changelog(s)

  • Generate changelog entry

@dansanduleac
Copy link
Contributor

I'm supportive of this. Have we run it on a large repo to make sure that it doesn't cause any unexpected breaks?

Also the changelog message should be a one-line sentence explaining what you're adding, just "Add an ErrorProne check for raw types" should be enough

@carterkozak
Copy link
Contributor

Supportive of this check as well, thanks for putting it together @AlexLandau :-)

@AlexLandau
Copy link
Contributor Author

@dansanduleac Yes, I've been testing this against the big monorepo. Thanks for taking care of the changelog.

@carterkozak Thanks for the suggestions!

@carterkozak
Copy link
Contributor

lgtm, thanks! 👍

@bulldozer-bot bulldozer-bot bot merged commit 9f96183 into develop Feb 1, 2020
@bulldozer-bot bulldozer-bot bot deleted the alandau/raw-types-check branch February 1, 2020 00:35
@svc-autorelease
Copy link
Collaborator

Released 3.2.0

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

Successfully merging this pull request may close these issues.

None yet

4 participants