mirror of
https://github.com/pre-commit/pre-commit-hooks.git
synced 2026-04-04 19:26:52 +00:00
adjust error outputs to be more standardized
This commit is contained in:
parent
48c60be15b
commit
b13ff9b868
6 changed files with 22 additions and 13 deletions
|
|
@ -28,13 +28,13 @@ def check_docstring_first(src: bytes, filename: str = '<unknown>') -> int:
|
|||
if tok_type == tokenize.STRING and scol == 0:
|
||||
if found_docstring_line is not None:
|
||||
print(
|
||||
f'{filename}:{sline} Multiple module docstrings '
|
||||
f'{filename}:{sline}: Multiple module docstrings '
|
||||
f'(first docstring on line {found_docstring_line}).',
|
||||
)
|
||||
return 1
|
||||
elif found_code_line is not None:
|
||||
print(
|
||||
f'{filename}:{sline} Module docstring appears after code '
|
||||
f'{filename}:{sline}: Module docstring appears after code '
|
||||
f'(code seen on line {found_code_line}).',
|
||||
)
|
||||
return 1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue