mirror of
https://github.com/zulip/zulip.git
synced 2025-11-07 15:33:30 +00:00
lint: Extract get_rules_applying_to_fn().
This commit is contained in:
@@ -74,15 +74,7 @@ def get_line_info_from_file(fn: str) -> List[LineTup]:
|
|||||||
line_tups.append(tup)
|
line_tups.append(tup)
|
||||||
return line_tups
|
return line_tups
|
||||||
|
|
||||||
def custom_check_file(fn: str,
|
def get_rules_applying_to_fn(fn: str, rules: RuleList) -> RuleList:
|
||||||
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 = []
|
rules_to_apply = []
|
||||||
for rule in rules:
|
for rule in rules:
|
||||||
excluded = False
|
excluded = False
|
||||||
@@ -101,6 +93,19 @@ def custom_check_file(fn: str,
|
|||||||
continue
|
continue
|
||||||
rules_to_apply.append(rule)
|
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:
|
for rule in rules_to_apply:
|
||||||
exclude_lines = {
|
exclude_lines = {
|
||||||
line for
|
line for
|
||||||
|
|||||||
Reference in New Issue
Block a user