Skip to content

[BUG] Update the scala style and code formatter #1158

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
amahussein opened this issue Jul 2, 2024 · 1 comment
Closed

[BUG] Update the scala style and code formatter #1158

amahussein opened this issue Jul 2, 2024 · 1 comment
Assignees
Labels
build core_tools Scope the core module (scala) documentation Improvements or additions to documentation

Comments

@amahussein
Copy link
Collaborator

amahussein commented Jul 2, 2024

Describe the bug

The repo does not have a valid formatted code style for the IDE. In order to be consistent with the RAPIDS plugin repo we need to:

There is a separate issue to support scala2.13 #888

### Tasks
- [ ] https://github.com/NVIDIA/spark-rapids-tools/pull/1205
- [ ] https://github.com/NVIDIA/spark-rapids-tools/pull/1493
- [ ] https://github.com/NVIDIA/spark-rapids-tools/issues/1507
@amahussein amahussein added documentation Improvements or additions to documentation ? - Needs Triage core_tools Scope the core module (scala) build and removed ? - Needs Triage labels Jul 2, 2024
@amahussein
Copy link
Collaborator Author

There is a bug in scalastyle that does not allow setting regex for file headers.
It seems only exact match works. version 1.0.x

amahussein added a commit to amahussein/spark-rapids-tools that referenced this issue Jul 19, 2024
Signed-off-by: Ahmed Hussein (amahussein) <[email protected]>

Contributes to NVIDIA#1158

- add trailing-whitespace check to the pre-commit hooks to avoid
  whitespaces at the end of lines
- add E-O-F fixer to make sure that only a single newline is at the end
  of each committed file
- added a script to check that newly added files have the header.
- pulled the intelli-j idea from RAPIDS plugin and update the the README
  file. No link is added because the markdown checker could cause the
build to fail until a release is made.
@amahussein amahussein self-assigned this Jul 19, 2024
amahussein added a commit that referenced this issue Jul 22, 2024
* Update pre-commit hooks to check for headers and white-spaces

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

Contributes to #1158

- add trailing-whitespace check to the pre-commit hooks to avoid
  whitespaces at the end of lines
- add E-O-F fixer to make sure that only a single newline is at the end
  of each committed file
- added a script to check that newly added files have the header.
- pulled the intelli-j idea from RAPIDS plugin and update the the README
  file. No link is added because the markdown checker could cause the
build to fail until a release is made.

* Remove unnecessary echo

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

* address README comments

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

* address README comments

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

---------

Signed-off-by: Ahmed Hussein (amahussein) <[email protected]>
amahussein added a commit to amahussein/spark-rapids-tools that referenced this issue Jan 9, 2025
Signed-off-by: Ahmed Hussein (amahussein) <[email protected]>

Contributes to NVIDIA#1158
amahussein added a commit that referenced this issue Jan 10, 2025
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`
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) documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

1 participant