Skip to content

[OTHER] Enable more checks in checkstyle #5119

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

Closed
26 tasks done
vil02 opened this issue Apr 25, 2024 · 42 comments
Closed
26 tasks done

[OTHER] Enable more checks in checkstyle #5119

vil02 opened this issue Apr 25, 2024 · 42 comments

Comments

@vil02
Copy link
Member

vil02 commented Apr 25, 2024

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 [OTHER] Enable more checks in checkstyle #5119".
@vil02 vil02 added the awaiting triage Awaiting triage from a maintainer label Apr 25, 2024
@vil02
Copy link
Member Author

vil02 commented Apr 26, 2024

I will work on EmptyStatement.

@marysiuniq
Copy link
Contributor

Hey, I will be working on ModifierOrder.

@marysiuniq
Copy link
Contributor

Now, I will be working on ConstantName.

@vil02
Copy link
Member Author

vil02 commented May 3, 2024

I will work on RedundantModifier.

@vil02
Copy link
Member Author

vil02 commented May 4, 2024

I will slowly work on AvoidStarImport.

@VedSansare89
Copy link

Hey, I will be working on MethodName

@vil02
Copy link
Member Author

vil02 commented May 6, 2024

I will work on ArrayTypeStyle.

@vil02
Copy link
Member Author

vil02 commented May 7, 2024

I will work on HideUtilityClassConstructor.

@vil02
Copy link
Member Author

vil02 commented May 9, 2024

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

@CodaBlurd
Copy link
Contributor

CodaBlurd commented May 10, 2024

Hi, I will be working on FinalClass.

@CodaBlurd
Copy link
Contributor

I will work on EqualsHashCode.

@CodaBlurd
Copy link
Contributor

I will work on InnerAssignment.

@StarDxxx
Copy link
Contributor

StarDxxx commented Jun 7, 2024

I will work on .OperatorWrap

@StarDxxx
Copy link
Contributor

StarDxxx commented Jun 8, 2024

I will work on .TypeName.

@StarDxxx StarDxxx mentioned this issue Jun 8, 2024
6 tasks
@samuelfac
Copy link
Contributor

I will work on ParenPad.

@samuelfac
Copy link
Contributor

I will work on NeedBraces

@samuelfac
Copy link
Contributor

I will work on AvoidNestedBlocks

@samuelfac
Copy link
Contributor

I will work on InvalidJavadocPosition

@samuelfac
Copy link
Contributor

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

@vil02
Copy link
Member Author

vil02 commented Jun 19, 2024

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
Copy link

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

@adityasarfare
Copy link

Hey Can I work on something ?

@siriak
Copy link
Member

siriak commented Aug 21, 2024

@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
Copy link

vrp0211 commented Sep 4, 2024

Hey, I am working on NoWhitespaceAfter

@vrp0211
Copy link

vrp0211 commented Sep 5, 2024

Hey, I am working on NoWhitespaceAfter

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

@Brijeshthummar02
Copy link

Hey, I am working on TodoComment.

1 similar comment
@tanishkagupta27
Copy link

Hey, I am working on TodoComment.

@shamsulalam1114
Copy link

Hey, I am working on MissingSwitchDefault

@hrishi0902
Copy link

Hey, I am working on WhitespaceAround

@ananyadhagat
Copy link

Hey, I am working on TodoComment

@nishchalgv1
Copy link
Contributor

Hey, I am working on TodoComment

@vil02
Copy link
Member Author

vil02 commented Oct 13, 2024

@BamaCharanChhandogi, @CodaBlurd, @StarDxxx, @cpu-pixel, @marysiuniq, @nishchalgv1, @samuelfac, @vaibhav9t1: we did it! We not only improved the quality of the existing code, but also of all of the future code. Thanks for the effort!

@siriak, @BamaCharanChhandogi, @alxkm: I will close this issue as done, since the remaindering checks require some more discussion.

@vil02 vil02 closed this as completed Oct 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests