Skip to content

Commit d3fc88c

Browse files
committed
add return value to clang-tidy main
1 parent dd98f39 commit d3fc88c

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ repos:
3636

3737
# Start: for development testing
3838
- repo: https://github.com/shenxianpeng/cpp-linter-hooks
39-
rev: cf62613fe77f66cc826cbebcf2693bf0872dc764
39+
rev: dd98f398f2bc72869a39a9c56d97940408f6d3b4
4040
hooks:
4141
- id: clang-format
4242
args: [--style=Google, --version=13]

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# cpp-linter-hooks
22

3-
[![Test](https://github.com/shenxianpeng/cpp-linter-hooks/actions/workflows/test.yml/badge.svg)](https://github.com/shenxianpeng/cpp-linter-hooks/actions/workflows/test.yml) [![codecov](https://codecov.io/gh/shenxianpeng/cpp-linter-hooks/branch/master/graph/badge.svg?token=L74Z3HZ4Y5)](https://codecov.io/gh/shenxianpeng/cpp-linter-hooks)
3+
[![Test](https://github.com/shenxianpeng/cpp-linter-hooks/actions/workflows/test.yml/badge.svg)](https://github.com/shenxianpeng/cpp-linter-hooks/actions/workflows/test.yml)
4+
[![codecov](https://codecov.io/gh/shenxianpeng/cpp-linter-hooks/branch/main/graph/badge.svg?token=L74Z3HZ4Y5)](https://codecov.io/gh/shenxianpeng/cpp-linter-hooks)
45

56
Using `clang-format` and `clang-tidy` hooks with [pre-commit](https://pre-commit.com/) to lint your C/C++ code.
67

cpp_linter_hooks/clang_tidy.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,13 @@ def run_clang_tidy(args) -> int:
2222
return 1, e
2323

2424

25-
def main():
25+
def main() -> int:
26+
retval = 0
2627
retval, output = run_clang_tidy(args)
2728
if retval != 0:
2829
print(output)
30+
return retval
2931

3032

3133
if __name__ == "__main__":
32-
main()
34+
raise SystemExit(main())

0 commit comments

Comments
 (0)