-# This configuration should work with clang-format 6.0 and higher.
+# This configuration should work with Clang-Format 6.0 and higher.
---
Language: Cpp
BasedOnStyle: LLVM
-# Run clang-format on all code to follow the new code style
+# Run Clang-Format on all code to follow the new code style.
f5795cdbc0703d80ab21f39c49bb2384ea2429ba
format is loosely based on [LLVM's code formatting
style](https://llvm.org/docs/CodingStandards.html) with some exceptions. It's
highly recommended to install
-[clang-format](https://clang.llvm.org/docs/ClangFormat.html) 6.0 or newer and
+[Clang-Format](https://clang.llvm.org/docs/ClangFormat.html) 6.0 or newer and
run `make format` to format changes according to ccache's code style. Or even
-better: set up your editor to run clang-format automatically when saving. If
-you don't run clang-format then the ccache authors have to do it for you.
+better: set up your editor to run Clang-Format automatically when saving. If
+you don't run Clang-Format then the ccache authors have to do it for you.
Please follow these conventions:
-option(ENABLE_CPPCHECK "Enable static analysis with cppcheck" OFF)
+option(ENABLE_CPPCHECK "Enable static analysis with Cppcheck" OFF)
if(ENABLE_CPPCHECK)
if(${CMAKE_VERSION} VERSION_LESS "3.10")
- message(WARNING "CppCheck requires cmake 3.10")
+ message(WARNING "Cppcheck requires CMake 3.10")
else()
find_program(CPPCHECK_EXE cppcheck)
mark_as_advanced(CPPCHECK_EXE) # Don't show in CMake UIs
--template="cppcheck: warning: {id}:{file}:{line}: {message}"
-i src/third_party)
else()
- message(WARNING "cppcheck requested but executable not found")
+ message(WARNING "Cppcheck requested but executable not found")
endif()
endif()
endif()
-option(ENABLE_CLANG_TIDY "Enable static analysis with clang-tidy" OFF)
+option(ENABLE_CLANG_TIDY "Enable static analysis with Clang-Tidy" OFF)
if(ENABLE_CLANG_TIDY)
if(${CMAKE_VERSION} VERSION_LESS "3.6")
- message(WARNING "clang-tidy requires cmake 3.6")
+ message(WARNING "Clang-Tidy requires CMake 3.6")
else()
find_program(CLANGTIDY clang-tidy)
if(CLANGTIDY)
set(CMAKE_CXX_CLANG_TIDY ${CLANGTIDY})
else()
- message(SEND_ERROR "clang-tidy requested but executable not found")
+ message(SEND_ERROR "Clang-Tidy requested but executable not found")
endif()
endif()
endif()
standard_warnings "-Wno-unused-variable")
endif()
elseif(MSVC)
- # Remove any warning level flags added by cmake.
+ # Remove any warning level flags added by CMake.
string(REGEX REPLACE "/W[0-4]" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
string(REGEX REPLACE "/W[0-4]" "" CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS}")
string(REGEX REPLACE "/W[0-4]" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
if [ -n "$check" ]; then
status=1
- echo "Error: $file not formatted with clang-format"
+ echo "Error: $file not formatted with Clang-Format"
echo 'Run "make format" or apply this diff:'
git diff $cf_color --no-index "$file" "$tmp_file" \
| sed -r -e "s!^---.*!--- a/$file!" \
# Only include headers directly in src.
HeaderFilterRegex: 'src/[^/]*$'
CheckOptions:
- # Always add braces (added here just in case clang-tidy default changes).
+ # Always add braces (added here just in case Clang-Tidy default changes).
- key: readability-braces-around-statements.ShortStatementLines
value: 0
# Only include headers directly in unittest.
HeaderFilterRegex: 'unittest/[^/]*$'
CheckOptions:
- # Always add braces (added here just in case clang-tidy default changes).
+ # Always add braces (added here just in case Clang-Tidy default changes).
- key: readability-braces-around-statements.ShortStatementLines
value: 0