olafurpg on v1.0.0-RC1
olafurpg on master
Upgrade to non-broken metaconfi… Merge pull request #946 from ol… (compare)
olafurpg on master
documentation fix: binPackParen… Merge pull request #945 from na… (compare)
I'm having some issue upgrading to 3.3.0, the alignment
case iaEx: IllegalArgumentException => errorFuture[Seq[User]](IllegalArgument(iaEx.getMessage))
- case e: Exception => errorFuture[Seq[User]](UnexpectedError(s"Unexpected error: ${e.getMessage}"))
+ case e: Exception => errorFuture[Seq[User]](UnexpectedError(s"Unexpected error: ${e.getMessage}"))
It's not aligned on the arrow anymore =>
and I don't know what changed
how do i ensure block-comment line-breaks are respected? For example, below original code:
/**
* General description:
* 1. point 1
* 2. point 2
*/
after formatting becomes
/** General description:
* 1. point 1 2. point 2
*/
instead, i would like to continue having line-breaks like the original code.
my scalafmt.conf is:
runner.dialect = scala3
version=3.4.0
i am using Intellij 2021.3.1
Or is
newlines.topLevelStatementBlankLines
meant to be the replacement?
How would I force rewrite if/else blocks to always have braces?
# original
if(cond)
foo()
else
bar()
# formatted
if(cond) {
foo()
} else {
bar()
}
If found scalameta/scalafmt#1463 but it was closed in Oct 2020.
newlines.source = fold
? Example: https://gist.github.com/desophos/19d53e9019ca78bb5adc01ac660f0f1c
What's the deal with single newlines being all over the place in case of i.e. method definitions (not sure what's the proper expression in scalafmt language)???
This makes the code look like shotgun edited and IMHO not exactly too readable. This creates confusion when a .scala file has more than one method. See this:
alignment = Pos.CenterRight
style = borderStyle
def createProgressPanel(): Node = new HBox(6):
val slider = new Slider()
val progressIndicator: ProgressIndicator = new ProgressIndicator():
/**
(and not /*
). if you read https://docs.scala-lang.org/overviews/scaladoc/for-library-authors.html#other-formatting-notes, you will see that in scaladoc, you don't write actual numbers, you use a label to indicate what numbering/bulleting type should be used when this scaladoc is output. scaladoc is a markup language, not intended for reading in .scala
but when it's output as .html
.
/*
or set docstrings.wrap = no
.
Our team uses the scalikejdbc library quite heavily, and as a team we would like to preserve the existing style of the queries we write.
However we cannot find the right configuration keys to toggle which would give us more flexibility with the method chaining in the scalafmt
configuration
Does anyone in this channel have any suggestions?
Below is an example of the style we would like to maintain, and what we want to avoid
// existing style
select
.from(Table1 as t1)
.innerJoin(Table2 as t2).on(sqls.eq(t2.someKey, t1.someKey))
.innerJoin(Table3 as t3).on(sqls.eq(t3.someKey, t2.someKey))
.where(???)
...
// what we wish to avoid
select
.from(Table1 as t1)
.innerJoin(Table2 as t2)
.on(sqls.eq(t2.someKey, t1.someKey))
.innerJoin(Table3 as t3)
.on(sqls.eq(t3.someKey, t2.someKey))
.where(???)
...
runner.dialect = scala3
):[error] org.scalafmt.dynamic.ScalafmtDynamicError$ScalafmtInterfaceMethodDeprecated: Method Scalafmt.withRespectVersion is deprecated
[error] at org.scalafmt.dynamic.ScalafmtDynamic.withRespectVersion(ScalafmtDynamic.scala:62)
is there any possibility not to break derives
section if it's short enough i.e
@SnakeCase case class Document(
@Rename("documentId") id: UUID,
issueDate: Instant,
@Embed author: Person,
) derives Config,
ConfiguredDecoder
to be kept as
@SnakeCase case class Document(
@Rename("documentId") id: UUID,
issueDate: Instant,
@Embed author: Person,
) derives Config, ConfiguredDecoder
The error is error: ] expected but double constant found
. The code in question is
type RefinedDouble = Double Refined Interval.Closed[-5, 5]
It looks like the -
in -5
is the problem.
I have another question:
In intellij enterprise edition the formatter works when I select all the file and click in Code/reformat code
But if I select one for example this line:
case class AAA(a: String, b: String, c: String, d: String)
If I try to reformat this line selecting it and clicking on Code/Reformat Code, it is not doing anything.
Hi, I have some trouble with fileOverride
seemingly not working. scalafmtAll
raised an error on Scala 3 test sources, showing it uses the default dialect Scala213Source3
whereas according fileOverride
in configuration, the scala3
dialect should be applied.
...
[error] org.scalafmt.sbt.ScalafmtSbtReporter$ScalafmtSbtError: scalafmt: /home/runner/work/anorm/anorm/core/src/test/scala-3/TestUtils.scala:7: error: [dialect scala213source3] ; expected but : found
...
Testing the glob
expression in bash, the file mentioned in the error is matching :
$ shopt -s globstar
$ ls **/src/*/scala-3/**/*.scala | grep TestUtils
core/src/test/scala-3/TestUtils.scala
Any hint?
Or I will create an issue.
Hello community,
I have a question related a case class:
case class Balance(
walletType: String,
currency: String,
amount: BigDecimal,
available: BigDecimal)
I would like this case class to be formatted multiline when it is super long that it exceeds the max columns, but in case it can fit in one line to stay in one line. Is it possible?
Dear Community members, can any one please guide me how to solve below issue ?
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=1000m; support was removed in 8.0
[info] welcome to sbt 1.6.2 (Oracle Corporation Java 1.8.0_171)
[info] loading settings for project ABC_project from plugins.sbt ...
[info] loading project definition from H:\ABC_Project\project
[info] loading settings for project root from build.sbt ...
[info] set current project to ABC_project (in build file:/H:/ABC_project/)
[info] Formatting 51 Scala sources...
[error] failed to download v=3.5.9: H:\ABC_Project\.scalafmt.conf
[error] (ABC_project / Compile / scalafmt) failed to download v=3.5.9: H:\ABC_Project\.scalafmt.conf
[error] Total time: 13 s, completed 17-Aug-2022 16:09:57
Versions used
SBT --> 1.6.2 v
Scala --> 2.12.14