本文整理汇总了Python中pylint.lint.PyLinter.quiet方法的典型用法代码示例。如果您正苦于以下问题:Python PyLinter.quiet方法的具体用法?Python PyLinter.quiet怎么用?Python PyLinter.quiet使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pylint.lint.PyLinter
的用法示例。
在下文中一共展示了PyLinter.quiet方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: process_file
# 需要导入模块: from pylint.lint import PyLinter [as 别名]
# 或者: from pylint.lint.PyLinter import quiet [as 别名]
def process_file(filename):
"""
Analyze the file with pylint and write the result
to a database
"""
linter = PyLinter()
checkers.initialize(linter)
linter.read_config_file()
linter.quiet = 1
filemods = linter.expand_files((filename, ))
if filemods:
old_stats = config.load_results(filemods[0].get('basename'))
old_score = old_stats.get('global_note', 0.0)
linter.check(filename)
score = eval(linter.config.evaluation, {}, linter.stats)
# Calculate the credit for both scores
if score < 0:
credit = 2.0 * score
elif score < old_score:
credit = -1.5 * (old_score - score)
elif score < MINIMUM_SCORE:
credit = -1.5 * (MINIMUM_SCORE - score)
else:
credit = score - old_score
return score, old_score, credit
示例2: PyLinter
# 需要导入模块: from pylint.lint import PyLinter [as 别名]
# 或者: from pylint.lint.PyLinter import quiet [as 别名]
#!/usr/bin/env python
from pylint.lint import PyLinter
from pylint import checkers
linter = PyLinter()
checkers.initialize(linter)
linter.quiet = 999
linter.check("errors.py")
s=linter.stats