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

Improve scalastyle rules to detect spaces #1493

Merged
merged 1 commit into from
Jan 10, 2025

Conversation

amahussein
Copy link
Collaborator

Signed-off-by: Ahmed Hussein (amahussein) [email protected]

Contributes to #1158

This pull request includes several changes to the core/scalastyle-config.xml file and updates to copyright years across multiple Scala files. Additionally, it includes minor code cleanups.

Updates to scalastyle-config.xml:

  • Added new style checks:
    • SpacesAfterPlusChecker, SpacesBeforePlusChecker, WhitespaceEndOfLineChecker
    • DisallowSpaceBeforeTokenChecker, SingleSpaceBetweenRParenAndLCurlyBrace, OmitBracesInCase
    • NewLineAtEofChecker, SpaceAfterCommentStartChecker, EnsureSingleSpaceBeforeTokenChecker, EnsureSingleSpaceAfterTokenChecker
    • TokenChecker for println statements
    • Disabled checks: ParameterNumberChecker, PublicMethodsHaveTypeChecker, NonASCIICharacterChecker

Signed-off-by: Ahmed Hussein (amahussein) <[email protected]>

Contributes to NVIDIA#1158
@amahussein amahussein added core_tools Scope the core module (scala) build labels Jan 9, 2025
@amahussein amahussein requested a review from parthosa January 9, 2025 21:58
@amahussein amahussein self-assigned this Jan 9, 2025
@parthosa
Copy link
Collaborator

parthosa commented Jan 9, 2025

Thanks @amahussein for this change. Is there any standard scalastyle rule file that is accepted by the community (e.g. Spark repo)? Should we use that for standardization?

@amahussein
Copy link
Collaborator Author

Thanks @amahussein for this change. Is there any standard scalastyle rule file that is accepted by the community (e.g. Spark repo)? Should we use that for standardization?

Yes, we use the same scala style set by Spark.
The catch that Spark main branch has migrated to scala-2.13 already. I pulled some of the rules that are focused on code styling from https://github.com/apache/spark/blob/branch-3.5/scalastyle-config.xml . Blanks and comment styling were repeated problems we had in many PRs.
Later, we can pull other rules as we head toward supporting scala-2.13

Copy link
Collaborator

@parthosa parthosa left a comment

Choose a reason for hiding this comment

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

That makes sense. Thanks @amahussein for these changes. LGTME.

@amahussein amahussein merged commit 1f037fa into NVIDIA:dev Jan 10, 2025
14 checks passed
@amahussein amahussein deleted the rapids-tools-1158-cont-00 branch January 10, 2025 19:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build core_tools Scope the core module (scala)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants