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

Update SBT/scala frameworks #236

Closed
osopardo1 opened this issue Nov 27, 2023 · 3 comments
Closed

Update SBT/scala frameworks #236

osopardo1 opened this issue Nov 27, 2023 · 3 comments
Assignees
Labels
priority: normal This issue has normal priority status: done This issue is done

Comments

@osopardo1
Copy link
Member

osopardo1 commented Nov 27, 2023

Several things to do in the project regarding SBT and Scala frameworks.

  • Right now we are using scalastyle to cover the style and productivity of the code. Seems like the project has not been updated for long and scalafix could be a better library to use in the project.
  • Update plugins: delete the ones that are not used and update the versions.
  • Sbt version: update the version of the SBT building tool to the last one.
@osopardo1 osopardo1 added the type: enhancement Improvement of existing feature or code label Nov 27, 2023
@alexeiakimov
Copy link
Contributor

alexeiakimov commented Nov 28, 2023

Honestly I am not convinced because it seems the two tools have different purpose:

  1. Scalafmt is more about the code format
  2. Scalafix is more linter than formatter.
    According to https://github.com/scalameta/scalafmt the latest release 3.7.17 happened 2 weeks ago, so it does not look like abandoned.

Let's have a look from different angle, what is wrong with the current use of scalafmt? What functionality do we expect from such a tool and what is missing? For me personally the following features are essential

  1. The tool enforces the same format for all the source files (it means that any custom manual formatting is always replaced with the automatic one)
  2. The format operation is idempotent (it is important for the source control to avoid format-only changes)
  3. The format operation can be called from the build tool like sbt (we should not rely on IDE to format the code properly)
  4. The format enforced by the tool allows some customization, however the default format is good enough to be used out of the box (in other words the tool should not encourage us to invent our own format, instead it just allows to change a few parameters of the default one like the maximum line length).
  5. The tool allows to check if the source code is formatted properly, the check operation should be available from the build tool like sbt (it is important for CI).

Ideally IDE can support the tool and the format defined in the project, however it is optional.

IMHO the current setup of scalafmt meets all the requirements above except 1. The problem is that it does not organize imports, it preserves the imports as they are defined by the programmer. In theory IDEA and Metals both respect scalafmt and can use it for the code formatting, again we should not rely on the IDE in general. I think we need investigate if the configuration of scalafmt can be improved to fix this issue.

Regarding the upgrade of sbt, I think that it makes sense.

@alexeiakimov alexeiakimov self-assigned this Nov 28, 2023
@alexeiakimov
Copy link
Contributor

I was thinking that the problem is with scalafmt, since the task is to replace scala-style with more modern scalafix, then it looks promising. Apologies.

alexeiakimov added a commit to alexeiakimov/qbeast-spark that referenced this issue Nov 29, 2023
alexeiakimov added a commit to alexeiakimov/qbeast-spark that referenced this issue Nov 29, 2023
alexeiakimov added a commit to alexeiakimov/qbeast-spark that referenced this issue Nov 29, 2023
alexeiakimov added a commit to alexeiakimov/qbeast-spark that referenced this issue Nov 29, 2023
alexeiakimov added a commit to alexeiakimov/qbeast-spark that referenced this issue Nov 29, 2023
@alexeiakimov alexeiakimov added priority: normal This issue has normal priority status: in-progress This issue is in progress type: enhancement and removed type: enhancement Improvement of existing feature or code labels Nov 29, 2023
alexeiakimov added a commit to alexeiakimov/qbeast-spark that referenced this issue Dec 1, 2023
alexeiakimov added a commit to alexeiakimov/qbeast-spark that referenced this issue Dec 1, 2023
@alexeiakimov
Copy link
Contributor

The update is done for main-1.0.0. I suggest to close the issue.

@alexeiakimov alexeiakimov added status: done This issue is done and removed status: in-progress This issue is in progress labels Dec 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: normal This issue has normal priority status: done This issue is done
Projects
None yet
Development

No branches or pull requests

2 participants