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

[SEDONA-229] Fix Linter Issues in Viz #791

Merged
merged 12 commits into from
Mar 8, 2023

Conversation

douglasdennis
Copy link
Contributor

Did you read the Contributor Guide?

Is this PR related to a JIRA ticket?

What changes were proposed in this PR?

This PR addresses several linter issues in the sedona viz module. All of the fixes for these issues involve no real structural code changes, just formatting and being more explicit with imports. The types of changes in this PR:

  • Ignore imports from AWT, which is apparently an "illegal" import according to the linter. These seem mandatory for the viz module.
  • Wildcard imports were replaced with explicit imports for the classes needed.
  • An import was moved from inside of a method to be at the top.
  • Add spaces around a comment and plus operators.
  • Fixed long lines. I attempted to use the style guide located at https://docs.scala-lang.org/style/ If I got something wrong then please let me know.
  • Added newlines to the ends of files.

How was this patch tested?

Standard build process with unit tests.

Did this PR include necessary documentation updates?

  • No, this PR does not affect any public API so no need to change the docs.

@douglasdennis
Copy link
Contributor Author

douglasdennis commented Mar 8, 2023

This doesn't fix all linter issues in viz. There will be several follow up PRs to address issues that require real code/config changes. Is this level of granularity ok? I'm trying to avoid pushing too large of code changes, but I also don't want to annoy you with a bunch of PRs.

@jiayuasu
Copy link
Member

jiayuasu commented Mar 8, 2023

@douglasdennis This is perfectly fine. However, I wonder if scala has something similar to https://code.revelc.net/formatter-maven-plugin/ in the Java world. This will automatically fix styling issues instead of manually doing the job.

@jiayuasu jiayuasu added this to the sedona-1.4.0 milestone Mar 8, 2023
@jiayuasu jiayuasu merged commit fb1881e into apache:master Mar 8, 2023
@douglasdennis
Copy link
Contributor Author

@jiayuasu I found scalafmt (https://scalameta.org/scalafmt/). It looks like spotless (https://github.com/diffplug/spotless/tree/main/plugin-maven) uses it to handle Scala code as a maven plugin. I can explore that for handling the formatting related linter messages.

Would there be any interest to add this as a check to the build process?

@jiayuasu
Copy link
Member

jiayuasu commented Mar 8, 2023

@douglasdennis I think spotless is nice. Let's have it in Sedona. I think we should put it in the build process. Should we allow the build process automatically fix the format, or let the build process fail and we manually call mvn spotless:apply to fix it?

I kind of prefer the auto fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants