clutchski/coffeelint

Feature request: ignore line

Closed this issue · 5 comments

I know about # coffeelint: disable=rule_name, but that's too strong for my taste as it will continue until another directive is found that enables said rule.

What I'd like is a way to tell coffeelint to "fuck-off, I know what I'm doing" on a per-line basis.

flake8 supports this via a # noqa comment which I find extremely handy.

Any chance we can have something similar in coffeelint?

swang commented

Hmm. I don't know if I'm against/for it either way except for the fact that this may cause all the rules to have to check to make sure that the line/token/node that they're working on doesn't contain a # noqa comment at the end. I'll have to check that first.

this may cause all the rules to have to check to make sure that the line/token/node that they're working on doesn't contain a # noqa comment at the end.

Not necessary. Worst case, messages can be removed in a post-processing pass

I'd second this, for what it's worth. Particularly handy for the occasional long-but-unbreakable lines, and you don't want to clutter the code with disable rules.

Why not something like

coffeelint: ignore_file

for entire files,
and

coffeelint: ignore_start
coffeelint: ignore_end

so you can manage multiple lines, or blocks of code.

Take a look at the code for ignoreing lines

It's been there since before I joined this project and as far as I'm concerned, it's always been black magic. It works, so I don't change it. CoffeeLint parses and verifies the entire file, it just throws out any results between the ignore blocks.

I'm marking this Help Wanted. If someone wants to open a PR to add these in a non-invasive way it will get reviewed. IMO, the most important thing here is that the solution has to work for the whole system. It can't cause rules to have to be rewritten to check for some special comment.