-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Python: python
Maintainer: LCD 47 lcd047@gmail.com
This checker uses Python's builtin compile()
function for detecting syntax errors.
In Python you have the ability to specify a particular codec at the top of the file with a comment that looks something like # coding: spec
.
Python will see this comment at import time and use the codec to transform the file before using it.
Syntastic has an option g:syntastic_python_python_use_codec
that will make syntastic also aware of these codecs before running compiler checks on the file.
This is especially useful for codecs that significantly transform the file, such as the spec
codec provided by NoseOfYeti.
Note that errors may appear on surprising lines if the transformed file has code on different lines than the raw file.
Just a special note about NoseOfYeti, you first have to register the spec
codec before importing a file with that encoding.
This can be done with two files in your site-packages
folder.
noy.pth
import noy
noy.py
try:
from noseOfYeti.tokeniser.spec_codec import register_from_options
register_from_options()
except ImportError:
pass
The checker needs Python version 2.6 or later.