#NEWLINE# def get_config( ctx , target , config_path , c , ignore , verbose , silent ) : #NEWLINE# #INDENT# ' Creates a LintConfig object based on a set of commandline parameters. ' #NEWLINE# try : #NEWLINE# #INDENT# lint_config = load_config_from_path ( ctx , config_path ) #NEWLINE# if lint_config : #NEWLINE# #INDENT# click . echo ( 'Using config from {0}' . format ( lint_config . config_path ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# lint_config = LintConfig ( ) #NEWLINE# #UNINDENT# lint_config . apply_config_options ( c ) #NEWLINE# lint_config . apply_on_csv_string ( ignore , lint_config . disable_rule ) #NEWLINE# if silent : #NEWLINE# #INDENT# lint_config . verbosity = 0 #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( verbose > 0 ) : #NEWLINE# #INDENT# lint_config . verbosity = verbose #NEWLINE# #UNINDENT# #UNINDENT# lint_config . target = target #NEWLINE# return lint_config #NEWLINE# #UNINDENT# except LintConfigError as e : #NEWLINE# #INDENT# click . echo ( 'Config Error: {0}' . format ( str ( e ) ) ) #NEWLINE# #UNINDENT# ctx . exit ( CONFIG_ERROR_CODE )