mirror of
https://github.com/zulip/zulip.git
synced 2026-06-24 21:08:25 +08:00
lint: Extract get_line_info_from_file().
This commit is contained in:
parent
6d88210110
commit
eda138343b
@ -63,13 +63,7 @@ FILES_WITH_LEGACY_SUBJECT = {
|
||||
'zerver/tests/test_narrow.py',
|
||||
}
|
||||
|
||||
def custom_check_file(fn: str,
|
||||
identifier: str,
|
||||
rules: RuleList,
|
||||
color: Optional[Iterable[str]],
|
||||
max_length: Optional[int]=None) -> bool:
|
||||
failed = False
|
||||
|
||||
def get_line_info_from_file(fn: str) -> List[LineTup]:
|
||||
line_tups = []
|
||||
for i, line in enumerate(open(fn)):
|
||||
line_newline_stripped = line.strip('\n')
|
||||
@ -78,6 +72,16 @@ def custom_check_file(fn: str,
|
||||
continue
|
||||
tup = (i, line, line_newline_stripped, line_fully_stripped)
|
||||
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)
|
||||
|
||||
rules_to_apply = []
|
||||
for rule in rules:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user