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

Enable scalafmt on this project #4037

Open
He-Pin opened this issue May 10, 2020 · 11 comments
Open

Enable scalafmt on this project #4037

He-Pin opened this issue May 10, 2020 · 11 comments
Labels
internal Not visible to users of Scala.js (only by devs in this repo)

Comments

@He-Pin
Copy link

He-Pin commented May 10, 2020

As the scala-native will learn more from this project, and the scala-native current has scalafmt 2.4.2 enabled, let this project formatted with scalafmt will help for code sharing.
refs:#2701
refs:scala-native/scala-native#1787

@sjrd
Copy link
Member

sjrd commented May 10, 2020

This was tried before, but scalafmt wasn't up to the standard of formatting in this codebase.

Does scalafmt support binpacking well, these days?

@sjrd
Copy link
Member

sjrd commented May 10, 2020

If someone comes up with a PR for enabling scalafmt even in just one meaningful project (such as library or linker) and that doesn't cause more 1 non-fix formatting change per 1000 loc, we can consider it.

@He-Pin
Copy link
Author

He-Pin commented May 10, 2020

I think this should be better to hold a llittle longer
refs: https://github.com/scalameta/scalafmt/issues?q=is%3Aissue+is%3Aopen+label%3Abug

@gzm0
Copy link
Contributor

gzm0 commented May 11, 2020

What do you mean by a "non-fix formatting change"?

@sjrd
Copy link
Member

sjrd commented May 11, 2020

A fix formatting change would be a change where scalafmt actually fixes the formatting according to your existing standards. So that would be somewhere where we had already let badly-formatted code into the codebase. I'm happy for scalafmt to correct those if it finds them.

A non-fix formatting change would be a change where scalafmt reformatted something that was already correct by our standards.

@gzm0
Copy link
Contributor

gzm0 commented May 11, 2020

OK, got it. That means (minor) changes to our coding standards for the sake of being able to use scalafmt are out of scope entirely?

@sjrd
Copy link
Member

sjrd commented May 11, 2020

I don't want to make any blanket statement, so I wouldn't say "out of scope entirely", but "most likely out of scope". The issue with changes in coding standard, applied by a tool, is that even when minor, they tend to affect a very large portion of lines of code. And that is so many lines of code for which blame will be deteriorated.

Also the trouble with such tools is that they evolve themselves, and change things. So when you upgrade, your coding style changes and you have another wave of changes everywhere, further deteriorating your blame experience.

@sjrd sjrd added the internal Not visible to users of Scala.js (only by devs in this repo) label May 11, 2020
@gzm0
Copy link
Contributor

gzm0 commented Oct 6, 2020

/cc @MaximeKjaer

@gzm0
Copy link
Contributor

gzm0 commented Oct 12, 2020

@sjrd
Copy link
Member

sjrd commented Oct 12, 2020

That looks extremely useful!

@MaximeKjaer
Copy link
Contributor

I am indeed planning to open a PR based on the argument in that link quite soon 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internal Not visible to users of Scala.js (only by devs in this repo)
Projects
None yet
Development

No branches or pull requests

4 participants