TheAlgorithms / Java

All Algorithms implemented in Java
MIT License
58.51k stars 18.94k forks source link

[OTHER] Enable more checks in checkstyle #5119

Open vil02 opened 4 months ago

vil02 commented 4 months ago

What would you like to share?

5110 introduced checkstyle. The config file has some of the rules commented out. It might a good idea to introduce some of them and discuss why the other ones are not needed in this repository.

List of checks which should be introduced

Few of the obvious checks, which should be introduced:

(@siriak, @BamaCharanChhandogi feel free to edit the list above)

Additional information

How to contribute

  1. select one check form the list above such that no one else is working on (and is not done yet),
  2. write a comment "Hey, I am working on XYZ", where XYZ is your selected check,
  3. in your fork, please create a branch like enable_XYZ,
  4. uncomment the XYZ check in the checkstyle.xml,
  5. run mvn checkstyle:check and fix all of the errors - please keep your changes minimal,
  6. commit your changes with a message like "style: enable XYZ in checkstyle",
  7. create a pull-request and mention this issue by writing something like "Related to #5119".
vil02 commented 4 months ago

I will work on EmptyStatement.

marysiuniq commented 4 months ago

Hey, I will be working on ModifierOrder.

marysiuniq commented 4 months ago

Now, I will be working on ConstantName.

vil02 commented 4 months ago

I will work on RedundantModifier.

vil02 commented 4 months ago

I will slowly work on AvoidStarImport.

VedSansare89 commented 4 months ago

Hey, I will be working on MethodName

vil02 commented 4 months ago

I will work on ArrayTypeStyle.

vil02 commented 4 months ago

I will work on HideUtilityClassConstructor.

vil02 commented 4 months ago

@siriak, @BamaCharanChhandogi I have extended the list of obvious checks. Please have a look and edit the list if needed.

CodaBlurd commented 3 months ago

Hi, I will be working on FinalClass.

CodaBlurd commented 3 months ago

I will work on EqualsHashCode.

CodaBlurd commented 3 months ago

I will work on InnerAssignment.

CodaBlurd commented 3 months ago

I will work on LocalFinalVariableName.

vaibhav9t1 commented 3 months ago

Hey, I will work StaticVariableName.

vaibhav9t1 commented 3 months ago

Hi, I will work on MultipleVariableDeclarations.

BamaCharanChhandogi commented 3 months ago

I will work on MissingSwitchDefault

CodaBlurd commented 3 months ago

I will work on MethodName.

cpu-pixel commented 3 months ago

Hey, I'll be working on LocalVariableName. Additionally, I think LocalFinalVariableName is wrongly marked and checked as LocalVariableName.

vil02 commented 3 months ago

Additionally, I think LocalFinalVariableName is wrongly marked and checked as LocalVariableName.

@cpu-pixel Thanks for spotting that!

SAIVARDHAN15 commented 3 months ago

Hey, I'll be working on TypeName.

cpu-pixel commented 3 months ago

I'll be working on MemberName.

CodaBlurd commented 3 months ago

I will work on ParameterName.

StarDxxx commented 3 months ago

I will work on .OperatorWrap

StarDxxx commented 3 months ago

I will work on .TypeName.

samuelfac commented 2 months ago

I will work on ParenPad.

samuelfac commented 2 months ago

I will work on NeedBraces

samuelfac commented 2 months ago

I will work on AvoidNestedBlocks

samuelfac commented 2 months ago

I will work on InvalidJavadocPosition

samuelfac commented 2 months ago

WhitespaceAround it conflicts with clang-format. When I create the spaces clang-format undoes it and causes an error in the checkstyle.

vil02 commented 2 months ago

WhitespaceAround it conflicts with clang-format. When I create the spaces clang-format undoes it and causes an error in the checkstyle.

Please have a look at #5241.

But you are right: some of the checks (like GenericWhitespace, NoWhitespaceAfter) conflict the current clang-format config.

FishmmansCavalcante commented 1 month ago

I will work on enabling the TodoComment check in the checkstyle.xml file.

adityasarfare commented 2 weeks ago

Hey Can I work on something ?

siriak commented 2 weeks ago

@adityasarfare sure, see what checks are disabled with todo and feel free to enable them one-by-one https://github.com/TheAlgorithms/Java/blob/master/checkstyle.xml

vrp0211 commented 2 days ago

Hey, I am working on NoWhitespaceAfter

vrp0211 commented 1 day ago

Hey, I am working on NoWhitespaceAfter

Looks like NoWhitespaceAfter is conflicting with clang-format missed the earlier comment , closing the PR