5

I'm using Sublime Text 3, and I'm trying to customize SublimeLinter-pep8 beyond the global (user preferences) level. I have a file that has a lot of tabs in it, so error W191 shows up a lot. As a test, I want to ignore this error. If I add an "ignore": "W191" to the SublimeLinter.sublime-settings file, the error is ignored. If I add it anywhere above the user level in the settings stack, the error is not ignored.

This is the linting part of my SublimeLinter.sublime-settings file. If I add "W191" to the "ignore" section, that's the only time the error will be ignored by the linter. Also, I noticed that "max-line-length": null, but I'm still getting max-line-length errors, so there may be something here beyond what I'm asking in this question.

    "lint_mode": "background",
    "linters": {
        "pep8": {
            "@disable": false,
            "args": [],
            "excludes": [],
            "ignore": "",
            "max-line-length": null,
            "select": ""
        }
    },

This is the entire contents of my .sublimelinterrc file. I have it in the parent folder of my .py file (I've also tried putting it in the same folder). It does not do anything.

{
    "SublimeLinter":
    {
        "@python": 2.7,
        "linters":
        {
            "pep8":
            {
                "ignore": "W191"
            }
        }
    }   
}

I have also tried adding this inline statement at the beginning of the .py file. It also does not do anything. # [SublimeLinter pep8-ignore:+W191]

I messed around with the Project settings, too, but I'm not sure how projects work in Sublime Text so I'm not sure whether I'm seeing the same issue or I just set it up wrong.

Debug mode doesn't show any warnings or errors about pep8, and it reliably re-lints every time I modify any of these files. I would like to use .sublimelinterrc for this if possible, so that's what I'm mainly focusing on. What am I missing? Is there a setting I'm overlooking? Am I putting the file in the wrong directory or something?

Anastasya Lundquist
  • 600
  • 1
  • 7
  • 21
  • Your question is specific to the pep8 linter, so I wont add this as an aswer: I use pylint and I set: disable=W0511, C0321, C0111, C0301, W0142, W1202 under [MESSAGES CONTROL] in ~/.pylintrc. Wfm. However I also have issues adding disable messages inline to locally disable a warning. – J0hnG4lt May 21 '15 at 12:22

0 Answers0