amoro icon indicating copy to clipboard operation
amoro copied to clipboard

[Improvement]: Add checkstyle check for wildcard import

Open klion26 opened this issue 1 year ago • 2 comments

Search before asking

  • [X] I have searched in the issues and found no similar issues.

What would you like to be improved?

throw exception if there is any wildcard import when building

How should we improve?

We can add checkstyle plugin for this.

Why not add new spotless rule for this?

  1. currently spotless can only use google java format 1.7(because this is the highest version support JDK8 )
  2. google java format did not ban wildcard import in 1.7
  3. spotless did not support custom configure for maven(only supported in gradle)

Are you willing to submit PR?

  • [X] Yes I am willing to submit a PR!

Subtasks

No response

Code of Conduct

klion26 avatar Mar 19 '24 10:03 klion26

Thank you very much for suggesting this improvement. It is indeed very important and can help us simplify the code review process, allowing us to focus more on logic rather than code formatting.

Adding an additional checkstyle plugin is acceptable, considering that currently spotless seems unable to achieve this. I'm curious whether the checkstyle plugin can help us validate if our code depends on shaded classes.

zhoujinsong avatar Mar 20 '24 02:03 zhoujinsong

@zhoujinsong thanks for your reply, we can add rule for shaded class allowed only, such as flink

klion26 avatar Mar 20 '24 06:03 klion26