How can I ignore a lint error for a line with Sublime Text 3 Anaconda?
I am afraid that you can't ignore an error type (like line too long) just for some lines. You can't disable just warnings or violations neither.
It would be possible to implement some custom system like the #noqa
comment in flake8
to make the plugin able to just ignore certain lines of code but this has to be implemented as it's not supported by the plugin and there are no plans to use flake8
in replacement of PyFlakes
and pep8
that are already being used by separate.
There is a similar (but in a much more abstract way) request already in the issues in the GitHub project, you can find it here https://github.com/DamnWidget/anaconda/issues/142
To disable lints for specific errors, go to the Anaconda.sublime-settings file (Preferences > Packages Settings > Anaconda > Settings). There you will find several options depending on which linter you are using.
For example, to disable linting for "line too long" for pep8, fill in the following:
"pep8_ignore":
[
"E501"
],
Also, the easiest way to find out the correct error code is to the view the lint error itself at the bottom of the screen.
As of today (Oct 15, 2017), it appears to me that you can use the # noqa
syntax with Anaconda for Sublime Text 3. For line too long, you would add # noqa E501
to the end of the line.
Example:
shipping_account = models.ForeignKey(Account, related_name='order_shipping_set') # noqa E501