Skip to content

Commit

Permalink
Merge pull request #226 from xuwei-k/0-4-to-main
Browse files Browse the repository at this point in the history
merge 0.4.x
  • Loading branch information
xuwei-k authored Oct 30, 2024
2 parents 8e700e9 + a0e2056 commit 20e5f05
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 1 deletion.
6 changes: 6 additions & 0 deletions input/src/main/scala-3/fix/UnusedConstructorParamsTest2.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/*
rule = UnusedConstructorParams
*/
package fix

class A6(val x: Int)(using x2: String)
2 changes: 2 additions & 0 deletions input/src/main/scala/fix/UnusedConstructorParamsTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ class A2(x: Int) // assert: UnusedConstructorParams
class A3(`type`: Int) extends A1(`type`)

class A4(var x: Int)

class A5(val x: Int)(implicit x2: String)
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.13.0")

addSbtPlugin("com.eed3si9n" % "sbt-projectmatrix" % "0.10.0")

addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.12.0")
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.12.2")

addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.3.0")

Expand Down
1 change: 1 addition & 0 deletions rules/src/main/scala/fix/UnusedConstructorParams.scala
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class UnusedConstructorParams extends SyntacticRule("UnusedConstructorParams") {
case x: Defn.Class if !x.mods.exists(_.is[Mod.Case]) =>
val params = x.ctor.paramClauses.flatten
.filterNot(_.mods.exists(_.is[Mod.Implicit]))
.filterNot(_.mods.exists(_.is[Mod.Using]))
.filterNot(_.mods.exists(_.is[Mod.VarParam]))
.filterNot(_.mods.exists(_.is[Mod.ValParam]))
val allTokens = {
Expand Down

0 comments on commit 20e5f05

Please sign in to comment.