Created
November 25, 2011 02:20
-
-
Save jfromaniello/1392663 to your computer and use it in GitHub Desktop.
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
# -*- coding: utf-8 -*- | |
# coffeescript.py - sublimelint package for checking coffee files | |
import re | |
import subprocess | |
import itertools | |
from base_linter import BaseLinter | |
CONFIG = { | |
'language': 'coffeescript', | |
'lint_args': '-l' | |
} | |
class Linter(BaseLinter): | |
def get_executable(self, view): | |
candidates = ["coffee", "coffee.cmd"] | |
for try_executable_result in itertools.imap(self.try_executable, candidates): | |
if try_executable_result[0]: | |
return try_executable_result | |
return (False, '', "can't find any coffee transpiler " + str(candidates)) | |
def try_executable(self, executable): | |
try: | |
subprocess.call([executable, '-v'], startupinfo=self.get_startupinfo()) | |
return (True, executable, '') | |
except OSError: | |
return (False, '', 'coffee or coffee.cmd (windows) is required') | |
#....... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment