You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, there is no automated workaround within scalafmt. Manual correction or custom scripts are the only options.
Notes
This feature would align scalafmt with the widely accepted camelCase convention in Scala.
A similar feature request has been discussed for other languages, suggesting a broader need.
While exploring solutions in the OpenXiangShan project, a custom Python script was developed, highlighting the lack of existing tooling for this conversion.
scalafmt cannot do what you want. it's a syntactic tool, and you need a semantic tool instead, such as scalafix.
you should resubmit this in scalafix and, in the meantime, add a scalastyle rule such as a ClassNamesChecker to validate camels, snakes or kebabs, as needed.
P.S. The comment below was true a year ago.
version = 3.7.3 // Latest scalafmt version as of May 21, 2024
Configuration (required)
Command-line parameters (required)
When I run scalafmt via CLI like this:
it does not automatically convert snake_case to camelCase.
Steps
Given code like this:
Problem
Scalafmt does not modify the naming convention and leaves the code unchanged:
Expectation
I would like the formatted output to look like this:
Workaround
Currently, there is no automated workaround within scalafmt. Manual correction or custom scripts are the only options.
Notes
The text was updated successfully, but these errors were encountered: