本文整理匯總了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")