Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean unused imports #2776

Merged
merged 3 commits into from
Sep 21, 2023
Merged
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 bsp/src/mill/bsp/BspContext.scala
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package mill.bsp

import mill.api.{DummyInputStream, Logger, SystemStreams, internal}
import mill.eval.Evaluator
import mill.api.{DummyInputStream, Logger, SystemStreams}

import java.io.PrintStream
import scala.util.control.NonFatal
Expand Down
3 changes: 1 addition & 2 deletions bsp/src/mill/bsp/BspWorker.scala
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package mill.bsp

import mill.api.{Ctx, Logger, SystemStreams, internal}
import mill.eval.Evaluator
import mill.api.{Ctx, Logger, SystemStreams}
import os.Path

import java.io.PrintStream
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ trait VersionFileModule extends Module {
case snapshot: Version.Snapshot => s"Setting next version to $version"
}

import upickle.core._
import upickle.default._

implicit val shellableReadWriter: ReadWriter[os.Shellable] =
Expand Down
2 changes: 0 additions & 2 deletions main/api/src/mill/api/IO.scala
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package mill.api

import java.io.{InputStream, OutputStream}

/**
* Misc IO utilities, eventually probably should be pushed upstream into
* ammonite-ops
Expand Down
2 changes: 0 additions & 2 deletions main/api/src/mill/api/PathRef.scala
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ import java.util.concurrent.ConcurrentHashMap
import scala.util.{DynamicVariable, Using}
import upickle.default.{ReadWriter => RW}

import scala.runtime.ScalaRunTime

/**
* A wrapper around `os.Path` that calculates it's hashcode based
* on the contents of the filesystem underneath it. Used to ensure filesystem
Expand Down
3 changes: 1 addition & 2 deletions main/define/src/mill/define/Applicative.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ package mill.define

import mill.api.internal

import scala.annotation.{StaticAnnotation, compileTimeOnly}
import scala.language.higherKinds
import scala.annotation.compileTimeOnly
import scala.reflect.macros.blackbox.Context

/**
Expand Down
1 change: 0 additions & 1 deletion main/define/src/mill/define/Cross.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package mill.define
import mill.api.Lazy

import language.experimental.macros
import scala.collection.SeqView
import scala.reflect.ClassTag
import scala.reflect.macros.blackbox

Expand Down
2 changes: 0 additions & 2 deletions main/define/src/mill/define/Ctx.scala
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package mill.define

import os.Path

import scala.annotation.implicitNotFound

/**
Expand Down
1 change: 0 additions & 1 deletion main/define/src/mill/define/Module.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package mill.define

import mill.api.internal

import scala.language.experimental.macros
import scala.reflect.ClassTag

/**
Expand Down
2 changes: 1 addition & 1 deletion main/define/src/mill/define/Task.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package mill.define

import mill.api.{CompileProblemReporter, Logger, PathRef, Result, TestReporter}
import mill.define.Applicative.Applyable
import upickle.default.{ReadWriter => RW, Reader => R, Writer => W}
import upickle.default.{ReadWriter => RW, Writer => W}

import scala.language.experimental.macros
import scala.reflect.macros.blackbox.Context
Expand Down
2 changes: 1 addition & 1 deletion main/eval/src/mill/eval/Evaluator.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package mill.eval

import mill.api.{CompileProblemReporter, DummyTestReporter, Result, TestReporter, Val}
import mill.api.Strict.Agg
import mill.define.{BaseModule, NamedTask, Segments, Task}
import mill.define.{BaseModule, Segments, Task}
import mill.eval.Evaluator.{Results, formatFailing}
import mill.util.{ColorLogger, MultiBiMap}

Expand Down
2 changes: 1 addition & 1 deletion main/eval/src/mill/eval/EvaluatorPaths.scala
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package mill.eval

import mill.api.internal
import mill.define.{NamedTask, Segment, Segments, Target}
import mill.define.{NamedTask, Segment, Segments}

case class EvaluatorPaths private (dest: os.Path, meta: os.Path, log: os.Path) {
private def copy(dest: os.Path = dest, meta: os.Path = meta, log: os.Path = log): EvaluatorPaths =
Expand Down
2 changes: 1 addition & 1 deletion main/eval/test/src/mill/eval/CrossTests.scala
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package mill.eval

import mill.define.Discover
import mill.util.{TestEvaluator, TestGraphs}
import mill.util.TestGraphs.{
crossResolved,
Expand All @@ -12,6 +11,7 @@ import mill.util.TestGraphs.{
crossExtension
}
import utest._

object CrossTests extends TestSuite {
val tests = Tests {
"singleCross" - {
Expand Down
3 changes: 1 addition & 2 deletions main/resolve/src/mill/resolve/ResolveNotFoundHandler.scala
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package mill.resolve

import mill.api.internal
import mill.define.{BaseModule, Discover, Segment, Segments}
import mill.define.{Segment, Segments}
import mill.resolve.ResolveCore.Resolved

/**
Expand Down
2 changes: 1 addition & 1 deletion main/resolve/src/mill/resolve/SimpleTaskTokenReader.scala
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package mill.resolve

import mainargs.TokensReader
import mill.define.{Target, Task, Args}
import mill.define.{Target, Task}

/**
* Transparently handle `Task[T]` like simple `T` but lift the result into a T.task.
Expand Down
2 changes: 1 addition & 1 deletion main/src/mill/main/MainModule.scala
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import mill.define.{Command, NamedTask, Segments, Task}
import mill.eval.{Evaluator, EvaluatorPaths, Terminal}
import mill.resolve.{Resolve, SelectMode}
import mill.resolve.SelectMode.Separated
import mill.util.{PrintLogger, Watchable}
import mill.util.Watchable
import pprint.{Renderer, Tree, Truncated}

import scala.collection.mutable
Expand Down
5 changes: 1 addition & 4 deletions main/src/mill/main/RootModule.scala
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
package mill.main

import mill.api.{PathRef, internal}
import mill.api.internal
import mill.define.{Caller, Discover, Segments}
import TokenReaders._

import scala.collection.mutable

/**
* Used to mark a module in your `build.sc` as a top-level module, so it's
Expand Down
6 changes: 2 additions & 4 deletions main/test/src/mill/UTestFramework.scala
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
package mill
import utest.framework.{Result, StackMarker}
import utest.ufansi.Str

class UTestFramework extends utest.runner.Framework {
override def exceptionStackFrameHighlighter(s: StackTraceElement) = {
override def exceptionStackFrameHighlighter(s: StackTraceElement): Boolean = {
s.getClassName.startsWith("mill.")
}
override def setup() = {
override def setup(): Unit = {

os.remove.all(os.pwd / "target" / "workspace")
}
Expand Down
8 changes: 5 additions & 3 deletions main/test/src/mill/util/TestEvaluator.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ import java.io.{InputStream, PrintStream}
import mill.eval.Evaluator
import utest.framework.TestPath

import language.experimental.macros
import mill.api.{DummyInputStream, Result}
import mill.api.DummyInputStream

object TestEvaluator {
def static(module: => TestUtil.BaseModule)(implicit fullName: sourcecode.FullName) = {
def static(module: => TestUtil.BaseModule)(implicit
fullName: sourcecode.FullName
): TestEvaluator = {
new TestEvaluator(module)(fullName, TestPath(Nil))
}
}
Expand Down
2 changes: 0 additions & 2 deletions main/testkit/src/mill/testkit/MillTestkit.scala
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ import mill.eval.Evaluator
import mill.resolve.{Resolve, SelectMode}
import mill.util.PrintLogger

import language.experimental.macros

trait MillTestKit {

def defaultTargetDir: os.Path =
Expand Down
4 changes: 0 additions & 4 deletions main/util/src/mill/util/Classpath.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,8 @@ package mill.util

import java.io.File
import java.net.URL
import java.nio.file.{Path, Paths}
import java.util.zip.{ZipFile, ZipInputStream}
import mill.java9rtexport.Export

import scala.collection.mutable
import scala.util.control.NonFatal

/**
* Loads the jars that make up the classpath of the scala-js-fiddle
Expand Down
9 changes: 1 addition & 8 deletions main/util/src/mill/util/Jvm.scala
Original file line number Diff line number Diff line change
@@ -1,22 +1,15 @@
package mill.util

import mill.api.BuildInfo
import mill.api.Loose.Agg
import mill.api._
import mill.main.client.InputPumper
import os.SubProcess
import upickle.default.{ReadWriter => RW}

import java.io._
import java.lang.reflect.Modifier
import java.net.URI
import java.nio.file.attribute.PosixFilePermission
import java.nio.file.{FileSystems, Files, StandardOpenOption}
import java.util.Collections
import java.util.jar.{Attributes, JarFile, Manifest}
import scala.jdk.CollectionConverters._
import java.nio.file.Files
import scala.util.Properties.isWin
import scala.util.Using

object Jvm extends CoursierSupport {

Expand Down
4 changes: 1 addition & 3 deletions main/util/src/mill/util/PrintLogger.scala
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
package mill.util

import java.io._
import java.nio.file.{Files, StandardOpenOption}
import scala.util.DynamicVariable
import mill.api.{Logger, SystemStreams}
import mill.api.SystemStreams

class PrintLogger(
override val colored: Boolean,
Expand Down
2 changes: 1 addition & 1 deletion main/util/src/mill/util/Util.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package mill.util

import coursier.Repository
import mill.api.Loose.Agg
import mill.api.{BuildInfo, Ctx, IO, Loose, PathRef, Result}
import mill.api.{BuildInfo, Ctx, IO, PathRef, Result}

object Util {

Expand Down
2 changes: 1 addition & 1 deletion runner/src/mill/runner/MillMain.scala
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import mill.java9rtexport.Export
import mill.api.{DummyInputStream, internal}
import mill.api.SystemStreams
import mill.bsp.{BspContext, BspServerResult}
import mill.util.{PrintLogger, Util}
import mill.util.PrintLogger

@internal
object MillMain {
Expand Down
2 changes: 1 addition & 1 deletion runner/src/mill/runner/RunnerState.scala
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package mill.runner

import mill.api.{PathRef, Val, internal}
import mill.define.{BaseModule, Segments}
import mill.define.Segments
import mill.util.Watchable
import upickle.default.{ReadWriter, macroRW}
import mill.api.JsonFormatters._
Expand Down
2 changes: 0 additions & 2 deletions scalajslib/src/mill/scalajslib/ScalaJSModule.scala
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ import mill.scalajslib.internal.ScalaJSUtils.getReportMainFilePathRef
import mill.scalajslib.worker.{ScalaJSWorker, ScalaJSWorkerExternalModule}
import mill.scalalib.bsp.{ScalaBuildTarget, ScalaPlatform}

import scala.jdk.CollectionConverters._

trait ScalaJSModule extends scalalib.ScalaModule { outer =>

def scalaJSVersion: T[String]
Expand Down
1 change: 0 additions & 1 deletion scalajslib/test/src/mill/scalajslib/SourceMapTests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package mill.scalajslib
import mill.define.Discover
import mill.util.{TestEvaluator, TestUtil}
import utest._
import mill.define.Target

object SourceMapTests extends TestSuite {
val workspacePath = TestUtil.getOutPathStatic() / "source-map"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package mill.scalajslib.worker.jsenv

import mill.scalajslib.worker.api._
import org.scalajs.jsenv.nodejs.NodeJSEnv.SourceMap

object Phantom {
def apply(config: JsEnvConfig.Phantom) =
Expand Down
1 change: 0 additions & 1 deletion scalalib/src/mill/scalalib/Dependency.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package mill.scalalib
import mill.T
import mill.define.{Command, Discover, ExternalModule}
import mill.eval.Evaluator
import mill.main.EvaluatorTokenReader
import mill.scalalib.dependency.DependencyUpdatesImpl
import mill.scalalib.dependency.updates.ModuleDependenciesUpdates

Expand Down
2 changes: 0 additions & 2 deletions scalalib/src/mill/scalalib/JsonFormatters.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ package mill.scalalib

import upickle.default.{ReadWriter => RW}

import scala.reflect.ClassTag

trait JsonFormatters {
implicit lazy val publicationFormat: RW[coursier.core.Publication] = upickle.default.macroRW
implicit lazy val extensionFormat: RW[coursier.core.Extension] = upickle.default.macroRW
Expand Down
2 changes: 1 addition & 1 deletion scalalib/src/mill/scalalib/Lib.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package mill
package scalalib

import coursier.util.Task
import coursier.{Dependency, LocalRepositories, Repositories, Repository, Resolution}
import coursier.{Dependency, Repository, Resolution}
import mill.api.{Ctx, Loose, PathRef, Result}
import mill.main.BuildInfo
import mill.util.Util
Expand Down
4 changes: 1 addition & 3 deletions scalalib/src/mill/scalalib/PublishModule.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@ package scalalib

import mill.define.{Command, ExternalModule, Target, Task}
import mill.api.{JarManifest, PathRef, Result}
import mill.main.Tasks
import mill.util.Jvm
import mill.scalalib.PublishModule.checkSonatypeCreds
import mill.scalalib.publish.{Artifact, SonatypePublisher, VersionScheme}
import mill.scalalib.publish.{Artifact, SonatypePublisher}

/**
* Configuration necessary for publishing a Scala module to Maven Central or similar
Expand Down
1 change: 0 additions & 1 deletion scalalib/src/mill/scalalib/ScalaModule.scala
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import mill.util.Jvm.createJar
import mill.api.Loose.Agg
import mill.scalalib.api.{CompilationResult, Versions, ZincWorkerUtil}

import scala.jdk.CollectionConverters._
import mainargs.Flag
import mill.scalalib.bsp.{BspBuildTarget, BspModule, ScalaBuildTarget, ScalaPlatform}
import mill.scalalib.dependency.versions.{ValidVersion, Version}
Expand Down
2 changes: 1 addition & 1 deletion scalalib/src/mill/scalalib/SemanticDbJavaModule.scala
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package mill.scalalib

import mill.api.{PathRef, Result, experimental}
import mill.define.{ModuleRef, Target, Task}
import mill.define.{ModuleRef, Target}
import mill.main.BuildInfo
import mill.scalalib.api.{CompilationResult, Versions, ZincWorkerUtil}
import mill.scalalib.bsp.BspBuildTarget
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package mill.scalalib.dependency.updates

import mill.scalalib.JavaModule
import mill.scalalib.dependency.versions.Version

import scala.collection.SortedSet
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
package mill.scalalib.dependency.versions

import scala.reflect.ClassTag

import coursier.Dependency
import mill.define.{BaseModule, Task}
import mill.define.{BaseModule}
import mill.eval.Evaluator
import mill.scalalib.dependency.metadata.MetadataLoaderFactory
import mill.scalalib.{Dep, JavaModule, Lib}
import mill.scalalib.{JavaModule, Lib}
import mill.api.Ctx.{Home, Log}
import mill.T

Expand Down
2 changes: 1 addition & 1 deletion scalalib/src/mill/scalalib/internal/JavaModuleUtils.scala
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package mill.scalalib.internal

import mill.define.{Module, Segments}
import mill.define.Module
import mill.scalalib.JavaModule

@mill.api.internal
Expand Down
1 change: 0 additions & 1 deletion scalalib/src/mill/scalalib/publish/SonatypeHttpApi.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import java.util.Base64

import scala.annotation.tailrec
import scala.concurrent.duration._
import scala.util.control.NonFatal

import mill.main.BuildInfo
import requests.BaseSession
Expand Down
1 change: 0 additions & 1 deletion scalalib/src/mill/scalalib/publish/SonatypePublisher.scala
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import java.security.MessageDigest

import mill.api.Logger
import mill.util.Jvm
import os.Shellable

class SonatypePublisher(
uri: String,
Expand Down
Loading