HairyFotr / linter

Static Analysis Compiler Plugin for Scala
Apache License 2.0
268 stars 34 forks source link

How can I disable lint checks for a code block? #19

Open huangjs opened 9 years ago

HairyFotr commented 9 years ago

Currently you cannot, but you can ignore specific lines with //linter:disable[:OptionalCheckNames...]

What kind of syntax would you recommend?

huangjs commented 9 years ago

I would recommend scalastyle-like switcher.

// linter:off ... // linter:on

Jianshi

On Thu, Mar 19, 2015 at 6:33 PM, Matic Potočnik notifications@github.com wrote:

Currently you cannot, but you can ignore specific lines with //linter:disable[:OptionalCheckNames...]

What kind of syntax would you recommend?

— Reply to this email directly or view it on GitHub https://github.com/HairyFotr/linter/issues/19#issuecomment-83496530.

Jianshi Huang

LinkedIn: jianshi Twitter: @jshuang Github & Blog: http://huangjs.github.com/

HairyFotr commented 9 years ago

Yeah, that sounds good, I'll try to implement something over the weekend.

I'll likely also replace "disable" in favour of "ignore" to make it even more similar to scalastyle, and because having "disable" and "off"/"on" together would be confusing.

huangjs commented 9 years ago

Thanks!

Jianshi

On Fri, Mar 20, 2015 at 12:51 AM, Matic Potočnik notifications@github.com wrote:

Yeah, that sounds good, I'll try to implement something over the weekend.

I'll likely also replace "disable" in favour of "ignore" to make it even more similar to scalastyle, and because having "disable" and "off"/"on" together would be confusing.

— Reply to this email directly or view it on GitHub https://github.com/HairyFotr/linter/issues/19#issuecomment-83659892.

Jianshi Huang

LinkedIn: jianshi Twitter: @jshuang Github & Blog: http://huangjs.github.com/

ngbinh commented 8 years ago

any update on this?

TomasMikula commented 8 years ago

👍 I would also like to be able to turn off just specific warnings.

KANGOD commented 4 years ago

Android Studio (or IntelliJ)'s CtrlAltL formatter supports similar grammar to ignore a code block, ref https://www.jetbrains.com/help/idea/reformat-and-rearrange-code.html#exclude_part_of_code

// @formatter:off
blahblah
// @formatter:on

Of course

// linter:disable[:OptionalCheckNames...]
// linter:enable[:OptionalCheckNames...]

is appreciate, while if it's difficult to implement, a whole off / on is also welcome.