本文整理匯總了Python中gitlint.config.LintConfig.apply_on_csv_string方法的典型用法代碼示例。如果您正苦於以下問題:Python LintConfig.apply_on_csv_string方法的具體用法?Python LintConfig.apply_on_csv_string怎麽用?Python LintConfig.apply_on_csv_string使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類gitlint.config.LintConfig
的用法示例。
在下文中一共展示了LintConfig.apply_on_csv_string方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: get_config
# 需要導入模塊: from gitlint.config import LintConfig [as 別名]
# 或者: from gitlint.config.LintConfig import apply_on_csv_string [as 別名]
def get_config(ctx, target, config_path, c, ignore, verbose, silent):
""" Creates a LintConfig object based on a set of commandline parameters. """
try:
# Config precedence:
# First, load default config or config from configfile
lint_config = load_config_from_path(ctx, config_path)
# default to default configuration when no config file was loaded
if lint_config:
click.echo("Using config from {0}".format(lint_config.config_path))
else:
lint_config = LintConfig()
# Then process any commandline configuration flags
lint_config.apply_config_options(c)
# Finally, overwrite with any convenience commandline flags
lint_config.apply_on_csv_string(ignore, lint_config.disable_rule)
if silent:
lint_config.verbosity = 0
elif verbose > 0:
lint_config.verbosity = verbose
# Set target
lint_config.target = target
return lint_config
except LintConfigError as e:
click.echo("Config Error: {0}".format(str(e)))
ctx.exit(CONFIG_ERROR_CODE) # return CONFIG_ERROR_CODE on config error