In a scala project where we are using IntelliJ community edition, we want to use multiple packages per file, so that we can reference them with shorter syntax:
package com.dreamlines.dragonfly
package api
package domain
package harbours
import…
I have the scala format plugin in my multi project sbt repository.
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.3.2")
So in the sbt console if I run scalafmt it works fine
My build.sbt has:
scalafmtOnCompile := true
If I do a…
I have bunch of scala projects. They shall share a common code style. I am using scalafmt to enforce certain rules, yet I have to create a
.scalafmt.conf
for each project. If the team changes the scalafmt rules, we'd have to change it for each…
Is there a scalafmt config which is reformat code the same way like IntelliJ with scala plugin does now ?
I have a problem with configuring it, and my team mates use IntelliJ only I VsCode and very often I need just open IntelliJ to reformat code…
I want Scalafmt to accept this kind of formatting:
val result = longMethodName(
a, b, c, d)
But currently it gets turned into:
val result = longMethodName(
a,
b,
c,
d)
When the parameters are short the first form is much more pleasing.…
I have a set of Scala projects and for all of those projects, I would like to introduce some scala source code formatting for which purpose, I'm using the scamafmt sbt pliugin. I have compiled the config file and this config file is in a separate…
my .scalafmt.conf file content is:
version = 3.5.4
Intellij downloaded scalafmt for this version:
but when I want to format file I have error saying literally nothing:
IntelliJ Version:
IntelliJ IDEA 2022.1.1 (Community Edition)
Build…
I would like to sort the functions in the following objects alphabetically
object A {
def bfunc() = ???
def afunc() = ???
}
would get sorted to
object A {
def afunc() = ???
def bfunc() = ???
}
I tried to look through scala fmt docs, no…
I am using: Linux, VS Code, Dotty, Metals, SBT, scalafmt
From the shell sbt scalaftm formats my files.
From the editor I can do ctrl + shift + I, I get an error message:
There is no formatter for 'scala' files installed.
It allows me to install a…
By default scalafmt will reformat code like this
myList(elem =>
elem
.doThing
.doOtherThing
)
to look like this
myList(
elem =>
elem
.doThing
.doOtherThing
)
How can it be configured to leave the anonymous function…
When there's multiple-line-string in a function call as parameter, my scalafmt will always put the start of it in the same line of previous codes, and the following string lines will have a long indent based on start position of string start. for…
I'm trying to gently introduce scalafmt to a large existing codebase and I want it to make virtually no changes except for a handful of noncontroversial settings the whole team can agree on.
With some settings like maxColumn I can override the…
In scala using scalafmt and having the following content in my .scalafmt.conf file:
style = default
maxColumn = 120
continuationIndent.callSite = 2
continuationIndent.defnSite = 2
align.openParenDefnSite = false
align.openParenCallSite =…
I want to keep a single empty line in the List definition using the scalafmt formatter:
List(
"some-random-string1"
.trim
.stripMargin,
"some-random-string2"
.intern
.dropRight(3),
"some-random-string3"
.takeRight(4)
…
Im experiencing some issues with scalafmt. My problem is that when running scalafmtCheck, it tries to download dynamically scalafmt core. I followed the documentation https://scalameta.org/scalafmt/docs/installation.html#sbt , and i put my sbt…