From 2ccc3a364e4a6491e62ad836a237eb1603ddef6a Mon Sep 17 00:00:00 2001 From: Krishna Vedala <7001608+kvedala@users.noreply.github.com> Date: Wed, 26 Aug 2020 10:02:39 -0400 Subject: [PATCH] added explicit clang-format step in workflow --- .github/workflows/awesome_workflow.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/awesome_workflow.yml b/.github/workflows/awesome_workflow.yml index bf9220f2d..a27edf60a 100644 --- a/.github/workflows/awesome_workflow.yml +++ b/.github/workflows/awesome_workflow.yml @@ -16,7 +16,7 @@ jobs: - name: requirements run: | sudo apt -qq -y update - sudo apt -qq install clang-tidy-11 + sudo apt -qq install clang-tidy-10 clang-format-10 # checks are passing with less errors when used with this version. # The default installs v6.0 which did not work out well in my tests - name: Setup Git Specs @@ -122,18 +122,18 @@ jobs: if not cpp_files: sys.exit(0) + subprocess.run(["clang-format-10", "-i", "-style=file", *cpp_files], + check=True, text=True, stderr=subprocess.STDOUT) + + subprocess.run(["git commit", "-am 'clang-format fixes for $GITHUB_SHA' || true"], + check=True, text=True, stderr=subprocess.STDOUT) + subprocess.run(["clang-tidy-10", "--fix", "-p=build", "--extra-arg=-std=c++11", *cpp_files, "--"], check=True, text=True, stderr=subprocess.STDOUT) # for cpp_file in cpp_files: # subprocess.run(["clang-tidy-10", "--fix", "-p=build", cpp_file, "--"], # check=True, text=True, stderr=subprocess.STDOUT) - # print("g++:") - # compile_exts = tuple(".c .c++ .cc .cpp .cu .cxx".split()) - # compile_files = [file for file in cpp_files if file.lower().endswith(compile_exts)] - # for cpp_file in cpp_files: - # subprocess.run(["g++", cpp_file], check=True, text=True) - upper_files = [file for file in cpp_files if file != file.lower()] if upper_files: print(f"{len(upper_files)} files contain uppercase characters:")