From 4b68c11c8ef80f28bb5023cfcb223839fb5121f1 Mon Sep 17 00:00:00 2001 From: Twice Date: Fri, 20 Aug 2021 16:23:10 +0800 Subject: [PATCH] check: fix clang-tidy-diff commands (#5972) * check: fix clang-tidy-diff commands * CI: fix step names Co-authored-by: oneflow-ci-bot <69100618+oneflow-ci-bot@users.noreply.github.com> --- .github/workflows/simple.yml | 2 +- .github/workflows/test.yml | 2 +- ci/check/run_clang_tidy.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/simple.yml b/.github/workflows/simple.yml index 369d8bf9d4..b5501d4824 100644 --- a/.github/workflows/simple.yml +++ b/.github/workflows/simple.yml @@ -50,7 +50,7 @@ jobs: -DCMAKE_BUILD_TYPE=Release \ -DBUILD_TESTING=ON cmake --build . -j$(nproc) --target of_git_version oneflow_deps generate_functional of_cfgobj generate_py_cfg - - name: Run Maybe-related checks by clang-tidy + - name: Run clang-tidy for all translation units # use clang as compiler for correct compiler flags run: | cd build diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d259a87b70..6f28bdf03d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -749,7 +749,7 @@ jobs: run: | git remote add upstream https://github.com/Oneflow-Inc/oneflow git fetch upstream - - name: Run Maybe-related checks by clang-tidy + - name: Run clang-tidy for modified files # use clang as compiler for correct compiler flags run: | cd build diff --git a/ci/check/run_clang_tidy.py b/ci/check/run_clang_tidy.py index 9aacd31897..4679ee1785 100644 --- a/ci/check/run_clang_tidy.py +++ b/ci/check/run_clang_tidy.py @@ -91,7 +91,7 @@ if __name__ == "__main__": downloaded = download(args.build_dir) promises = [ run_command( - f"cd .. && git diff -U0 master | {downloaded[1]} -clang-tidy-binary {downloaded[0]} -path {args.build_dir} -quiet -j $(nproc) -p1" + f"cd .. && git diff -U0 master | {downloaded[1]} -clang-tidy-binary {downloaded[0]} -path {args.build_dir} -j $(nproc) -p1 -allow-enabling-alpha-checkers -extra-arg=-Xclang -extra-arg=-analyzer-config -extra-arg=-Xclang -extra-arg=aggressive-binary-operation-simplification=true" ) ] loop.run_until_complete(asyncio.gather(*promises)) -- GitLab