Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .scalafix3.conf
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Same as .scalafix.conf, but for RemoveUnused commented out
rules = [
DisableSyntax,
# RemoveUnused,
RemoveUnused,
OrganizeImports,
NoValInForComprehension,
# ProcedureSyntax
Expand Down
7 changes: 6 additions & 1 deletion build.sc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import $ivy.`com.lihaoyi::mill-contrib-bloop:$MILL_VERSION`
import $ivy.`io.get-coursier::coursier-launcher:2.1.24`
import $ivy.`io.github.alexarchambault.mill::mill-native-image-upload:0.1.29`
import $file.project.deps, deps.{Deps, Docker, InternalDeps, Java, Scala, TestDeps}
import $file.project.deps, deps.{Cli, Deps, Docker, InternalDeps, Java, Scala, TestDeps}
import $file.project.publish, publish.{ghOrg, ghName, ScalaCliPublishModule, organization}
import $file.project.settings, settings.{
CliLaunchers,
Expand Down Expand Up @@ -454,6 +454,7 @@ trait Core extends ScalaCliCrossSbtModule
| def runnerOrganization = "${runner(Scala.runnerScala3).pomSettings().organization}"
| def runnerModuleName = "${runner(Scala.runnerScala3).artifactName()}"
| def runnerVersion = "${runner(Scala.runnerScala3).publishVersion()}"
| def runnerLegacyVersion = "${Cli.runnerLegacyVersion}"
| def runnerMainClass = "$runnerMainClass"
|
| def semanticDbPluginOrganization = "${Deps.semanticDbScalac.dep.module.organization
Expand Down Expand Up @@ -1060,6 +1061,9 @@ trait CliIntegration extends SbtModule with ScalaCliPublishModule with HasTests
| def maxAmmoniteScala213Version = "${Scala.maxAmmoniteScala213Version}"
| def maxAmmoniteScala3Version = "${Scala.maxAmmoniteScala3Version}"
| def maxAmmoniteScala3LtsVersion = "${Scala.maxAmmoniteScala3LtsVersion}"
| def legacyScala3Versions = Seq(${Scala.legacyScala3Versions.map(p =>
s"\"$p\""
).mkString(", ")})
| def scalaJsVersion = "${Scala.scalaJs}"
| def scalaJsCliVersion = "${Scala.scalaJsCli}"
| def scalaNativeVersion = "${Deps.Versions.scalaNative}"
Expand All @@ -1069,6 +1073,7 @@ trait CliIntegration extends SbtModule with ScalaCliPublishModule with HasTests
| def ammoniteVersion = "${Deps.ammonite.dep.version}"
| def defaultGraalVMJavaVersion = "${deps.graalVmJavaVersion}"
| def defaultGraalVMVersion = "${deps.graalVmVersion}"
| def runnerLegacyVersion = "${Cli.runnerLegacyVersion}"
| def scalaPyVersion = "${Deps.scalaPy.dep.version}"
| def scalaPyMaxScalaNative = "${Deps.Versions.maxScalaNativeForScalaPy}"
| def bloopVersion = "${Deps.bloopRifle.dep.version}"
Expand Down
4 changes: 2 additions & 2 deletions modules/build/src/main/scala/scala/build/Bloop.scala
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ import java.io.{File, IOException}
import scala.annotation.tailrec
import scala.build.EitherCps.{either, value}
import scala.build.errors.{BuildException, ModuleFormatError}
import scala.build.internal.CsLoggerUtil.*
import scala.build.internal.CsLoggerUtil._
import scala.concurrent.ExecutionException
import scala.concurrent.duration.FiniteDuration
import scala.jdk.CollectionConverters.*
import scala.jdk.CollectionConverters._

object Bloop {

Expand Down
10 changes: 5 additions & 5 deletions modules/build/src/main/scala/scala/build/Build.scala
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ import java.util.concurrent.{ScheduledExecutorService, ScheduledFuture}

import scala.annotation.tailrec
import scala.build.EitherCps.{either, value}
import scala.build.Ops.*
import scala.build.Ops._
import scala.build.compiler.{ScalaCompiler, ScalaCompilerMaker}
import scala.build.errors.*
import scala.build.input.*
import scala.build.errors._
import scala.build.input._
import scala.build.internal.resource.ResourceMapper
import scala.build.internal.{Constants, MainClass, Name, Util}
import scala.build.options.*
import scala.build.options._
import scala.build.options.validation.ValidationException
import scala.build.postprocessing.LineConversion.scalaLineToScLineShift
import scala.build.postprocessing.*
import scala.build.postprocessing._
import scala.collection.mutable.ListBuffer
import scala.concurrent.duration.DurationInt
import scala.util.control.NonFatal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import scala.build.internals.ConsoleUtils.ScalaCliConsole
import scala.build.options.Scope
import scala.build.postprocessing.LineConversion.scalaLineToScLine
import scala.collection.mutable
import scala.jdk.CollectionConverters.*
import scala.jdk.CollectionConverters._

class ConsoleBloopBuildClient(
logger: Logger,
Expand Down
13 changes: 6 additions & 7 deletions modules/build/src/main/scala/scala/build/CrossSources.scala
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
package scala.build

import java.io.File

import scala.build.CollectionOps.*
import scala.build.CollectionOps._
import scala.build.EitherCps.{either, value}
import scala.build.Ops.*
import scala.build.Ops._
import scala.build.Positioned
import scala.build.errors.{
BuildException,
Expand All @@ -13,8 +12,8 @@ import scala.build.errors.{
MalformedDirectiveError,
Severity
}
import scala.build.input.ElementsUtils.*
import scala.build.input.*
import scala.build.input.ElementsUtils._
import scala.build.input._
import scala.build.internal.Constants
import scala.build.internal.util.{RegexUtils, WarningMessages}
import scala.build.options.{
Expand All @@ -25,10 +24,10 @@ import scala.build.options.{
SuppressWarningOptions,
WithBuildRequirements
}
import scala.build.preprocessing.*
import scala.build.preprocessing._
import scala.build.testrunner.DynamicTestRunner.globPattern
import scala.util.Try
import scala.util.chaining.*
import scala.util.chaining._

/** Information gathered from preprocessing command inputs - sources (including unwrapped scripts)
* and build options from using directives
Expand Down
1 change: 0 additions & 1 deletion modules/build/src/main/scala/scala/build/LocalRepo.scala
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
package scala.build

import coursier.core.{Repository, Version}
import coursier.parse.RepositoryParser
import coursier.paths.Util
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package scala.build

import bloop.rifle.BloopRifleLogger
import org.scalajs.logging.Logger as ScalaJsLogger
import org.scalajs.logging.{Logger => ScalaJsLogger}

import java.io.PrintStream

import scala.build.errors.{BuildException, Diagnostic}
import scala.build.internals.FeatureType
import scala.scalanative.build as sn
import scala.scalanative.{build => sn}

/** Used to collect and send diagnostics to the build client when operating as a BSP */
class PersistentDiagnosticLogger(parent: Logger) extends Logger {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import coursier.cache.FileCache
import coursier.core.{Repository, Version}
import coursier.error.{CoursierError, ResolutionError}
import coursier.util.Task
import dependency.*
import dependency._
import org.apache.commons.compress.archivers.zip.ZipFile
import os.Path

Expand All @@ -14,7 +14,7 @@ import java.util.Properties
import scala.build.EitherCps.{either, value}
import scala.build.errors.{BuildException, FetchingDependenciesError}
import scala.build.internal.Constants
import scala.build.internal.CsLoggerUtil.*
import scala.build.internal.CsLoggerUtil._

final case class ScalafixArtifacts(
scalafixJars: Seq[os.Path],
Expand Down
2 changes: 1 addition & 1 deletion modules/build/src/main/scala/scala/build/Sources.scala
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import scala.build.info.BuildInfo
import scala.build.input.Inputs
import scala.build.internal.{CodeWrapper, WrapperParams}
import scala.build.options.{BuildOptions, Scope}
import scala.build.preprocessing.*
import scala.build.preprocessing._

final case class Sources(
paths: Seq[(os.Path, os.RelPath)],
Expand Down
6 changes: 3 additions & 3 deletions modules/build/src/main/scala/scala/build/bsp/BspClient.scala
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package scala.build.bsp

import ch.epfl.scala.bsp4j.{ScalaAction, ScalaDiagnostic, ScalaTextEdit, ScalaWorkspaceEdit}
import ch.epfl.scala.bsp4j as b
import ch.epfl.scala.{bsp4j => b}
import com.google.gson.{Gson, JsonElement}

import java.lang.Boolean as JBoolean
import java.lang.{Boolean => JBoolean}
import java.net.URI
import java.nio.file.Paths
import java.util.concurrent.{ConcurrentHashMap, ExecutorService}
Expand All @@ -15,7 +15,7 @@ import scala.build.errors.{BuildException, CompositeBuildException, Diagnostic,
import scala.build.internal.util.WarningMessages
import scala.build.postprocessing.LineConversion.scalaLineToScLine
import scala.build.{BloopBuildClient, GeneratedSource, Logger}
import scala.jdk.CollectionConverters.*
import scala.jdk.CollectionConverters._

class BspClient(
@volatile var logger: Logger,
Expand Down
6 changes: 3 additions & 3 deletions modules/build/src/main/scala/scala/build/bsp/BspImpl.scala
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package scala.build.bsp

import bloop.rifle.{BloopRifleConfig, BloopServer}
import ch.epfl.scala.bsp4j as b
import ch.epfl.scala.{bsp4j => b}
import com.github.plokhotnyuk.jsoniter_scala.core.{JsonReaderException, readFromArray}
import dependency.ScalaParameters
import org.eclipse.lsp4j.jsonrpc
Expand All @@ -12,7 +12,7 @@ import java.util.UUID
import java.util.concurrent.{CompletableFuture, Executor}

import scala.build.EitherCps.{either, value}
import scala.build.*
import scala.build._
import scala.build.compiler.BloopCompiler
import scala.build.errors.{
BuildException,
Expand All @@ -26,7 +26,7 @@ import scala.build.options.{BuildOptions, Scope}
import scala.collection.mutable.ListBuffer
import scala.concurrent.duration.DurationInt
import scala.concurrent.{ExecutionContext, Future, Promise}
import scala.jdk.CollectionConverters.*
import scala.jdk.CollectionConverters._
import scala.util.{Failure, Success}

/** The implementation for [[Bsp]] command.
Expand Down
6 changes: 3 additions & 3 deletions modules/build/src/main/scala/scala/build/bsp/BspServer.scala
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
package scala.build.bsp

import ch.epfl.scala.bsp4j.{BuildClient, LogMessageParams, MessageType}
import ch.epfl.scala.bsp4j as b
import ch.epfl.scala.{bsp4j => b}

import java.io.{File, PrintWriter, StringWriter}
import java.net.URI
import java.util.concurrent.{CompletableFuture, TimeUnit}
import java.util as ju
import java.{util => ju}

import scala.build.Logger
import scala.build.internal.Constants
import scala.build.options.Scope
import scala.concurrent.{Future, Promise}
import scala.jdk.CollectionConverters.*
import scala.jdk.CollectionConverters._
import scala.util.Random

class BspServer(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package scala.build.bsp

import ch.epfl.scala.bsp4j as b
import ch.epfl.scala.{bsp4j => b}

import java.util.concurrent.CompletableFuture

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package scala.build.bsp

import ch.epfl.scala.bsp4j as b
import ch.epfl.scala.{bsp4j => b}

import java.util.concurrent.CompletableFuture

Expand Down
4 changes: 2 additions & 2 deletions modules/build/src/main/scala/scala/build/bsp/package.scala
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package scala.build

import ch.epfl.scala.bsp4j.SourcesItem
import ch.epfl.scala.bsp4j as b
import ch.epfl.scala.{bsp4j => b}

import java.util.concurrent.CompletableFuture

import scala.jdk.CollectionConverters.*
import scala.jdk.CollectionConverters._

package object bsp {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package scala.build.bsp.protocol

import ch.epfl.scala.bsp4j as b
import ch.epfl.scala.{bsp4j => b}
import com.google.gson.Gson

case class TextEdit(range: b.Range, newText: String) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
package scala.build.compiler

import ch.epfl.scala.bsp4j

import scala.annotation.tailrec
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import java.security.MessageDigest
import scala.annotation.tailrec
import scala.build.Directories
import scala.build.errors.{BuildException, InputsException, WorkspaceError}
import scala.build.input.ElementsUtils.*
import scala.build.input.ElementsUtils._
import scala.build.internal.Constants
import scala.build.internal.zip.WrappedZipInputStream
import scala.build.options.Scope
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import coursier.jvm.Execve
import org.scalajs.jsenv.jsdomnodejs.JSDOMNodeJSEnv
import org.scalajs.jsenv.nodejs.NodeJSEnv
import org.scalajs.jsenv.{Input, JSEnv, RunConfig}
import org.scalajs.testing.adapter.TestAdapter as ScalaJsTestAdapter
import org.scalajs.testing.adapter.{TestAdapter => ScalaJsTestAdapter}
import sbt.testing.{Framework, Status}

import java.io.File
Expand All @@ -13,11 +13,11 @@ import java.nio.file.{Files, Path, Paths}
import scala.build.EitherCps.{either, value}
import scala.build.Logger
import scala.build.Ops.EitherSeqOps
import scala.build.errors.*
import scala.build.errors._
import scala.build.internals.EnvVar
import scala.build.testrunner.FrameworkUtils.*
import scala.build.testrunner.FrameworkUtils._
import scala.build.testrunner.{AsmTestRunner, TestRunner}
import scala.scalanative.testinterface.adapter.TestAdapter as ScalaNativeTestAdapter
import scala.scalanative.testinterface.adapter.{TestAdapter => ScalaNativeTestAdapter}
import scala.util.{Failure, Properties, Success}

object Runner {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import scala.annotation.tailrec
import scala.build.Position
import scala.build.errors.{BuildException, MarkdownUnclosedBackticksError}
import scala.collection.mutable
import scala.jdk.CollectionConverters.*
import scala.jdk.CollectionConverters._

/** Representation for a (closed) code block contained in Markdown
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
package scala.build.preprocessing

import java.nio.charset.StandardCharsets

import scala.build.EitherCps.{either, value}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,6 @@ object DeprecatedDirectives {
private def valueReplacement(replacements: String*)(warning: String): WarningAndReplacement =
(warning, DirectiveTemplate(Nil, Some(replacements.toSeq)))

private def allAliasesOf(key: String, handler: DirectiveHandler[?]): Seq[String] =
handler.keys.find(_.nameAliases.contains(key))
.toSeq
.flatMap(_.nameAliases)

private def allKeysFrom(handler: DirectiveHandler[?]): Seq[String] =
handler.keys.flatMap(_.nameAliases)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package scala.build.preprocessing
import scala.build.EitherCps.{either, value}
import scala.build.Logger
import scala.build.Ops.*
import scala.build.Ops._
import scala.build.directives.{
HasBuildOptions,
HasBuildOptionsWithRequirements,
Expand All @@ -23,9 +23,9 @@ import scala.build.options.{
SuppressWarningOptions,
WithBuildRequirements
}
import scala.build.preprocessing.directives.DirectivesPreprocessingUtils.*
import scala.build.preprocessing.directives.PartiallyProcessedDirectives.*
import scala.build.preprocessing.directives.*
import scala.build.preprocessing.directives.DirectivesPreprocessingUtils._
import scala.build.preprocessing.directives.PartiallyProcessedDirectives._
import scala.build.preprocessing.directives._

case class DirectivesPreprocessor(
path: Either[String, os.Path],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ import com.virtuslab.using_directives.custom.model.{
UsingDirectives,
Value
}
import com.virtuslab.using_directives.custom.utils.ast.*
import com.virtuslab.using_directives.custom.utils.ast._

import scala.annotation.targetName
import scala.build.errors.*
import scala.build.errors._
import scala.build.options.SuppressWarningOptions
import scala.build.preprocessing.UsingDirectivesOps.*
import scala.build.preprocessing.UsingDirectivesOps._
import scala.build.preprocessing.directives.{DirectiveUtil, ScopedDirective, StrictDirective}
import scala.build.{Logger, Position}
import scala.collection.mutable
import scala.jdk.CollectionConverters.*
import scala.jdk.CollectionConverters._

case class ExtractedDirectives(
directives: Seq[StrictDirective],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
package scala.build.preprocessing

import java.nio.charset.StandardCharsets

import scala.build.EitherCps.{either, value}
Expand Down
Loading
Loading