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

Add scalafmt #37

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Add scalafmt #37

wants to merge 1 commit into from

Conversation

NthPortal
Copy link
Contributor

No description provided.

@NthPortal
Copy link
Contributor Author

could probably use a check in the CI pipeline, but I don't know how

@SethTisue
Copy link
Member

SethTisue commented Nov 10, 2020

I don't mind having build.sbt be auto-formatted, but I don't see much advantage in it either, and I think it would actually be kind of annoying if PR validation failed just because of a whitespace difference in build.sbt

hmm. were you thinking we should do this in src/main and src/test as well? I see more value there (I'm not actually enthusiastic about it, but not opposed either)

@SethTisue SethTisue removed their request for review November 10, 2020 03:56
Copy link
Member

@sjrd sjrd left a comment

Choose a reason for hiding this comment

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

If we add scalafmt, the configuration had better be such that formatting matches the upstream scala repo, because eventually we'll want to merge the code of this repo with the standard library.

@@ -21,11 +22,11 @@ lazy val scalaLibraryNext = crossProject(JVMPlatform, JSPlatform)
scalaModuleMimaPreviousVersion := None,
scalacOptions ++= Seq("-deprecation", "-feature", "-Werror"),
libraryDependencies ++= Seq(
"org.scalacheck" %%% "scalacheck" % "1.15.0" % Test,
"org.scalacheck" %%% "scalacheck" % "1.15.0" % Test
Copy link
Member

@sjrd sjrd Nov 10, 2020

Choose a reason for hiding this comment

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

If there is one place where trailing commas are useful and desirable, it is in sbt settings ...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah, I know... this one annoyed me too.

I'm happy to try using always instead

Copy link
Contributor Author

Choose a reason for hiding this comment

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

and/or bug Olaf to add a new setting that does what we want ;)

Copy link
Member

Choose a reason for hiding this comment

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

sbt/sbt uses this:

trailingCommas = preserve

@NthPortal
Copy link
Contributor Author

the configuration had better be such that formatting matches the upstream scala repo

the upstream repo is entirely manually formatted, so I don't think that will be an issue

@NthPortal NthPortal added the help wanted Extra attention is needed label Nov 20, 2020
@martijnhoekstra
Copy link

You tagged this as help wanted, I assume with CI checking the fmt? I made a PR for that against this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants