3

I want to suppress no.finalize rule of ScalaStyle only for one particular class.

I figured that one approach to suppress IntelliJ IDEA's inspection is to add following comment at the beginning of the class:

//noinspection ScalaStyle

However, this will suppress all ScalaStyle rules for that particular class. I want to suppress only one rule selectively.

Note that I have already tried scalastyle's suppression approach which is to use // scalastyle:off no.finalize. However, it is not honored by IntelliJ IDEA.

I am using IDEA version 2018.2.5 (Community Edition).

vatsal mevada
  • 5,148
  • 7
  • 39
  • 68

1 Answers1

6
// scalastyle:off <rule id>

In your case:

// scalastyle:off no.finalize

List of ids: http://www.scalastyle.org/rules-dev.html

The solution works for IDEA 2019.3. Better to update the IDE with Scala plugin

Duelist
  • 1,562
  • 1
  • 9
  • 24
amer
  • 1,528
  • 1
  • 14
  • 22