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

Doc examples involving align.tokens are not working as expected (due to overflowing maxColumn?) #3728

Closed
smarter opened this issue Dec 6, 2023 · 1 comment · Fixed by #3733

Comments

@smarter
Copy link

smarter commented Dec 6, 2023

Configuration (required)

version  = "3.7.17"
...

Command-line parameters (required)

None

Steps

https://scalameta.org/scalafmt/docs/configuration.html#alignpreset has examples involving code = "%" as well as code = ":", but the formatted output displayed in the doc for these examples does not actually align on these tokens, for example:

val x = List(
  "org.scala-lang" %% "scala-compiler" % scalaVersion.value,
  "com.lihaoyi" %% "sourcecode" % "0.1.1"
)

So it seems scalafmt isn't behaving as expected here?

@smarter
Copy link
Author

smarter commented Dec 6, 2023

Ah, it looks like the doc examples regressed in 93996d1 based on 0dfea6b which disabled aligning when it lead to lines that would be too long, so I guess the examples need to be adapted to specify a longer max column.

@smarter smarter changed the title Is align.tokens broken? Doc examples involving align.tokens are not working as expected (due to overflowing maxColumn?) Dec 6, 2023
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 a pull request may close this issue.

1 participant