1

I have some cucumber stepDef steps which are more than more than 120 characters in length, I want to exclude all stepDef files from Scala style warning.

Is there a way to to exclude a specific files/directories, using xml tag only for FileLineLengthChecker condition?

Mario Galic
  • 47,285
  • 6
  • 56
  • 98
Puneeth Reddy V
  • 1,538
  • 13
  • 28

1 Answers1

1

Wrapping the entire file in the following comment filter in effect excludes the file from FileLineLengthChecker rule:

// scalastyle:off line.size.limit
val foobar = 134
// scalastyle:on line.size.limit

line.size.limit is the ID of FileLineLengthChecker rule.

Multiple rules can be switched off simultaneously like so

// scalastyle:off line.size.limit
// scalastyle:off line.contains.tab
// ...
Mario Galic
  • 47,285
  • 6
  • 56
  • 98
  • Thank you for quick answer. Is there a delimiter for combining multiple rules ? – Puneeth Reddy V Aug 29 '18 at 12:55
  • Multiple rules can be combined by listing them one after another as shown in the edited answer. The following test is useful to deduce comment filter syntax: https://github.com/scalastyle/scalastyle/blob/5c4bb3e1d6b7666c4546bbbd10c4d503455bbc9e/src/test/scala/org/scalastyle/CommentFilterTest.scala – Mario Galic Aug 29 '18 at 13:39