<s> import logging <EOL> import os <EOL> from lintreview . tools import Tool <EOL> from lintreview . tools import run_command <EOL> from lintreview . utils import in_path <EOL> from lintreview . utils import npm_exists <EOL> log = logging . getLogger ( __name__ ) <EOL> class Jscs ( Tool ) : <EOL> name = '<STR_LIT>' <EOL> def check_dependencies ( self ) : <EOL> """<STR_LIT>""" <EOL> return in_path ( '<STR_LIT>' ) or npm_exists ( '<STR_LIT>' ) <EOL> def match_file ( self , filename ) : <EOL> base = os . path . basename ( filename ) <EOL> name , ext = os . path . splitext ( base ) <EOL> return ext == '<STR_LIT>' <EOL> def process_files ( self , files ) : <EOL> """<STR_LIT>""" <EOL> log . debug ( '<STR_LIT>' , files , self . name ) <EOL> command = self . create_command ( files ) <EOL> output = run_command ( <EOL> command , <EOL> ignore_error = True ) <EOL> self . _process_checkstyle ( output ) <EOL> def create_command ( self , files ) : <EOL> cmd = '<STR_LIT>' <EOL> if npm_exists ( '<STR_LIT>' ) : <EOL> cmd = os . path . join ( os . getcwd ( ) , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> command = [ cmd , '<STR_LIT>' ] <EOL> if self . options . get ( '<STR_LIT>' ) : <EOL> command += [ '<STR_LIT>' , self . apply_base ( self . options [ '<STR_LIT>' ] ) ] <EOL> else : <EOL> command += [ '<STR_LIT>' , self . options . get ( '<STR_LIT>' , '<STR_LIT>' ) ] <EOL> command += files <EOL> return command </s>
