Introduce cpplint (#1929)

This commit is contained in:
Ken Matsui 2024-01-29 08:47:28 -08:00 committed by GitHub
parent baea2dce47
commit 359b63fa77
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 53 additions and 0 deletions

View File

@ -19,3 +19,14 @@ jobs:
- name: Check formatting
run: ./format.sh && git diff --exit-code
cpplint:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Install cpplint
run: pip install cpplint
- name: Run lint
run: cpplint --recursive .

42
CPPLINT.cfg Normal file
View File

@ -0,0 +1,42 @@
# Stop searching for additional config files.
set noparent
exclude_files=trantor
exclude_files=build
# Use non-const reference rather than a pointer.
filter=-runtime/references
# CHECK macros are from Drogon, not Google Test.
filter=-readability/check
# Don't warn about the use of C++11 features.
filter=-build/c++11
filter=-build/include_subdir
# We prioritize clang-format for now.
filter=-whitespace
# We don't require a username in TODO comments.
filter=-readability/todo
# TODO: Fix these.
filter=-legal/copyright
filter=-build/storage_class
filter=-build/namespaces
filter=-build/include
filter=-build/header_guard
filter=-build/include_what_you_use
filter=-build/include_order
filter=-build/explicit_make_pair
filter=-runtime/explicit
filter=-runtime/string
filter=-runtime/int
filter=-readability/multiline_string
filter=-readability/inheritance
filter=-readability/casting
filter=-readability/alt_tokens
filter=-readability/braces
filter=-readability/fn_size
filter=-runtime/threadsafe_fn