|
14 | 14 | from pathlib import Path |
15 | 15 | from typing import Any, Dict, List, Tuple, Union |
16 | 16 |
|
17 | | -from tabulate import tabulate |
18 | | - |
19 | 17 | from .. import docscrape, validate |
20 | 18 | from .utils import find_project_root |
21 | 19 |
|
@@ -193,7 +191,7 @@ def _get_numpydoc_issues(self, node: ast.AST) -> None: |
193 | 191 | ) |
194 | 192 | self.findings.extend( |
195 | 193 | [ |
196 | | - [f'{self.filepath}:{report["file_line"]}', name, check, description] |
| 194 | + [f"{self.filepath}:{report['file_line']}", name, check, description] |
197 | 195 | for check, description in report["errors"] |
198 | 196 | if not self._ignore_issue(node, check) |
199 | 197 | ] |
@@ -371,19 +369,12 @@ def run_hook( |
371 | 369 | config_options = parse_config(config or project_root) |
372 | 370 | config_options["checks"] -= set(ignore or []) |
373 | 371 |
|
374 | | - findings = [] |
| 372 | + findings = False |
375 | 373 | for file in files: |
376 | | - findings.extend(process_file(file, config_options)) |
377 | | - |
378 | | - if findings: |
379 | | - print( |
380 | | - tabulate( |
381 | | - findings, |
382 | | - headers=["file", "item", "check", "description"], |
383 | | - tablefmt="grid", |
384 | | - maxcolwidths=50, |
385 | | - ), |
386 | | - file=sys.stderr, |
387 | | - ) |
388 | | - return 1 |
389 | | - return 0 |
| 374 | + if file_issues := process_file(file, config_options): |
| 375 | + findings = True |
| 376 | + |
| 377 | + for line, obj, check, description in file_issues: |
| 378 | + print(f"\n{line}: {check} {description}", file=sys.stderr) |
| 379 | + |
| 380 | + return int(findings) |
0 commit comments