Comments on scalastyle:ignore

957 Views Asked by At

When I tell scalastyle to ignore a line, I would like to put a comment in the code explaining to future developers why that line deserves exemption from the normal rules.

I can obviously put it in the previous line, like:

// might be called from java code
if (foo == null) {  // scalastyle:ignore
    ...
}

But ideally, I would like it in-line, like:

if (foo == null) { // scalastyle:ignore : Might be called from java code
    ...
}

The main reason for this doesn't really jump out with a simple example as above - it's more crucial in multi-line statements like

foo
  .bar // scalastyle:ignore
  .baz

Does anyone know a way to do this?

0

There are 0 best solutions below