mirror of
https://hub.njuu.cf/TheAlgorithms/C-Plus-Plus.git
synced 2023-10-11 13:05:55 +08:00
added explicit clang-format step in workflow
This commit is contained in:
parent
3b6d22ea0a
commit
2ccc3a364e
14
.github/workflows/awesome_workflow.yml
vendored
14
.github/workflows/awesome_workflow.yml
vendored
@ -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:")
|
||||
|
Loading…
Reference in New Issue
Block a user