Scalafmt 3.7.2 的 spaces 配置项有以下几种:

  1. indent: 缩进的空格数,默认为 2。

  2. continuationIndent: 换行后的缩进空格数,默认为 2。

  3. braceStyle: 大括号的样式,可以设置为 classic、next、sameLine、sameLineMin、functionDecl,具体含义可以参考 Scalafmt 文档,默认为 next。

  4. spaceBeforeContextBoundColon: 类型参数中的上下文界定冒号前是否有空格,默认为 false。

  5. spaceInsideBrackets: 是否在括号内部添加空格,默认为 false。

  6. spaceInsideParentheses: 是否在圆括号内部添加空格,默认为 false。

  7. spaceBeforeColon: 冒号前是否添加空格,默认为 true。

  8. spaceAfterColon: 冒号后是否添加空格,默认为 true。

  9. spaceBeforeContextBoundColon: 类型参数中的上下文界定冒号前是否有空格,默认为 false。

  10. spaceBeforeTypeColon: 类型注解中的冒号前是否有空格,默认为 true。

  11. spaceAfterTypeColon: 类型注解中的冒号后是否有空格,默认为 true。

  12. spaceBeforeInfixOperator: 中缀操作符前是否有空格,默认为 true。

  13. spaceAfterInfixOperator: 中缀操作符后是否有空格,默认为 true。

  14. spaceBeforeLambdaArrow: lambda 表达式中箭头前是否有空格,默认为 true。

  15. spaceAfterLambdaArrow: lambda 表达式中箭头后是否有空格,默认为 true。

  16. spacesInImportCurlyBraces: import 语句中花括号内部是否添加空格,默认为 false。

  17. spacesWithinPatternBinders: 模式匹配中模式绑定器是否添加空格,默认为 false。

Scalafmt372的spaces配置项有哪些

原文地址: https://www.cveoy.top/t/topic/8U5 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录