mirror of https://github.com/zulip/zulip.git
linter: Move custom_check_file to global namespace.
This is needed in order to mock the method when testing `custom_check.py`. The diff for this commit is a bit broken; all it really does is moving the method out of `build_custom_checkers`.
This commit is contained in:
parent
7a2234dfa2
commit
b5cf31efdc
|
@ -14,10 +14,7 @@ from typing import cast, Any, Callable, Dict, List, Optional, Tuple
|
|||
RuleList = List[Dict[str, Any]] # mypy currently requires Aliases at global scope
|
||||
# https://github.com/python/mypy/issues/3145
|
||||
|
||||
def build_custom_checkers(by_lang):
|
||||
# type: (Dict[str, List[str]]) -> Tuple[Callable[[], bool], Callable[[], bool]]
|
||||
|
||||
def custom_check_file(fn, identifier, rules, color, skip_rules=None, max_length=None):
|
||||
def custom_check_file(fn, identifier, rules, color, skip_rules=None, max_length=None):
|
||||
# type: (str, str, RuleList, str, Optional[Any], Optional[int]) -> bool
|
||||
failed = False
|
||||
|
||||
|
@ -103,6 +100,9 @@ def build_custom_checkers(by_lang):
|
|||
|
||||
return failed
|
||||
|
||||
def build_custom_checkers(by_lang):
|
||||
# type: (Dict[str, List[str]]) -> Tuple[Callable[[], bool], Callable[[], bool]]
|
||||
|
||||
# By default, a rule applies to all files within the extension for which it is specified (e.g. all .py files)
|
||||
# There are three operators we can use to manually include or exclude files from linting for a rule:
|
||||
# 'exclude': 'set([<path>, ...])' - if <path> is a filename, excludes that file.
|
||||
|
|
Loading…
Reference in New Issue