Emma
Emma

Reputation: 27723

"SublimeAutoPep8: some issue(s) were not fixed" such as E501

I'm getting a soft warning in Python:

SublimeAutoPep8: some issue(s) were not fixed:
File "/Library/WebServer/dir/dir/filename.py", line 11: not fixed E501
File "/Library/WebServer/dir/dir/filename.py", line 33: not fixed E501

My current AutoPep8.sublime-settings is:

{
    "format_on_save": true,
     "max-line-length": 100,
}

I've tried adding the following config in Preferences.sublime-settings:

    "pep8": {
        "@disable": false,
        "args": [],
        "excludes": [],
        "ignore": [ "E251", "W291", "E501" ],
        "max-line-length": null,
        "select": ""
    },

doesn't seem to be right though.

What should I do to ignore these warnings? Thank you!

Upvotes: 2

Views: 1847

Answers (1)

mattst
mattst

Reputation: 13950

Firstly you should not be adding your AutoPep8 settings in Preferences.sublime-settings instead they should all be added to the AutoPep8.sublime-settings file which should be located in your Sublime Text User config directory.

Secondly I think you may have muddled up the settings of 2 different Sublime Text packages, those being Auto​PEP8 and Python PEP8 Autoformat. Given the warning message you mention it seems reasonable to assume you installed AutoPep8 but the settings you show are a combination of the 2 packages, see the default AutoPep8.sublime-settings file and the default pep8_autoformat.sublime-settings file. Both packages have an ignore setting but the Python PEP8 Autoformat package expects a list of strings, which is what you used, while the AutoPep8 package expects a string of comma separated values, which is what I think you should have used.

You should be able to open your user AutoPep8.sublime-settings file using the Sublime Text menu:

Menu --> Preferences --> Package Settings --> AutoPep8 --> Settings – User

I suggest you try these AutoPep8.sublime-settings settings:

{
    "format_on_save": true,
    "max-line-length": 100,
    // Crucially "ignore" uses a string with comma
    // separated values and not a list of strings.
    "ignore": "E251, W291, E501"
}

Upvotes: 1

Related Questions