Skip to content
Draft
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
22 changes: 0 additions & 22 deletions .devcontainer/Dockerfile

This file was deleted.

17 changes: 0 additions & 17 deletions .devcontainer/devcontainer.json

This file was deleted.

1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: coursier/cache-action@v6
- run: ./format_src_check.sh
- run: ./mill __.test
21 changes: 0 additions & 21 deletions .github/workflows/validation.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .scalafix.conf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ OrganizeImports {
groupedImports = Merge
groups = [
"java."
"cats."
"scala."
"forja."
"*"
]
Expand Down
2 changes: 1 addition & 1 deletion .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version = "3.10.1"
version = "3.11.2"
runner.dialect = scala3

assumeStandardLibraryStripMargin = true
Expand Down
73 changes: 3 additions & 70 deletions build.mill
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import mill.api.Task.Simple
import mill.api.TaskCtx

trait ForjaModule extends ScalaModule, ScalafixModule:
def scalaVersion = "3.8.3"
def scalaVersion = "3.8.4"
def scalacOptions = Seq(
// "-Werror",
"-Yexplicit-nulls",
Expand All @@ -20,6 +20,7 @@ trait ForjaModule extends ScalaModule, ScalafixModule:
"-source:future",
"-Xcheck-macros",
"-explain-cyclic",
"-Wunused:imports",
"-preview",
)
override def forkArgs = super.forkArgs() ++ Seq(
Expand All @@ -41,75 +42,7 @@ end ForjaModule

object forja extends ForjaModule:
override def mvnDeps = Seq(
mvn"com.lihaoyi::sourcecode:0.4.4",
mvn"com.lihaoyi::os-lib:0.11.5",
mvn"org.typelevel::cats-core:2.13.0",
mvn"io.github.java-diff-utils:java-diff-utils:4.15",
mvn"dev.zio::izumi-reflect:3.0.9",
// TODO: when we need dependencies back
)
object test extends ForjaTests

private enum State:
case Normal, NextLineIsTemplate
case IsReplacing(count: Int)

def updateLimit22Apply(check: Boolean = false) = Task.Command:
allSourceFiles().foreach: src =>
var didReplace = false
var state = State.Normal
val replacedLines =
os.read.lines
.stream(src.path)
.flatMap:
case line @ s"$_// %%replicate22" if state == State.Normal =>
didReplace = true
state = State.NextLineIsTemplate
List(line)
case line if state == State.NextLineIsTemplate =>
state = State.IsReplacing(0)
var template = line
line +: (3 to 22).map: i =>
template = template
.replace(s"T${i - 1}, U]", s"T${i - 1}, T$i, U]")
.replace(
s"t${i - 1}: T${i - 1})",
s"t${i - 1}: T${i - 1}, t$i: T$i)",
)
.replace(
s"t${i - 1}: C ?=> T${i - 1})",
s"t${i - 1}: C ?=> T${i - 1}, t$i: C ?=> T$i)",
)
.replace(s"T${i - 1})", s"T${i - 1}, T$i)")
.replace(s"t${i - 1})", s"t${i - 1}, t$i)")
.replace(s"T${i - 1}]", s"T${i - 1}, T$i]")
template
case line @ s"$_// format: on"
if state.isInstanceOf[State.IsReplacing] =>
state = State.Normal
List(line)
case line if state.isInstanceOf[State.IsReplacing] =>
assert(state.asInstanceOf[State.IsReplacing].count <= 20)
state = State.IsReplacing(
state.asInstanceOf[State.IsReplacing].count + 1,
)
Nil
case line if state == State.Normal =>
List(line)
case line =>
assert(false, s"(in state $state) $line")
.toSeq

if check && didReplace && replacedLines != os.read.lines(src.path)
then TaskCtx.taskCtx.fail(s"out of date: ${src.path}")
if check
then println(s"ok ${src.path}")
else if didReplace && replacedLines != os.read.lines(src.path)
then
println(s"rewrite ${src.path}")
os.write.over(
src.path,
replacedLines.view.flatMap(line => List(line, System.lineSeparator())),
)
else println(s"no change ${src.path}")
end updateLimit22Apply
end forja
46 changes: 0 additions & 46 deletions debugAdapterVSCode/package.json

This file was deleted.

Loading
Loading