Skip to content
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
7 changes: 6 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@ jobs:
distribution: temurin
java-version: 17
- uses: sbt/setup-sbt@8feba82adc7f01ddcf8165b86f778bdb5b82cebc # v1
- run: sbt compile
# scalafmt は非コンパイルで最速に落ち、scalafix は semanticdb 付きの
# コンパイルを伴うため、その後の compile は追加コストがほぼない。
# sbtn (thin client) は argv を 1 本の文字列に連結するため引数付きの
# タスクをクォートで区切れない。`;` 区切りの単一コマンドとして渡す。
- name: Lint and compile
run: sbt "scalafmtCheckAll; scalafmtSbtCheck; scalafixAll --check; compile"

build-linux:
if: github.event_name == 'push' || github.event_name == 'pull_request'
Expand Down
13 changes: 13 additions & 0 deletions .scalafix.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
rules = [
OrganizeImports
RemoveUnused
RedundantSyntax
DisableSyntax
]

# unused import の削除は RemoveUnused に任せて二重適用を避ける
OrganizeImports.removeUnused = false
OrganizeImports.targetDialect = Scala3

DisableSyntax.noFinalize = true
DisableSyntax.noReturns = true
7 changes: 7 additions & 0 deletions .scalafmt.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,10 @@ runner.dialect = scala3
runner.dialectOverride.allowSignificantIndentation = false
# allows `if x then y`
runner.dialectOverride.allowQuietSyntax = true

# build.sbt / plugins.sbt の縦揃えを維持する。val の = は揃えない
align.tokens."+" = [
{ code = ":=" }
{ code = "%" }
{ code = "%%" }
]
5 changes: 4 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@ import scala.scalanative.build.*

enablePlugins(ScalaNativePlugin)

ThisBuild / semanticdbEnabled := true
ThisBuild / scalafmtOnCompile := true

name := "comport"
organization := "dev.capslock"
scalaVersion := "3.8.2"
scalacOptions += "-no-indent"
scalacOptions ++= Seq("-no-indent", "-Wunused:all")

libraryDependencies ++= Seq(
"com.lihaoyi" %% "mainargs" % "0.7.8",
Expand Down
2 changes: 2 additions & 0 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.5.12")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.6.2")
addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.14.7")
Loading