diff --git a/.clang-format b/.clang-format index 020d4667..c3bb0335 100644 --- a/.clang-format +++ b/.clang-format @@ -80,6 +80,7 @@ IncludeCategories: IncludeIsMainRegex: '(Test)?$' IncludeIsMainSourceRegex: '' IndentCaseLabels: false +IndentExternBlock: NoIndent IndentGotoLabels: true IndentPPDirectives: None IndentWidth: 2 diff --git a/.github/workflows/cpplint.yml b/.github/workflows/cpplint.yml index 980e0080..72da335e 100644 --- a/.github/workflows/cpplint.yml +++ b/.github/workflows/cpplint.yml @@ -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 diff --git a/Makefile b/Makefile index 2831d0e4..d1a1a1f8 100644 --- a/Makefile +++ b/Makefile @@ -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)