Use clang-format-12

This commit is contained in:
Changho Hwang
2023-03-27 14:00:03 +00:00
parent c706990c18
commit 72431957fd
3 changed files with 5 additions and 4 deletions

View File

@@ -80,6 +80,7 @@ IncludeCategories:
IncludeIsMainRegex: '(Test)?$'
IncludeIsMainSourceRegex: ''
IndentCaseLabels: false
IndentExternBlock: NoIndent
IndentGotoLabels: true
IndentPPDirectives: None
IndentWidth: 2

View File

@@ -20,7 +20,7 @@ jobs:
uses: actions/checkout@v3
- name: Install ClangFormat
run: sudo apt-get install -y clang-format
run: sudo apt-get install -y clang-format-12
- name: Run cpplint
run: make cpplint

View File

@@ -147,14 +147,14 @@ lib: $(LIBOBJTARGETS) $(INCTARGETS) $(LIBTARGET)
tests: $(TESTSBINS)
cpplint:
clang-format -style=file --verbose --Werror --dry-run $(CPPSOURCES)
clang-format-12 -style=file --verbose --Werror --dry-run $(CPPSOURCES)
cpplint-autofix:
clang-format -style=file --verbose --Werror -i $(CPPSOURCES)
clang-format-12 -style=file --verbose --Werror -i $(CPPSOURCES)
# Run cpplint on a single file, example: make cpplint-file INPUTFILE=src/bootstrap/bootstrap.cc
cpplint-file-autofix:
clang-format -style=file --verbose --Werror -i $(INPUTFILE)
clang-format-12 -style=file --verbose --Werror -i $(INPUTFILE)
# Compile libobjs
$(BUILDDIR)/$(OBJDIR)/%.o: %.cc $(HEADERS)