本文整理汇总了Python中pylint.checkers.BaseChecker方法的典型用法代码示例。如果您正苦于以下问题:Python checkers.BaseChecker方法的具体用法?Python checkers.BaseChecker怎么用?Python checkers.BaseChecker使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pylint.checkers
的用法示例。
在下文中一共展示了checkers.BaseChecker方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: register
# 需要导入模块: from pylint import checkers [as 别名]
# 或者: from pylint.checkers import BaseChecker [as 别名]
def register(linter: BaseChecker) -> None:
linter.register_checker(AsyncAwaitChecker(linter))
示例2: register
# 需要导入模块: from pylint import checkers [as 别名]
# 或者: from pylint.checkers import BaseChecker [as 别名]
def register(linter):
"""pylint will call this func to register all our checkers"""
# Walk all the classes in this module and register ours.
this_module = sys.modules[__name__]
for member in dir(this_module):
if (not member.endswith('Checker') or
member in ('BaseChecker', 'IAstroidChecker')):
continue
cls = getattr(this_module, member)
linter.register_checker(cls(linter))
示例3: test_pylint_visit_method_taken_in_account
# 需要导入模块: from pylint import checkers [as 别名]
# 或者: from pylint.checkers import BaseChecker [as 别名]
def test_pylint_visit_method_taken_in_account(linter):
class CustomChecker(checkers.BaseChecker):
__implements__ = interfaces.IAstroidChecker
name = "custom"
msgs = {"W9999": ("", "custom", "")}
@check_messages("custom")
def visit_class(self, _):
pass
linter.register_checker(CustomChecker(linter))
linter.open()
out = StringIO()
linter.set_reporter(text.TextReporter(out))
linter.check("abc")