sbt-github-actions icon indicating copy to clipboard operation
sbt-github-actions copied to clipboard

Add scalafmt code formatter

Open mdedetrich opened this issue 2 years ago • 2 comments

I would like to propose adding scalafmt to this codebase for the same set of obvious reasons why having a code formatter is a good idea. The typical problem with adding a code formatter is it causes merge conflicts for currently open PR's however scalafmt is in a stage where there are only a couple of major PR's which are planned to be merged soon i.e.

  • https://github.com/sbt/sbt-github-actions/pull/65
  • https://github.com/sbt/sbt-github-actions/pull/136
  • https://github.com/sbt/sbt-github-actions/pull/66
  • https://github.com/sbt/sbt-github-actions/pull/98

The idea would be to introduce scalafmt after these PR's are merged. In regards to the actual scalafmt configuration, I am personally not that fussed. From introducing scalafmt to other projects usually there are 2 approaches to this, either try to find configuration that matches current style as much as possible (which can be a bit of work) or to just use something basic and deal with a large diff

@eed3si9n @armanbilge Thoughts?

mdedetrich avatar Feb 25 '23 12:02 mdedetrich

just use something basic and deal with a large diff

that's fine. we can do the formatting in a separate commit and add it to .git-blame-ignore-revs.

armanbilge avatar Feb 25 '23 15:02 armanbilge

that's fine. we can do the formatting in a separate commit and add it to .git-blame-ignore-revs.

Perfect, specifically with .git-blame-ignore-revs I have already done this in Pekko and I can confirm it works without problems (almost every IDE/editor/tool that I can think of defers to git for git blame so it will respect .git-blame-ignore-revs).

mdedetrich avatar Feb 25 '23 15:02 mdedetrich