Skip to content

Commit 0ef37a2

Browse files
committed
Add cpplint
1 parent 9612439 commit 0ef37a2

File tree

2 files changed

+77
-0
lines changed

2 files changed

+77
-0
lines changed

.pre-commit-config.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,10 @@ repos:
1717
rev: v20.1.8
1818
hooks:
1919
- id: clang-format
20+
21+
- repo: https://github.com/cpplint/cpplint
22+
rev: 2.0.0
23+
hooks:
24+
- id: cpplint
25+
args:
26+
- --config=cpplint.cfg

cpplint.cfg

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
#
2+
# Cpplint is a command-line tool to check C/C++ files for style issues following Google's C++ style guide.
3+
# https://github.com/cpplint/cpplint
4+
#
5+
# Type the command below for details about supported options in CPPLINT.cfg.
6+
# > cpplint --help
7+
#
8+
9+
# Do not look for additional CPPLINT.cfg in the parent directories.
10+
set noparent
11+
root=.
12+
extensions=cpp,hpp,c,h
13+
14+
# Limit line length.
15+
linelength=120
16+
17+
# Adjust the following error categories as specified by the filter:
18+
# (filter parameters are concatenated together)
19+
20+
# `build` rules
21+
# Enable a warning about C++ features that were not in the original
22+
# C++11 specification (and so might not be well-supported). In the
23+
# case of F´, the minimum supported platforms are potentially not
24+
# new enough to afford to do without this warning.
25+
filter=+build/c++11
26+
27+
# F´ uses `#ifndef FOO_H` guard not the `#pragma once`.
28+
filter=-build/pragma_once
29+
30+
# Do not enforce including header files in both .h and .cpp.
31+
filter=-build/header_guard
32+
filter=-build/include
33+
filter=-build/include_alpha
34+
filter=-build/include_order
35+
filter=-build/include_subdir
36+
filter=-build/include_what_you_use
37+
filter=-build/namespaces
38+
39+
filter=-legal/copyright
40+
41+
filter=-readability/braces
42+
filter=-readability/casting
43+
filter=-readability/namespace
44+
filter=-readability/todo
45+
46+
filter=-runtime/indentation_namespace
47+
filter=-runtime/int
48+
filter=-runtime/references
49+
50+
filter=-whitespace/blank_line
51+
filter=-whitespace/braces
52+
filter=-whitespace/comma
53+
filter=-whitespace/comments
54+
filter=-whitespace/end_of_line
55+
filter=-whitespace/indent
56+
filter=-whitespace/line_length
57+
filter=-whitespace/newline
58+
filter=-whitespace/operators
59+
filter=-whitespace/parens
60+
filter=-whitespace/tab
61+
62+
# There is no need for lint-gardening in the documentation.
63+
exclude_files=Autocoders
64+
exclude_files=ci
65+
exclude_files=cmake
66+
exclude_files=docs
67+
exclude_files=Fpp
68+
exclude_files=FppTest
69+
exclude_files=gtest
70+
exclude_files=build-fprime-automatic-*

0 commit comments

Comments
 (0)