nginx-linter icon indicating copy to clipboard operation
nginx-linter copied to clipboard

Ignoring certain rules

Open tobijdc opened this issue 2 years ago • 4 comments

Hi,

I just tried using nginx-linter on an existing project and got 6287 errors :smiling_face_with_tear:. After setting indentation and trailing-whitespace to warn i get significantly less, but it is hard to find the errors, if there are so many warning messages.

Is it possible to complete disable a certain rule via config?

tobijdc avatar Jan 11 '23 10:01 tobijdc

Yes, I believe you can do the following:

{
    "severity": {
        "trailing-whitespace": "off"
    }
}

Let me know if that works for you

jhinch avatar Jan 11 '23 19:01 jhinch

Sorry for my late answer. It looks like "off" only changes the log level, but messages are still displayed.

With 1000 "style" errors next to 50 other errors (that I would like to fix), it is a little difficult :grimacing:

Screenshot from 2023-01-27 09-30-28 Screenshot from 2023-01-27 09-29-32

tobijdc avatar Jan 27 '23 10:01 tobijdc

Apologies, I gave you the wrong configuration advice 😅.

Try this out:

{
    "indentation": false,
    "trailing-whitespace": false
}

Note that this time its not nested under the severity section and its using false instead of "off"

jhinch avatar Jan 27 '23 20:01 jhinch

This worked thanks :+1: Feel free to close the issue.

tobijdc avatar Jan 30 '23 13:01 tobijdc