0

I've just installed SublimeLinter to help me manage my Python code. Currently it is flagging up blank lines as errors which is annoying so I wanted to disable that by writing some ignore settings in the user config file.

The config file is located in ~./config/sublime-test-2/Packages/User/SublimeLinter.sublime-settings

{ "pep8_ignore": [ "W239" ] }

If I try to add a comma after the square brackets I get "Trailing comma before closing brackets" when saving

If I try to add a comma after the curly brackets I get "unexpected trailing characters" when saving

If I leave it as it is above and close and reopen sublime I get the error message:

"Error trying to parse settings: Unexpected character, expected a comma or closing bracket in ~/.config/sublime-text-2/Packages/SublimeLinter/SublimeLinter.sublime-settings:194:9

(despite the file only being a few lines long.

I've looked on here and other places to look for examples and it seems I'm doing it exactly as others have done. Any advice would be much appreciated. Sorry if my formatting isn't great, I'm getting use to the stackoverflow way of doing things.

JJJ
  • 32,902
  • 20
  • 89
  • 102
UniProg
  • 1
  • 1

1 Answers1

0

From the error you're getting, you cut something out of the original settings file (~/.config/sublime-text-2/Packages/SublimeLinter/SublimeLinter.sublime-settings) when you made your Packages/User/SublimeLinter.sublime-settings file. Head over to the SublimeLinter GitHub site and download the original version.

Next, save that original version both in the Packages/SublimeLinter directory and and your Packages/User directory. The User one will override the other, but you need to remember that any keys you make changes to need to be replicated in full (please read the README in full to understand) in order for everything to work properly. Now, you can scroll down in the User copy to the "pep8_ignore": section and add "W239" on its own line, with commas , separating lines. So, the full section should look like this:

"pep8_ignore":
[
    "E501",
    "W239"
],

Feel free to add new errors/warnings as you want, but remember that others in the community will likely look more favorably on your code the more closely you follow PEP8. That being said, some of the warnings are rather silly, but over time I've found myself coding closer to the guidelines, and it really does result in cleaner, more easily-read code, especially if you come back to something after a while.

MattDMo
  • 100,794
  • 21
  • 241
  • 231