Created
November 25, 2014 01:20
-
-
Save rakete/2699be18d4218685c66d to your computer and use it in GitHub Desktop.
hack to make pylint work with hy-lang
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python2.7 | |
import ast | |
from hy.lex import LexException, PrematureEndOfInput, tokenize | |
from hy.compiler import hy_compile, HyTypeError | |
import astroid.builder | |
from _ast import PyCF_ONLY_AST | |
def parse(string): | |
try: | |
return compile(string, "<string>", 'exec', PyCF_ONLY_AST) | |
except: | |
tokens = tokenize(string) | |
return hy_compile(tokens, '__console__', root=ast.Module) | |
astroid.builder.parse = parse | |
from pylint import run_pylint | |
run_pylint() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For anyone wondering how to make this work, looks like astroid builder now uses
_parse
instead ofparse
.