Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/scala/18.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在sbt程序集中运行scalafmtCheck_Scala_Sbt - Fatal编程技术网

在sbt程序集中运行scalafmtCheck

在sbt程序集中运行scalafmtCheck,scala,sbt,Scala,Sbt,我想在sbt程序集中运行scalafmtCheck。我试图补充: (compile in Compile) := ((compile in Compile) dependsOn scalafmtCheck).value 我犯了那个错误: [error] References to undefined settings: [error] [error] submissions / scalafmtCheck from submissions / Compile / compile (/h

我想在
sbt程序集中运行
scalafmtCheck
。我试图补充:

(compile in Compile) := ((compile in Compile) dependsOn scalafmtCheck).value
我犯了那个错误:

[error] References to undefined settings: 
[error] 
[error]   submissions / scalafmtCheck from submissions / Compile / compile (/home/yass/Documents/Invenis/iss/build.sbt:45)
[error]      Did you mean submissions / Compile / scalafmtCheck ?
[error] 
[error]   scalafmtCheck from Compile / compile (/home/yass/Documents/Invenis/iss/build.sbt:45)
[error]      Did you mean Compile / scalafmtCheck ?
[error]

知道吗?

你就快到了
scalafmtCheck
也是一项任务,因此需要范围。您需要做的是:

Compile / compile := (Compile / compile).dependsOn(Compile / scalafmtCheck).value
如果要将其添加到装配阶段,可以执行以下操作:

assembly := assembly.dependsOn(Compile / scalafmtCheck).value
Compile / compile := (Compile / compile).dependsOn(Test / scalafmtCheck).value
如果您希望格式也将其应用于测试,您可以执行以下操作:

assembly := assembly.dependsOn(Compile / scalafmtCheck).value
Compile / compile := (Compile / compile).dependsOn(Test / scalafmtCheck).value
或仅在装配阶段:

assembly := assembly.dependsOn(Test / scalafmtCheck).value