在https://scalameta.org/scalafmt/docs/installation.html之后,我正在尝试通过命令行重新格式化我的 Scala 代码。
如何执行scalafmt
命令?
sbt
我可以调用从项目加载scalafmt
吗?
使用以下返回错误:
sbt:skeleton> scalafmt
[error] Not a valid command: scalafmt (similar: last)
[error] Not a valid project ID: scalafmt
[error] Expected ':'
[error] Not a valid key: scalafmt (similar: scalaHome, scalaArtifacts, scalaInstance)
[error] scalafmt
[error] ^
sbt:skeleton> my-project/scalafmt
[error] Expected ':'
[error] Not a valid key: scalafmt (similar: scalaHome, scalaArtifacts, scalaInstance)
[error] my-project/scalafmt
[error] ^
sbt:skeleton>