Skip to content

Commit 0891684

Browse files
committed
Apply formatting
1 parent 5149426 commit 0891684

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)
@@ -171,24 +171,24 @@ object Build {
171171
}
172172

173173
final case class Failed(
174-
inputs: Module,
175-
options: BuildOptions,
176-
scope: Scope,
177-
sources: Sources,
178-
artifacts: Artifacts,
179-
project: Project,
180-
diagnostics: Option[Seq[(Either[String, os.Path], bsp4j.Diagnostic)]]
174+
inputs: Module,
175+
options: BuildOptions,
176+
scope: Scope,
177+
sources: Sources,
178+
artifacts: Artifacts,
179+
project: Project,
180+
diagnostics: Option[Seq[(Either[String, os.Path], bsp4j.Diagnostic)]]
181181
) extends Build {
182182
def success: Boolean = false
183183
def successfulOpt: None.type = None
184184
def outputOpt: None.type = None
185185
}
186186

187187
final case class Cancelled(
188-
inputs: Module,
189-
options: BuildOptions,
190-
scope: Scope,
191-
reason: String
188+
inputs: Module,
189+
options: BuildOptions,
190+
scope: Scope,
191+
reason: String
192192
) extends Build {
193193
def success: Boolean = false
194194
def successfulOpt: None.type = None
@@ -200,9 +200,9 @@ object Build {
200200
* Using only the command-line options not the ones from the sources.
201201
*/
202202
def updateInputs(
203-
inputs: Module,
204-
options: BuildOptions,
205-
testOptions: Option[BuildOptions] = None
203+
inputs: Module,
204+
options: BuildOptions,
205+
testOptions: Option[BuildOptions] = None
206206
): Module = {
207207

208208
// If some options are manually overridden, append a hash of the options to the project name
@@ -234,9 +234,7 @@ object Build {
234234
logger,
235235
options.suppressWarningOptions,
236236
options.internal.exclude
237-
)
238-
239-
private def build(
237+
)private def build(
240238
inputs: Module,
241239
crossSources: CrossSources,options: BuildOptions,
242240
logger: Logger,
@@ -429,17 +427,17 @@ object Build {
429427
}
430428

431429
private def build(
432-
inputs: Module,
433-
sources: Sources,
434-
generatedSources: Seq[GeneratedSource],
435-
options: BuildOptions,
436-
scope: Scope,
437-
logger: Logger,
438-
buildClient: BloopBuildClient,
439-
compiler: ScalaCompiler,
440-
buildTests: Boolean,
441-
partial: Option[Boolean],
442-
actionableDiagnostics: Option[Boolean]
430+
inputs: Module,
431+
sources: Sources,
432+
generatedSources: Seq[GeneratedSource],
433+
options: BuildOptions,
434+
scope: Scope,
435+
logger: Logger,
436+
buildClient: BloopBuildClient,
437+
compiler: ScalaCompiler,
438+
buildTests: Boolean,
439+
partial: Option[Boolean],
440+
actionableDiagnostics: Option[Boolean]
443441
)(using ScalaCliInvokeData): Either[BuildException, Build] = either {
444442

445443
val build0 = value {
@@ -501,9 +499,9 @@ object Build {
501499
root / Constants.workspaceDirName / projectName.name / s"resources-${scope.name}"
502500

503501
def scalaNativeSupported(
504-
options: BuildOptions,
505-
inputs: Module,
506-
logger: Logger
502+
options: BuildOptions,
503+
inputs: Module,
504+
logger: Logger
507505
): Either[BuildException, Option[ScalaNativeCompatibilityError]] =
508506
either {
509507
val scalaParamsOpt = value(options.scalaParams)
@@ -640,16 +638,16 @@ object Build {
640638
}
641639

642640
def watch(
643-
inputs: Module,
644-
options: BuildOptions,
645-
compilerMaker: ScalaCompilerMaker,
646-
docCompilerMakerOpt: Option[ScalaCompilerMaker],
647-
logger: Logger,
648-
crossBuilds: Boolean,
649-
buildTests: Boolean,
650-
partial: Option[Boolean],
651-
actionableDiagnostics: Option[Boolean],
652-
postAction: () => Unit = () => ()
641+
inputs: Module,
642+
options: BuildOptions,
643+
compilerMaker: ScalaCompilerMaker,
644+
docCompilerMakerOpt: Option[ScalaCompilerMaker],
645+
logger: Logger,
646+
crossBuilds: Boolean,
647+
buildTests: Boolean,
648+
partial: Option[Boolean],
649+
actionableDiagnostics: Option[Boolean],
650+
postAction: () => Unit = () => ()
653651
)(action: Either[BuildException, Builds] => Unit)(using ScalaCliInvokeData): Watcher = {
654652

655653
val buildClient = BloopBuildClient.create(
@@ -844,15 +842,15 @@ object Build {
844842
* a bloop [[Project]]
845843
*/
846844
def buildProject(
847-
inputs: Module,
848-
sources: Sources,
849-
generatedSources: Seq[GeneratedSource],
850-
options: BuildOptions,
851-
compilerJvmVersionOpt: Option[Positioned[Int]],
852-
scope: Scope,
853-
logger: Logger,
854-
artifacts: Artifacts,
855-
maybeRecoverOnError: BuildException => Option[BuildException] = e => Some(e)
845+
inputs: Module,
846+
sources: Sources,
847+
generatedSources: Seq[GeneratedSource],
848+
options: BuildOptions,
849+
compilerJvmVersionOpt: Option[Positioned[Int]],
850+
scope: Scope,
851+
logger: Logger,
852+
artifacts: Artifacts,
853+
maybeRecoverOnError: BuildException => Option[BuildException] = e => Some(e)
856854
): Either[BuildException, Project] = either {
857855

858856
val allSources = sources.paths.map(_._1) ++ generatedSources.map(_.generated)
@@ -1036,16 +1034,16 @@ object Build {
10361034
}
10371035

10381036
def prepareBuild(
1039-
inputs: Module,
1040-
sources: Sources,
1041-
generatedSources: Seq[GeneratedSource],
1042-
options: BuildOptions,
1043-
compilerJvmVersionOpt: Option[Positioned[Int]],
1044-
scope: Scope,
1045-
compiler: ScalaCompiler,
1046-
logger: Logger,
1047-
buildClient: BloopBuildClient,
1048-
maybeRecoverOnError: BuildException => Option[BuildException] = e => Some(e)
1037+
inputs: Module,
1038+
sources: Sources,
1039+
generatedSources: Seq[GeneratedSource],
1040+
options: BuildOptions,
1041+
compilerJvmVersionOpt: Option[Positioned[Int]],
1042+
scope: Scope,
1043+
compiler: ScalaCompiler,
1044+
logger: Logger,
1045+
buildClient: BloopBuildClient,
1046+
maybeRecoverOnError: BuildException => Option[BuildException] = e => Some(e)
10491047
): Either[BuildException, (os.Path, Option[ScalaParameters], Artifacts, Project, Boolean)] =
10501048
either {
10511049

@@ -1117,15 +1115,15 @@ object Build {
11171115
}
11181116

11191117
def buildOnce(
1120-
inputs: Module,
1121-
sources: Sources,
1122-
generatedSources: Seq[GeneratedSource],
1123-
options: BuildOptions,
1124-
scope: Scope,
1125-
logger: Logger,
1126-
buildClient: BloopBuildClient,
1127-
compiler: ScalaCompiler,
1128-
partialOpt: Option[Boolean]
1118+
inputs: Module,
1119+
sources: Sources,
1120+
generatedSources: Seq[GeneratedSource],
1121+
options: BuildOptions,
1122+
scope: Scope,
1123+
logger: Logger,
1124+
buildClient: BloopBuildClient,
1125+
compiler: ScalaCompiler,
1126+
partialOpt: Option[Boolean]
11291127
): Either[BuildException, Build] = either {
11301128

11311129
if (options.platform.value == Platform.Native)
@@ -1287,14 +1285,14 @@ object Build {
12871285
else path.toString
12881286

12891287
private def jmhBuild(
1290-
inputs: Module,
1291-
build: Build.Successful,
1292-
logger: Logger,
1293-
javaCommand: String,
1294-
buildClient: BloopBuildClient,
1295-
compiler: ScalaCompiler,
1296-
buildTests: Boolean,
1297-
actionableDiagnostics: Option[Boolean]
1288+
inputs: Module,
1289+
build: Build.Successful,
1290+
logger: Logger,
1291+
javaCommand: String,
1292+
buildClient: BloopBuildClient,
1293+
compiler: ScalaCompiler,
1294+
buildTests: Boolean,
1295+
actionableDiagnostics: Option[Boolean]
12981296
)(using ScalaCliInvokeData): Either[BuildException, Option[Build]] = either {
12991297
val jmhProjectName = inputs.projectName.name + "_jmh"
13001298
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)