Skip to content

Format code with scalafmt + test format via travis #129

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

Merged
merged 2 commits into from
Aug 3, 2018

Conversation

MasseGuillaume
Copy link
Contributor

No description provided.

chmod +x $SCALAFMT
fi

$SCALAFMT "$@"
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is it useful to run scalafmt on the CI?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's to make sure you don't push code that is not formatted. I create a separate matrix entry so you know that the CI failed only because the code was not formatted, and not more serious test failures.

Copy link
Contributor

@julienrf julienrf left a comment

Choose a reason for hiding this comment

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

Forcing to use a specific code formatter and a specific style looks more constraining than valuable to me. What problem did you encounter without using a code formatter?

@julienrf
Copy link
Contributor

julienrf commented Aug 3, 2018

How to legitimately agree on the code style to use? For instance, I prefer this style of scaladoc comments:

/**
  * Description
  */

over this one:

/**
 * Description
 */

@MasseGuillaume
Copy link
Contributor Author

MasseGuillaume commented Aug 3, 2018

I manually formatted code:

before:

implicit def sortedSetCompanionToCBF[A : Ordering, CC[X] <: SortedSet[X] with SortedSetLike[X, CC[X]]](fact: SortedSetFactory[CC]): CanBuildFrom[Any, A, CC[A]] =
simpleCBF(fact.newBuilder[A])

after:

implicit def sortedSetCompanionToCBF[
A: Ordering,
CC[X] <: c.SortedSet[X] with c.SortedSetLike[X, CC[X]]](
fact: SortedSetFactory[CC]): CanBuildFrom[Any, A, CC[A]] =
simpleCBF(fact.newBuilder[A])

@julienrf julienrf merged commit 787282b into scala:master Aug 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants