Skip to content

Commit 8b1206e

Browse files
committed
~
1 parent f3cb4bb commit 8b1206e

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

clang-tools-extra/docs/clang-tidy/checks/bugprone/unsafe-functions.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
bugprone-unsafe-functions
44
=========================
55

6-
76
Checks for functions that have safer, more secure replacements available, or
87
are considered deprecated due to design flaws.
98
The check heavily relies on the functions from the

llvm/utils/git/code-lint-helper.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class LintArgs:
3636
clang_tidy_binary: str = "clang-tidy"
3737
doc8_binary: str = "doc8"
3838

39-
def __init__(self, args: argparse.Namespace = None) -> None:
39+
def __init__(self, args: argparse.Namespace) -> None:
4040
if not args is None:
4141
self.start_rev = args.start_rev
4242
self.end_rev = args.end_rev
@@ -315,9 +315,18 @@ def run_linter_tool(self, doc_files: List[str], args: LintArgs) -> Optional[str]
315315
check=False,
316316
)
317317

318+
if proc.returncode == 0:
319+
return None
320+
318321
output = proc.stdout.strip()
319-
if proc.returncode != 0 and not output:
320-
return proc.stderr.strip()
322+
if output:
323+
return output
324+
325+
error_output = proc.stderr.strip()
326+
if error_output:
327+
return error_output
328+
329+
return f"doc8 exited with return code {proc.returncode} but no output."
321330

322331

323332
ALL_LINTERS = (ClangTidyLintHelper(), Doc8LintHelper())

0 commit comments

Comments
 (0)