pythonsublimetext3sublimelinterpep

Sublime - ignore pep257 D100 warning?


I was searching for how to ignore specific warnings, but can't find exactly how to disable it.

I tried this (in SublimeLinter settings):

        "flake8": {
            "@disable": false,
            "args": [],
            "builtins": "",
            "excludes": [],
            "executable": "",
            "ignore": "D100",
            "jobs": "1",
            "max-complexity": 10,
            "max-line-length": null,
            "select": "",
            "show-code": false
        },

Then this:

        "pep257": {
            "@disable": false,
            "add-ignore": "",
            "args": [],
            "excludes": [],
            "ignore": "D100"
        },

And this:

        "pep257_ignore": [
            "D100"
        ],

But I still get that warning. So where should I disable it?


Solution

  • As pep257 was renamed to pydocstyle, I am writing answer how to ignore error/warning for pydocstyle.

    It seems previous way to specify configuration of sublime linter (e.g. ignore some errors/warnings) was bad practice and it is no longer supported (on newer versions) And it is now intended to use configuration files outside sublime itself.

    pydocstyle documentation says that you need to provide configuration file where you can provide errors list to ignore, like (setup.cfg name can be used):

    [pydocstyle]
    ignore = D100
    

    Though currently it still won't work, because sublimelinter-pydocstyle does not scan files in hierarchy if it is not specified explicitly in sublimelinter or project settings (https://github.com/SublimeLinter/SublimeLinter-pydocstyle/issues/24#issuecomment-412329010)

    So you need to specify path to your file, like (e.g. in sublime linter settings):

    {
        "linters": {
            "pydocstyle": {
                "config": "/your/path/to/setup.cfg"
            }
        }
    }
    

    P.S. Do note, that for example flake8 sublime linter does not need to specify config path, it is scanned upwards and used if one is found (like if you put setup.cfg in some parent folder).