Skip to content

Commit 70bb2dc

Browse files
committed
Apply formatting
1 parent e2ab606 commit 70bb2dc

File tree

10 files changed

+167
-181
lines changed

10 files changed

+167
-181
lines changed

modules/build/src/main/scala/scala/build/Build.scala

Lines changed: 86 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -43,17 +43,17 @@ trait Build {
4343
object Build {
4444

4545
final case class Successful(
46-
inputs: Module,
47-
options: BuildOptions,
48-
scalaParams: Option[ScalaParameters],
49-
scope: Scope,
50-
sources: Sources,
51-
artifacts: Artifacts,
52-
project: Project,
53-
output: os.Path,
54-
diagnostics: Option[Seq[(Either[String, os.Path], bsp4j.Diagnostic)]],
55-
generatedSources: Seq[GeneratedSource],
56-
isPartial: Boolean
46+
inputs: Module,
47+
options: BuildOptions,
48+
scalaParams: Option[ScalaParameters],
49+
scope: Scope,
50+
sources: Sources,
51+
artifacts: Artifacts,
52+
project: Project,
53+
output: os.Path,
54+
diagnostics: Option[Seq[(Either[String, os.Path], bsp4j.Diagnostic)]],
55+
generatedSources: Seq[GeneratedSource],
56+
isPartial: Boolean
5757
) extends Build {
5858
def success: Boolean = true
5959
def successfulOpt: Some[this.type] = Some(this)
@@ -166,24 +166,24 @@ object Build {
166166
}
167167

168168
final case class Failed(
169-
inputs: Module,
170-
options: BuildOptions,
171-
scope: Scope,
172-
sources: Sources,
173-
artifacts: Artifacts,
174-
project: Project,
175-
diagnostics: Option[Seq[(Either[String, os.Path], bsp4j.Diagnostic)]]
169+
inputs: Module,
170+
options: BuildOptions,
171+
scope: Scope,
172+
sources: Sources,
173+
artifacts: Artifacts,
174+
project: Project,
175+
diagnostics: Option[Seq[(Either[String, os.Path], bsp4j.Diagnostic)]]
176176
) extends Build {
177177
def success: Boolean = false
178178
def successfulOpt: None.type = None
179179
def outputOpt: None.type = None
180180
}
181181

182182
final case class Cancelled(
183-
inputs: Module,
184-
options: BuildOptions,
185-
scope: Scope,
186-
reason: String
183+
inputs: Module,
184+
options: BuildOptions,
185+
scope: Scope,
186+
reason: String
187187
) extends Build {
188188
def success: Boolean = false
189189
def successfulOpt: None.type = None
@@ -195,9 +195,9 @@ object Build {
195195
* Using only the command-line options not the ones from the sources.
196196
*/
197197
def updateInputs(
198-
inputs: Module,
199-
options: BuildOptions,
200-
testOptions: Option[BuildOptions] = None
198+
inputs: Module,
199+
options: BuildOptions,
200+
testOptions: Option[BuildOptions] = None
201201
): Module = {
202202

203203
// If some options are manually overridden, append a hash of the options to the project name
@@ -229,9 +229,7 @@ object Build {
229229
logger,
230230
options.suppressWarningOptions,
231231
options.internal.exclude
232-
)
233-
234-
private def build(
232+
)private def build(
235233
inputs: Module,
236234
crossSources: CrossSources,options: BuildOptions,
237235
logger: Logger,
@@ -424,17 +422,17 @@ object Build {
424422
}
425423

426424
private def build(
427-
inputs: Module,
428-
sources: Sources,
429-
generatedSources: Seq[GeneratedSource],
430-
options: BuildOptions,
431-
scope: Scope,
432-
logger: Logger,
433-
buildClient: BloopBuildClient,
434-
compiler: ScalaCompiler,
435-
buildTests: Boolean,
436-
partial: Option[Boolean],
437-
actionableDiagnostics: Option[Boolean]
425+
inputs: Module,
426+
sources: Sources,
427+
generatedSources: Seq[GeneratedSource],
428+
options: BuildOptions,
429+
scope: Scope,
430+
logger: Logger,
431+
buildClient: BloopBuildClient,
432+
compiler: ScalaCompiler,
433+
buildTests: Boolean,
434+
partial: Option[Boolean],
435+
actionableDiagnostics: Option[Boolean]
438436
)(using ScalaCliInvokeData): Either[BuildException, Build] = either {
439437

440438
val build0 = value {
@@ -496,9 +494,9 @@ object Build {
496494
root / Constants.workspaceDirName / projectName.name / s"resources-${scope.name}"
497495

498496
def scalaNativeSupported(
499-
options: BuildOptions,
500-
inputs: Module,
501-
logger: Logger
497+
options: BuildOptions,
498+
inputs: Module,
499+
logger: Logger
502500
): Either[BuildException, Option[ScalaNativeCompatibilityError]] =
503501
either {
504502
val scalaParamsOpt = value(options.scalaParams)
@@ -635,16 +633,16 @@ object Build {
635633
}
636634

637635
def watch(
638-
inputs: Module,
639-
options: BuildOptions,
640-
compilerMaker: ScalaCompilerMaker,
641-
docCompilerMakerOpt: Option[ScalaCompilerMaker],
642-
logger: Logger,
643-
crossBuilds: Boolean,
644-
buildTests: Boolean,
645-
partial: Option[Boolean],
646-
actionableDiagnostics: Option[Boolean],
647-
postAction: () => Unit = () => ()
636+
inputs: Module,
637+
options: BuildOptions,
638+
compilerMaker: ScalaCompilerMaker,
639+
docCompilerMakerOpt: Option[ScalaCompilerMaker],
640+
logger: Logger,
641+
crossBuilds: Boolean,
642+
buildTests: Boolean,
643+
partial: Option[Boolean],
644+
actionableDiagnostics: Option[Boolean],
645+
postAction: () => Unit = () => ()
648646
)(action: Either[BuildException, Builds] => Unit)(using ScalaCliInvokeData): Watcher = {
649647

650648
val buildClient = BloopBuildClient.create(
@@ -839,15 +837,15 @@ object Build {
839837
* a bloop [[Project]]
840838
*/
841839
def buildProject(
842-
inputs: Module,
843-
sources: Sources,
844-
generatedSources: Seq[GeneratedSource],
845-
options: BuildOptions,
846-
compilerJvmVersionOpt: Option[Positioned[Int]],
847-
scope: Scope,
848-
logger: Logger,
849-
artifacts: Artifacts,
850-
maybeRecoverOnError: BuildException => Option[BuildException] = e => Some(e)
840+
inputs: Module,
841+
sources: Sources,
842+
generatedSources: Seq[GeneratedSource],
843+
options: BuildOptions,
844+
compilerJvmVersionOpt: Option[Positioned[Int]],
845+
scope: Scope,
846+
logger: Logger,
847+
artifacts: Artifacts,
848+
maybeRecoverOnError: BuildException => Option[BuildException] = e => Some(e)
851849
): Either[BuildException, Project] = either {
852850

853851
val allSources = sources.paths.map(_._1) ++ generatedSources.map(_.generated)
@@ -1031,16 +1029,16 @@ object Build {
10311029
}
10321030

10331031
def prepareBuild(
1034-
inputs: Module,
1035-
sources: Sources,
1036-
generatedSources: Seq[GeneratedSource],
1037-
options: BuildOptions,
1038-
compilerJvmVersionOpt: Option[Positioned[Int]],
1039-
scope: Scope,
1040-
compiler: ScalaCompiler,
1041-
logger: Logger,
1042-
buildClient: BloopBuildClient,
1043-
maybeRecoverOnError: BuildException => Option[BuildException] = e => Some(e)
1032+
inputs: Module,
1033+
sources: Sources,
1034+
generatedSources: Seq[GeneratedSource],
1035+
options: BuildOptions,
1036+
compilerJvmVersionOpt: Option[Positioned[Int]],
1037+
scope: Scope,
1038+
compiler: ScalaCompiler,
1039+
logger: Logger,
1040+
buildClient: BloopBuildClient,
1041+
maybeRecoverOnError: BuildException => Option[BuildException] = e => Some(e)
10441042
): Either[BuildException, (os.Path, Option[ScalaParameters], Artifacts, Project, Boolean)] =
10451043
either {
10461044

@@ -1112,15 +1110,15 @@ object Build {
11121110
}
11131111

11141112
def buildOnce(
1115-
inputs: Module,
1116-
sources: Sources,
1117-
generatedSources: Seq[GeneratedSource],
1118-
options: BuildOptions,
1119-
scope: Scope,
1120-
logger: Logger,
1121-
buildClient: BloopBuildClient,
1122-
compiler: ScalaCompiler,
1123-
partialOpt: Option[Boolean]
1113+
inputs: Module,
1114+
sources: Sources,
1115+
generatedSources: Seq[GeneratedSource],
1116+
options: BuildOptions,
1117+
scope: Scope,
1118+
logger: Logger,
1119+
buildClient: BloopBuildClient,
1120+
compiler: ScalaCompiler,
1121+
partialOpt: Option[Boolean]
11241122
): Either[BuildException, Build] = either {
11251123

11261124
if (options.platform.value == Platform.Native)
@@ -1282,14 +1280,14 @@ object Build {
12821280
else path.toString
12831281

12841282
private def jmhBuild(
1285-
inputs: Module,
1286-
build: Build.Successful,
1287-
logger: Logger,
1288-
javaCommand: String,
1289-
buildClient: BloopBuildClient,
1290-
compiler: ScalaCompiler,
1291-
buildTests: Boolean,
1292-
actionableDiagnostics: Option[Boolean]
1283+
inputs: Module,
1284+
build: Build.Successful,
1285+
logger: Logger,
1286+
javaCommand: String,
1287+
buildClient: BloopBuildClient,
1288+
compiler: ScalaCompiler,
1289+
buildTests: Boolean,
1290+
actionableDiagnostics: Option[Boolean]
12931291
)(using ScalaCliInvokeData): Either[BuildException, Option[Build]] = either {
12941292
val jmhProjectName = inputs.projectName.name + "_jmh"
12951293
val jmhOutputDir = inputs.workspace / Constants.workspaceDirName / jmhProjectName

modules/build/src/main/scala/scala/build/CrossSources.scala

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -156,12 +156,12 @@ object CrossSources {
156156
* a CrossSources and Inputs which contains element processed from using directives
157157
*/
158158
def forModuleInputs(
159-
inputs: Module,
160-
preprocessors: Seq[Preprocessor],
161-
logger: Logger,
162-
suppressWarningOptions: SuppressWarningOptions,
163-
exclude: Seq[Positioned[String]] = Nil,
164-
maybeRecoverOnError: BuildException => Option[BuildException] = e => Some(e)
159+
inputs: Module,
160+
preprocessors: Seq[Preprocessor],
161+
logger: Logger,
162+
suppressWarningOptions: SuppressWarningOptions,
163+
exclude: Seq[Positioned[String]] = Nil,
164+
maybeRecoverOnError: BuildException => Option[BuildException] = e => Some(e)
165165
)(using ScalaCliInvokeData): Either[BuildException, (CrossSources, Module)] = either {
166166

167167
def preprocessSources(elems: Seq[SingleElement])
@@ -379,8 +379,8 @@ object CrossSources {
379379
* the resource directories that should be added to the classpath
380380
*/
381381
private def resolveResourceDirs(
382-
allInputs: Module,
383-
preprocessedSources: Seq[PreprocessedSource]
382+
allInputs: Module,
383+
preprocessedSources: Seq[PreprocessedSource]
384384
): Seq[WithBuildRequirements[os.Path]] = {
385385
val fromInputs = allInputs.elements
386386
.collect { case r: ResourceDirectory => WithBuildRequirements(BuildRequirements(), r.path) }

modules/build/src/main/scala/scala/build/bsp/BspImpl.scala

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -240,9 +240,9 @@ final class BspImpl(
240240
reloadableOptions: BspReloadableOptions
241241
): Either[(BuildException, ProjectName), Unit] = {
242242
def doBuildOnce(
243-
moduleInputs: Module,
244-
data: PreBuildData,
245-
scope: Scope
243+
moduleInputs: Module,
244+
data: PreBuildData,
245+
scope: Scope
246246
): Either[(BuildException, ProjectName), Build] =
247247
Build.buildOnce(
248248
inputs = moduleInputs,
@@ -788,9 +788,9 @@ object BspImpl {
788788
private final case class PreBuildProject(prebuildModules: Seq[PreBuildModule])
789789

790790
private final case class PreBuildModule(
791-
inputs: Module,
792-
mainScope: PreBuildData,
793-
testScope: PreBuildData,
794-
diagnostics: Seq[Diagnostic]
791+
inputs: Module,
792+
mainScope: PreBuildData,
793+
testScope: PreBuildData,
794+
diagnostics: Seq[Diagnostic]
795795
)
796796
}

modules/build/src/main/scala/scala/build/input/Module.scala

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -430,21 +430,21 @@ object Module {
430430
}
431431

432432
def apply(
433-
args: Seq[String],
434-
cwd: os.Path,
435-
defaultInputs: () => Option[Module] = () => None,
436-
download: String => Either[String, Array[Byte]] = _ => Left("URL not supported"),
437-
stdinOpt: => Option[Array[Byte]] = None,
438-
scriptSnippetList: List[String] = List.empty,
439-
scalaSnippetList: List[String] = List.empty,
440-
javaSnippetList: List[String] = List.empty,
441-
markdownSnippetList: List[String] = List.empty,
442-
acceptFds: Boolean = false,
443-
forcedWorkspace: Option[os.Path] = None,
444-
enableMarkdown: Boolean = false,
445-
allowRestrictedFeatures: Boolean,
446-
extraClasspathWasPassed: Boolean,
447-
forcedProjectName: Option[ProjectName] = None
433+
args: Seq[String],
434+
cwd: os.Path,
435+
defaultInputs: () => Option[Module] = () => None,
436+
download: String => Either[String, Array[Byte]] = _ => Left("URL not supported"),
437+
stdinOpt: => Option[Array[Byte]] = None,
438+
scriptSnippetList: List[String] = List.empty,
439+
scalaSnippetList: List[String] = List.empty,
440+
javaSnippetList: List[String] = List.empty,
441+
markdownSnippetList: List[String] = List.empty,
442+
acceptFds: Boolean = false,
443+
forcedWorkspace: Option[os.Path] = None,
444+
enableMarkdown: Boolean = false,
445+
allowRestrictedFeatures: Boolean,
446+
extraClasspathWasPassed: Boolean,
447+
forcedProjectName: Option[ProjectName] = None
448448
)(using ScalaCliInvokeData): Either[BuildException, Module] =
449449
if (
450450
args.isEmpty && scriptSnippetList.isEmpty && scalaSnippetList.isEmpty && javaSnippetList.isEmpty &&

modules/build/src/main/scala/scala/build/input/compose/InputsComposer.scala

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -112,25 +112,25 @@ object InputsComposer {
112112
case _ => Left(ModuleConfigurationError(s"${Keys.modules}.$key must be a table"))
113113
}
114114

115-
/** Creates [[Module]] given the initial arguments passed to the command, Looks for module
116-
* config .toml file and if found composes module inputs according to the defined config, otherwise
117-
* if module config is not found or if [[allowForbiddenFeatures]] is not set, returns only one
118-
* basic module created from initial args (see [[simpleInputs]])
115+
/** Creates [[Module]] given the initial arguments passed to the command, Looks for module config
116+
* .toml file and if found composes module inputs according to the defined config, otherwise if
117+
* module config is not found or if [[allowForbiddenFeatures]] is not set, returns only one basic
118+
* module created from initial args (see [[simpleInputs]])
119119
*
120120
* @param args
121-
* initial args passed to command
121+
* initial args passed to command
122122
* @param cwd
123-
* working directory
123+
* working directory
124124
* @param inputsFromArgs
125-
* function that proceeds with the whole [[Module]] creation flow (validating elements,
126-
* etc.) this takes into account options passed from CLI like in SharedOptions
125+
* function that proceeds with the whole [[Module]] creation flow (validating elements, etc.)
126+
* this takes into account options passed from CLI like in SharedOptions
127127
* @param allowForbiddenFeatures
128128
*/
129129
final case class InputsComposer(
130-
args: Seq[String],
131-
cwd: os.Path,
132-
inputsFromArgs: (Seq[String], Option[ProjectName]) => Either[BuildException, Module],
133-
allowForbiddenFeatures: Boolean
130+
args: Seq[String],
131+
cwd: os.Path,
132+
inputsFromArgs: (Seq[String], Option[ProjectName]) => Either[BuildException, Module],
133+
allowForbiddenFeatures: Boolean
134134
) {
135135
import InputsComposer.*
136136

0 commit comments

Comments
 (0)