mirror of
https://github.com/mcanlas/6502-opcodes.git
synced 2025-01-15 09:29:51 +00:00
scalafix
This commit is contained in:
parent
851b4ee99c
commit
e112877f8d
13
.scalafix.conf
Normal file
13
.scalafix.conf
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
rules = [
|
||||||
|
OrganizeImports
|
||||||
|
]
|
||||||
|
|
||||||
|
OrganizeImports {
|
||||||
|
expandRelative = true
|
||||||
|
groups = [
|
||||||
|
"java",
|
||||||
|
"scala",
|
||||||
|
"*",
|
||||||
|
"com.htmlism"
|
||||||
|
]
|
||||||
|
}
|
@ -8,3 +8,4 @@ lazy val root =
|
|||||||
.withCats
|
.withCats
|
||||||
.withTesting
|
.withTesting
|
||||||
.withTestingBeta
|
.withTestingBeta
|
||||||
|
.withOrganizeImports
|
||||||
|
25
project/LintingPlugin.scala
Normal file
25
project/LintingPlugin.scala
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
import sbt.Keys._
|
||||||
|
import sbt._
|
||||||
|
|
||||||
|
object LintingPlugin extends AutoPlugin {
|
||||||
|
override def trigger = allRequirements
|
||||||
|
|
||||||
|
override lazy val globalSettings =
|
||||||
|
addCommandAlias("fmt", List("all", "scalafmtSbt", "compile:scalafmt", "test:scalafmt").mkString(" ")) ++
|
||||||
|
addCommandAlias("fix", "scalafixAll")
|
||||||
|
|
||||||
|
object autoImport {
|
||||||
|
// this class name should be unique to evade implicit collision with other ops classes
|
||||||
|
implicit class LintingOps(p: Project) {
|
||||||
|
def withOrganizeImports: Project = {
|
||||||
|
import scalafix.sbt.ScalafixPlugin.autoImport._
|
||||||
|
|
||||||
|
p.settings(
|
||||||
|
ThisBuild / scalafixDependencies += "com.github.liancheng" %% "organize-imports" % "0.4.0",
|
||||||
|
semanticdbEnabled := true,
|
||||||
|
semanticdbVersion := scalafixSemanticdb.revision
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -8,9 +8,6 @@ object ProjectPlugin extends AutoPlugin {
|
|||||||
scalaVersion := "2.13.3"
|
scalaVersion := "2.13.3"
|
||||||
)
|
)
|
||||||
|
|
||||||
override lazy val globalSettings =
|
|
||||||
addCommandAlias("fmt", List("", "scalafmtSbt", "compile:scalafmt", "test:scalafmt").mkString(";"))
|
|
||||||
|
|
||||||
object autoImport {
|
object autoImport {
|
||||||
implicit class ProjectOps(p: Project) {
|
implicit class ProjectOps(p: Project) {
|
||||||
def withCats: Project =
|
def withCats: Project =
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.3.4")
|
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.3.4")
|
||||||
addSbtPlugin("io.github.davidgregory084" % "sbt-tpolecat" % "0.1.13")
|
addSbtPlugin("io.github.davidgregory084" % "sbt-tpolecat" % "0.1.13")
|
||||||
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.6.1")
|
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.6.1")
|
||||||
|
addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.9.19")
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
package com.htmlism
|
package com.htmlism
|
||||||
|
|
||||||
import cats.implicits._
|
|
||||||
import java.io.PrintWriter
|
import java.io.PrintWriter
|
||||||
|
|
||||||
|
import cats.implicits._
|
||||||
|
|
||||||
import com.htmlism.mos6502.model._
|
import com.htmlism.mos6502.model._
|
||||||
|
|
||||||
object MatchOpcodes {
|
object MatchOpcodes {
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
package com.htmlism.mos6502.dsl
|
package com.htmlism.mos6502.dsl
|
||||||
|
|
||||||
import scala.collection.mutable.ListBuffer
|
import scala.collection.mutable.ListBuffer
|
||||||
|
|
||||||
import cats.implicits._
|
import cats.implicits._
|
||||||
|
|
||||||
import com.htmlism.mos6502.model._
|
import com.htmlism.mos6502.model._
|
||||||
|
|
||||||
object DslDemo extends App {
|
object DslDemo extends App {
|
||||||
@ -141,6 +143,5 @@ class AssemblyContext {
|
|||||||
}
|
}
|
||||||
|
|
||||||
def triplets: List[(String, Option[String], Option[String])] =
|
def triplets: List[(String, Option[String], Option[String])] =
|
||||||
xs.map(_.toTriplet)
|
xs.map(_.toTriplet).toList
|
||||||
.toList
|
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package com.htmlism.mos6502.dsl
|
package com.htmlism.mos6502.dsl
|
||||||
|
|
||||||
import cats.implicits._
|
import cats.implicits._
|
||||||
|
|
||||||
import com.htmlism.mos6502.model.Instruction
|
import com.htmlism.mos6502.model.Instruction
|
||||||
|
|
||||||
sealed trait Statement {
|
sealed trait Statement {
|
||||||
|
@ -1,9 +1,8 @@
|
|||||||
package com.htmlism.mos6502.dsl
|
package com.htmlism.mos6502.dsl
|
||||||
|
|
||||||
import cats.implicits._
|
import cats.implicits._
|
||||||
import org.scalatest._
|
import org.scalatest.flatspec._
|
||||||
import flatspec._
|
import org.scalatest.matchers._
|
||||||
import matchers._
|
|
||||||
|
|
||||||
class Easy6502Spec extends AnyFlatSpec with should.Matchers {
|
class Easy6502Spec extends AnyFlatSpec with should.Matchers {
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user