mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
ci: clang-tidy: fix attempt (#25328)
This commit is contained in:
parent
c546e7c1f7
commit
9e811136a2
4
.github/workflows/clang-tidy.yml
vendored
4
.github/workflows/clang-tidy.yml
vendored
@ -19,7 +19,7 @@ jobs:
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Testing (clang-tidy-quiet)
|
||||
- name: Testing (clang-tidy)
|
||||
uses: addnab/docker-run-action@v3
|
||||
with:
|
||||
image: px4io/px4-dev-clang:2021-09-08
|
||||
@ -27,4 +27,4 @@ jobs:
|
||||
run: |
|
||||
cd /workspace
|
||||
git config --global --add safe.directory /workspace
|
||||
make clang-tidy-quiet
|
||||
make clang-tidy
|
||||
|
||||
6
Makefile
6
Makefile
@ -468,7 +468,7 @@ python_coverage:
|
||||
|
||||
# static analyzers (scan-build, clang-tidy, cppcheck)
|
||||
# --------------------------------------------------------------------
|
||||
.PHONY: scan-build px4_sitl_default-clang clang-tidy clang-tidy-fix clang-tidy-quiet
|
||||
.PHONY: scan-build px4_sitl_default-clang clang-tidy clang-tidy-fix
|
||||
.PHONY: cppcheck shellcheck_all validate_module_configs
|
||||
|
||||
scan-build:
|
||||
@ -494,10 +494,6 @@ clang-tidy: px4_sitl_default-clang
|
||||
clang-tidy-fix: px4_sitl_default-clang
|
||||
@cd "$(SRC_DIR)"/build/px4_sitl_default-clang && "$(SRC_DIR)"/Tools/run-clang-tidy.py -header-filter=".*\.hpp" -j$(j_clang_tidy) -fix -p .
|
||||
|
||||
# modified version of run-clang-tidy.py to return error codes and only output relevant results
|
||||
clang-tidy-quiet: px4_sitl_default-clang
|
||||
@cd "$(SRC_DIR)"/build/px4_sitl_default-clang && "$(SRC_DIR)"/Tools/run-clang-tidy.py -header-filter=".*\.hpp" -j$(j_clang_tidy) -p .
|
||||
|
||||
# TODO: Fix cppcheck errors then try --enable=warning,performance,portability,style,unusedFunction or --enable=all
|
||||
cppcheck: px4_sitl_default
|
||||
@mkdir -p "$(SRC_DIR)"/build/cppcheck
|
||||
|
||||
@ -110,10 +110,11 @@ def run_tidy(args, tmpdir, build_path, queue):
|
||||
args.extra_arg, args.extra_arg_before)
|
||||
|
||||
try:
|
||||
subprocess.check_call(invocation, stdin=None, stdout=open(os.devnull, 'wb'), stderr=subprocess.STDOUT)
|
||||
subprocess.check_call(invocation, stdin=None, stdout=open(os.devnull, 'w'), stderr=open(os.devnull, 'w'))
|
||||
except subprocess.CalledProcessError as e:
|
||||
sys.stdout.write(' '.join(invocation) + '\n')
|
||||
subprocess.call(invocation)
|
||||
sys.stdout.write(f'failed on {name} --> {" ".join(invocation)}\n')
|
||||
# Now run again to see the actual output
|
||||
subprocess.call(invocation, stdin=None)
|
||||
global tidy_failures
|
||||
tidy_failures = tidy_failures + 1
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user