added explicit clang-format step in workflow

This commit is contained in:
Krishna Vedala 2020-08-26 10:02:39 -04:00
parent 3b6d22ea0a
commit 2ccc3a364e
No known key found for this signature in database
GPG Key ID: BA19ACF8FC8792F7

View File

@ -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:")