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

scalafmt: enable AvoidInfix rewrite #3890

Merged
merged 1 commit into from
Apr 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .scalafmt.conf
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ project {
sbt-test
bin/issue
]
layout = StandardConvention
}
align {
preset = none
Expand All @@ -19,6 +20,7 @@ newlines {
}
rewrite {
rules = [
AvoidInfix,
Imports,
RedundantBraces,
RedundantParens,
Expand Down
3 changes: 2 additions & 1 deletion project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ object Dependencies {

val scalacheck = "org.scalacheck" %% "scalacheck" % scalacheckV
val munit = Def.setting("org.scalameta" %%% "munit" % munitV)
val scalameta = Def.setting("org.scalameta" %%% "scalameta" % scalametaV excludeAll scalapb.value)
val scalameta = Def
.setting(("org.scalameta" %%% "scalameta" % scalametaV).excludeAll(scalapb.value))

val metaconfig = Def.setting("com.geirsson" %%% "metaconfig-core" % metaconfigV)
val metaconfigTypesafe = Def.setting("com.geirsson" %%% "metaconfig-typesafe-config" % metaconfigV)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,15 +232,15 @@ object TermDisplay {

val extra0 =
if (extra.length > baseExtraWidth) extra
.take((baseExtraWidth max (extra.length - overflow)) - 1) + "…"
.take((baseExtraWidth.max(extra.length - overflow)) - 1) + "…"
else extra

val total0 = url.length + 1 + extra0.length
val overflow0 = total0 - width + 1

val url0 =
if (total0 >= width) url.take(
((width - baseExtraWidth - 1) max (url.length - overflow0)) - 1,
((width - baseExtraWidth - 1).max(url.length - overflow0)) - 1,
) + "…"
else url

Expand Down
Loading