Skip to content
This repository was archived by the owner on Jan 30, 2023. It is now read-only.

Update scalafmt-core to 3.0.8 #222

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version = "3.0.0"
version = "3.0.8"
align = some
align {
arrowEnumeratorGenerator = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,9 +229,9 @@ class FieldNamesChecker extends ScalariformChecker {
ast: Any
): List[ScalastyleError] = {
ast match {
//object Name { ... }
// object Name { ... }
case TmplDef(List(Token(OBJECT, _, _, _)), _, _, _, _, _, _, Some(TemplateBody(_, _, stats, _))) =>
//go through all first-level val declarations and apply objectFieldRegex
// go through all first-level val declarations and apply objectFieldRegex
stats.immediateChildren.flatMap(stat =>
stat match {
case FullDefOrDcl(_, _, PatDefOrDcl(Token(tokenType, _, _, _), expr, _, _, _))
Expand All @@ -242,17 +242,17 @@ class FieldNamesChecker extends ScalariformChecker {
}
)

//val ... =
// val ... =
case PatDefOrDcl(Token(tokenType, _, _, _), expr, _, _, _) if tokenType == VAL || tokenType == VAR =>
VisitorHelper.visit(expr, localVisit(regex, objectFieldRegex, inValDef = true))

// don't descend into type elements
case tee: TypeExprElement => Nil

//destructuring start - val name(...
// destructuring start - val name(...
case GeneralTokens(List(Token(VARID, _, _, _), Token(LPAREN, _, _, _))) if inValDef => Nil

//actual name check
// actual name check
case GeneralTokens(List(Token(VARID, name, offset, _))) if inValDef && regex.findAllIn(name).isEmpty =>
List(PositionError(offset, List(regex.toString)))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ class ScalaDocChecker extends CombinedChecker {
): List[ScalastyleError] = {
def tparams(xs: List[Token], bracketDepth: Int): List[String] =
if (bracketDepth > 1) {
//skip nested type params
// skip nested type params
xs match {
case Token(Tokens.RBRACKET, _, _, _) :: t => tparams(t, bracketDepth - 1)
case _ :: t => tparams(t, bracketDepth)
Expand Down
1 change: 1 addition & 0 deletions src/test/resources/testDir/dirA/X.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions src/test/resources/testDir/dirB/Y.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions src/test/resources/testDir/dirB/Z.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions src/test/resources/testfiles/EmptyClass.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@