mirror of https://github.com/zulip/zulip.git
lint: Extract get_rules_applying_to_fn().
This commit is contained in:
parent
eda138343b
commit
08e44aac0d
|
@ -74,15 +74,7 @@ def get_line_info_from_file(fn: str) -> List[LineTup]:
|
|||
line_tups.append(tup)
|
||||
return line_tups
|
||||
|
||||
def custom_check_file(fn: str,
|
||||
identifier: str,
|
||||
rules: RuleList,
|
||||
color: Optional[Iterable[str]],
|
||||
max_length: Optional[int]=None) -> bool:
|
||||
failed = False
|
||||
|
||||
line_tups = get_line_info_from_file(fn=fn)
|
||||
|
||||
def get_rules_applying_to_fn(fn: str, rules: RuleList) -> RuleList:
|
||||
rules_to_apply = []
|
||||
for rule in rules:
|
||||
excluded = False
|
||||
|
@ -101,6 +93,19 @@ def custom_check_file(fn: str,
|
|||
continue
|
||||
rules_to_apply.append(rule)
|
||||
|
||||
return rules_to_apply
|
||||
|
||||
def custom_check_file(fn: str,
|
||||
identifier: str,
|
||||
rules: RuleList,
|
||||
color: Optional[Iterable[str]],
|
||||
max_length: Optional[int]=None) -> bool:
|
||||
failed = False
|
||||
|
||||
line_tups = get_line_info_from_file(fn=fn)
|
||||
|
||||
rules_to_apply = get_rules_applying_to_fn(fn=fn, rules=rules)
|
||||
|
||||
for rule in rules_to_apply:
|
||||
exclude_lines = {
|
||||
line for
|
||||
|
|
Loading…
Reference in New Issue