mirror of
https://github.com/mcanlas/6502-opcodes.git
synced 2024-12-27 10:33:01 +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
|
||||
.withTesting
|
||||
.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"
|
||||
)
|
||||
|
||||
override lazy val globalSettings =
|
||||
addCommandAlias("fmt", List("", "scalafmtSbt", "compile:scalafmt", "test:scalafmt").mkString(";"))
|
||||
|
||||
object autoImport {
|
||||
implicit class ProjectOps(p: Project) {
|
||||
def withCats: Project =
|
||||
|
@ -1,3 +1,4 @@
|
||||
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.3.4")
|
||||
addSbtPlugin("io.github.davidgregory084" % "sbt-tpolecat" % "0.1.13")
|
||||
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.6.1")
|
||||
addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.9.19")
|
||||
|
@ -1,8 +1,9 @@
|
||||
package com.htmlism
|
||||
|
||||
import cats.implicits._
|
||||
import java.io.PrintWriter
|
||||
|
||||
import cats.implicits._
|
||||
|
||||
import com.htmlism.mos6502.model._
|
||||
|
||||
object MatchOpcodes {
|
||||
|
@ -1,7 +1,9 @@
|
||||
package com.htmlism.mos6502.dsl
|
||||
|
||||
import scala.collection.mutable.ListBuffer
|
||||
|
||||
import cats.implicits._
|
||||
|
||||
import com.htmlism.mos6502.model._
|
||||
|
||||
object DslDemo extends App {
|
||||
@ -141,6 +143,5 @@ class AssemblyContext {
|
||||
}
|
||||
|
||||
def triplets: List[(String, Option[String], Option[String])] =
|
||||
xs.map(_.toTriplet)
|
||||
.toList
|
||||
xs.map(_.toTriplet).toList
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.htmlism.mos6502.dsl
|
||||
|
||||
import cats.implicits._
|
||||
|
||||
import com.htmlism.mos6502.model.Instruction
|
||||
|
||||
sealed trait Statement {
|
||||
|
@ -1,9 +1,8 @@
|
||||
package com.htmlism.mos6502.dsl
|
||||
|
||||
import cats.implicits._
|
||||
import org.scalatest._
|
||||
import flatspec._
|
||||
import matchers._
|
||||
import org.scalatest.flatspec._
|
||||
import org.scalatest.matchers._
|
||||
|
||||
class Easy6502Spec extends AnyFlatSpec with should.Matchers {
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user