#NEWLINE# def check( self , code , filename ) : #NEWLINE# #INDENT# 'Run flake8 on code and return the output.' #NEWLINE# options = { #NEWLINE# #INDENT# 'reporter' : self . get_report ( ) , #NEWLINE# 'jobs' : '1' , #NEWLINE# #UNINDENT# } #NEWLINE# type_map = { #NEWLINE# #INDENT# 'select' : [ ] , #NEWLINE# 'ignore' : [ ] , #NEWLINE# 'builtins' : '' , #NEWLINE# 'max-line-length' : 0 , #NEWLINE# 'max-complexity' : 0 , #NEWLINE# 'show-code' : False , #NEWLINE# #UNINDENT# } #NEWLINE# self . build_options ( options , type_map , transform = ( lambda s : s . replace ( '-' , '_' ) ) ) #NEWLINE# self . show_code = options . pop ( 'show_code' , False ) #NEWLINE# if persist . debug_mode ( ) : #NEWLINE# #INDENT# persist . printf ( '{} options: {}' . format ( self . name , options ) ) #NEWLINE# #UNINDENT# if ( self . pyflakes_checker_class is not None ) : #NEWLINE# #INDENT# builtins = set ( self . pyflakes_checker_module . builtin_vars ) . union ( self . pyflakes_checker_module . _MAGIC_GLOBALS ) #NEWLINE# self . pyflakes_checker_class . builtIns = builtins #NEWLINE# #UNINDENT# linter = self . module . get_style_guide ( ** options ) #NEWLINE# return linter . input_file ( filename = os . path . basename ( filename ) , lines = code . splitlines ( keepends = True ) )