本文整理汇总了Python中pylint.lint.PyLinter.global_set_option方法的典型用法代码示例。如果您正苦于以下问题:Python PyLinter.global_set_option方法的具体用法?Python PyLinter.global_set_option怎么用?Python PyLinter.global_set_option使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pylint.lint.PyLinter
的用法示例。
在下文中一共展示了PyLinter.global_set_option方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: list
# 需要导入模块: from pylint.lint import PyLinter [as 别名]
# 或者: from pylint.lint.PyLinter import global_set_option [as 别名]
"""
yield
got = self.linter.release_messages()
msg = ('Expected messages did not match actual.\n'
'Expected:\n%s\nGot:\n%s' % ('\n'.join(repr(m) for m in messages),
'\n'.join(repr(m) for m in got)))
self.assertEqual(got, list(messages), msg)
# Init
test_reporter = TestReporter()
linter = PyLinter()
linter.set_reporter(test_reporter)
linter.config.persistent = 0
checkers.initialize(linter)
linter.global_set_option('required-attributes', ('__revision__',))
if linesep != '\n':
LINE_RGX = re.compile(linesep)
def ulines(string):
return LINE_RGX.sub('\n', string)
else:
def ulines(string):
return string
INFO_TEST_RGX = re.compile(r'^func_i\d\d\d\d$')
def exception_str(self, ex):
"""function used to replace default __str__ method of exception instances"""
return 'in %s\n:: %s' % (ex.file, ', '.join(ex.args))
示例2: TestReporter
# 需要导入模块: from pylint.lint import PyLinter [as 别名]
# 或者: from pylint.lint.PyLinter import global_set_option [as 别名]
from os.path import exists
from logilab.common import testlib
from utils import get_tests_info, fix_path, TestReporter
from logilab.astng import MANAGER
from pylint.lint import PyLinter
from pylint import checkers
test_reporter = TestReporter()
linter = PyLinter()
linter.set_reporter(test_reporter)
linter.config.persistent = 0
checkers.initialize(linter)
linter.global_set_option("required-attributes", ("__revision__",))
PY23 = sys.version_info >= (2, 3)
PY26 = sys.version_info >= (2, 6)
if linesep != "\n":
LINE_RGX = re.compile(linesep)
def ulines(string):
return LINE_RGX.sub("\n", string)
else:
def ulines(string):