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 illegal import check for Java6Assertions #1731

Merged
merged 1 commit into from Dec 4, 2019

Conversation

izeye
Copy link
Contributor

@izeye izeye commented Dec 3, 2019

This PR adds a Checkstyle rule for org.assertj.core.api.Java6Assertions.

See #1729 (comment)

@shakuzen shakuzen added the type: task A general task label Dec 4, 2019
@shakuzen shakuzen added this to the 1.1.10 milestone Dec 4, 2019
@@ -27,6 +27,12 @@
value="Line has leading tab characters; indentation should be performed with spaces only." />
<property name="ignoreComments" value="true" />
</module>
<module name="com.puppycrawl.tools.checkstyle.checks.regexp.RegexpSinglelineJavaCheck">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we use the IllegalImportCheck's illegalClasses property instead? I think the regex here will also work, but it just seems more straightforward to use the IllegalImportCheck. I'm not sure of its behavior when importing a static method from one of the illegalClasses.
https://checkstyle.org/config_imports.html#IllegalImport

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shakuzen Thanks for the feedback 👍 I tried it with a wrong value before and just assumed that it doesn't work with static imports. I confirmed that it works and updated in 903716d as you suggested.

@izeye izeye changed the title Add Checkstyle rule for org.assertj.core.api.Java6Assertions Add illegal import check for Java6Assertions Dec 4, 2019
@shakuzen shakuzen merged commit 7f3d425 into micrometer-metrics:1.1.x Dec 4, 2019
@izeye izeye deleted the checkstyle-assertj branch December 4, 2019 06:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: task A general task
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants