Skip to content

Commit b76b0ed

Browse files
authored
Merge pull request #1 from mikelawrence/dev
sen5x updates and add tsl2591 component
2 parents f4f00ca + 6b3357d commit b76b0ed

File tree

10 files changed

+2187
-1088
lines changed

10 files changed

+2187
-1088
lines changed

.clang-format

Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
Language: Cpp
2+
AccessModifierOffset: -1
3+
AlignAfterOpenBracket: Align
4+
AlignConsecutiveAssignments: false
5+
AlignConsecutiveDeclarations: false
6+
AlignEscapedNewlines: DontAlign
7+
AlignOperands: true
8+
AlignTrailingComments: true
9+
AllowAllParametersOfDeclarationOnNextLine: true
10+
AllowShortBlocksOnASingleLine: false
11+
AllowShortCaseLabelsOnASingleLine: false
12+
AllowShortFunctionsOnASingleLine: All
13+
AllowShortIfStatementsOnASingleLine: false
14+
AllowShortLoopsOnASingleLine: false
15+
AlwaysBreakAfterReturnType: None
16+
AlwaysBreakBeforeMultilineStrings: false
17+
AlwaysBreakTemplateDeclarations: MultiLine
18+
BinPackArguments: true
19+
BinPackParameters: true
20+
BraceWrapping:
21+
AfterClass: false
22+
AfterControlStatement: false
23+
AfterEnum: false
24+
AfterFunction: false
25+
AfterNamespace: false
26+
AfterObjCDeclaration: false
27+
AfterStruct: false
28+
AfterUnion: false
29+
AfterExternBlock: false
30+
BeforeCatch: false
31+
BeforeElse: false
32+
IndentBraces: false
33+
SplitEmptyFunction: true
34+
SplitEmptyRecord: true
35+
SplitEmptyNamespace: true
36+
BreakBeforeBinaryOperators: None
37+
BreakBeforeBraces: Attach
38+
BreakBeforeInheritanceComma: false
39+
BreakInheritanceList: BeforeColon
40+
BreakBeforeTernaryOperators: true
41+
BreakConstructorInitializersBeforeComma: false
42+
BreakConstructorInitializers: BeforeColon
43+
BreakAfterJavaFieldAnnotations: false
44+
BreakStringLiterals: true
45+
ColumnLimit: 120
46+
CommentPragmas: '^ IWYU pragma:'
47+
CompactNamespaces: false
48+
ConstructorInitializerAllOnOneLineOrOnePerLine: true
49+
ConstructorInitializerIndentWidth: 4
50+
ContinuationIndentWidth: 4
51+
Cpp11BracedListStyle: true
52+
DerivePointerAlignment: false
53+
DisableFormat: false
54+
ExperimentalAutoDetectBinPacking: false
55+
FixNamespaceComments: true
56+
ForEachMacros:
57+
- foreach
58+
- Q_FOREACH
59+
- BOOST_FOREACH
60+
IncludeBlocks: Preserve
61+
IncludeCategories:
62+
- Regex: '^<ext/.*\.h>'
63+
Priority: 2
64+
- Regex: '^<.*\.h>'
65+
Priority: 1
66+
- Regex: '^<.*'
67+
Priority: 2
68+
- Regex: '.*'
69+
Priority: 3
70+
IncludeIsMainRegex: '([-_](test|unittest))?$'
71+
IndentCaseLabels: true
72+
IndentPPDirectives: None
73+
IndentWidth: 2
74+
IndentWrappedFunctionNames: false
75+
KeepEmptyLinesAtTheStartOfBlocks: false
76+
MacroBlockBegin: ''
77+
MacroBlockEnd: ''
78+
MaxEmptyLinesToKeep: 1
79+
NamespaceIndentation: None
80+
PenaltyBreakAssignment: 2
81+
PenaltyBreakBeforeFirstCallParameter: 1
82+
PenaltyBreakComment: 300
83+
PenaltyBreakFirstLessLess: 120
84+
PenaltyBreakString: 1000
85+
PenaltyBreakTemplateDeclaration: 10
86+
PenaltyExcessCharacter: 1000000
87+
PenaltyReturnTypeOnItsOwnLine: 2000
88+
PointerAlignment: Right
89+
RawStringFormats:
90+
- Language: Cpp
91+
Delimiters:
92+
- cc
93+
- CC
94+
- cpp
95+
- Cpp
96+
- CPP
97+
- 'c++'
98+
- 'C++'
99+
CanonicalDelimiter: ''
100+
BasedOnStyle: google
101+
- Language: TextProto
102+
Delimiters:
103+
- pb
104+
- PB
105+
- proto
106+
- PROTO
107+
EnclosingFunctions:
108+
- EqualsProto
109+
- EquivToProto
110+
- PARSE_PARTIAL_TEXT_PROTO
111+
- PARSE_TEST_PROTO
112+
- PARSE_TEXT_PROTO
113+
- ParseTextOrDie
114+
- ParseTextProtoOrDie
115+
CanonicalDelimiter: ''
116+
BasedOnStyle: google
117+
ReflowComments: true
118+
SortIncludes: false
119+
SortUsingDeclarations: false
120+
SpaceAfterCStyleCast: true
121+
SpaceAfterTemplateKeyword: false
122+
SpaceBeforeAssignmentOperators: true
123+
SpaceBeforeCpp11BracedList: false
124+
SpaceBeforeCtorInitializerColon: true
125+
SpaceBeforeInheritanceColon: true
126+
SpaceBeforeParens: ControlStatements
127+
SpaceBeforeRangeBasedForLoopColon: true
128+
SpaceInEmptyParentheses: false
129+
SpacesBeforeTrailingComments: 2
130+
SpacesInAngles: false
131+
SpacesInContainerLiterals: false
132+
SpacesInCStyleCastParentheses: false
133+
SpacesInParentheses: false
134+
SpacesInSquareBrackets: false
135+
Standard: Auto
136+
TabWidth: 2
137+
UseTab: Never

.clang-tidy

Lines changed: 199 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,199 @@
1+
---
2+
Checks: >-
3+
*,
4+
-abseil-*,
5+
-altera-*,
6+
-android-*,
7+
-boost-*,
8+
-bugprone-easily-swappable-parameters,
9+
-bugprone-implicit-widening-of-multiplication-result,
10+
-bugprone-multi-level-implicit-pointer-conversion,
11+
-bugprone-narrowing-conversions,
12+
-bugprone-signed-char-misuse,
13+
-bugprone-switch-missing-default-case,
14+
-cert-dcl50-cpp,
15+
-cert-err33-c,
16+
-cert-err58-cpp,
17+
-cert-oop57-cpp,
18+
-cert-str34-c,
19+
-clang-analyzer-optin.core.EnumCastOutOfRange,
20+
-clang-analyzer-optin.cplusplus.UninitializedObject,
21+
-clang-analyzer-osx.*,
22+
-clang-diagnostic-delete-abstract-non-virtual-dtor,
23+
-clang-diagnostic-delete-non-abstract-non-virtual-dtor,
24+
-clang-diagnostic-deprecated-declarations,
25+
-clang-diagnostic-ignored-optimization-argument,
26+
-clang-diagnostic-missing-field-initializers,
27+
-clang-diagnostic-shadow-field,
28+
-clang-diagnostic-unused-const-variable,
29+
-clang-diagnostic-unused-parameter,
30+
-clang-diagnostic-vla-cxx-extension,
31+
-concurrency-*,
32+
-cppcoreguidelines-avoid-c-arrays,
33+
-cppcoreguidelines-avoid-const-or-ref-data-members,
34+
-cppcoreguidelines-avoid-do-while,
35+
-cppcoreguidelines-avoid-magic-numbers,
36+
-cppcoreguidelines-init-variables,
37+
-cppcoreguidelines-macro-to-enum,
38+
-cppcoreguidelines-macro-usage,
39+
-cppcoreguidelines-missing-std-forward,
40+
-cppcoreguidelines-narrowing-conversions,
41+
-cppcoreguidelines-non-private-member-variables-in-classes,
42+
-cppcoreguidelines-owning-memory,
43+
-cppcoreguidelines-prefer-member-initializer,
44+
-cppcoreguidelines-pro-bounds-array-to-pointer-decay,
45+
-cppcoreguidelines-pro-bounds-constant-array-index,
46+
-cppcoreguidelines-pro-bounds-pointer-arithmetic,
47+
-cppcoreguidelines-pro-type-const-cast,
48+
-cppcoreguidelines-pro-type-cstyle-cast,
49+
-cppcoreguidelines-pro-type-member-init,
50+
-cppcoreguidelines-pro-type-reinterpret-cast,
51+
-cppcoreguidelines-pro-type-static-cast-downcast,
52+
-cppcoreguidelines-pro-type-union-access,
53+
-cppcoreguidelines-pro-type-vararg,
54+
-cppcoreguidelines-rvalue-reference-param-not-moved,
55+
-cppcoreguidelines-special-member-functions,
56+
-cppcoreguidelines-use-default-member-init,
57+
-cppcoreguidelines-virtual-class-destructor,
58+
-fuchsia-multiple-inheritance,
59+
-fuchsia-overloaded-operator,
60+
-fuchsia-statically-constructed-objects,
61+
-fuchsia-default-arguments-declarations,
62+
-fuchsia-default-arguments-calls,
63+
-google-build-using-namespace,
64+
-google-explicit-constructor,
65+
-google-readability-braces-around-statements,
66+
-google-readability-casting,
67+
-google-readability-namespace-comments,
68+
-google-readability-todo,
69+
-google-runtime-references,
70+
-hicpp-*,
71+
-llvm-else-after-return,
72+
-llvm-header-guard,
73+
-llvm-include-order,
74+
-llvm-qualified-auto,
75+
-llvmlibc-*,
76+
-misc-const-correctness,
77+
-misc-include-cleaner,
78+
-misc-no-recursion,
79+
-misc-non-private-member-variables-in-classes,
80+
-misc-unused-parameters,
81+
-misc-use-anonymous-namespace,
82+
-modernize-avoid-bind,
83+
-modernize-avoid-c-arrays,
84+
-modernize-concat-nested-namespaces,
85+
-modernize-macro-to-enum,
86+
-modernize-return-braced-init-list,
87+
-modernize-type-traits,
88+
-modernize-use-auto,
89+
-modernize-use-constraints,
90+
-modernize-use-default-member-init,
91+
-modernize-use-equals-default,
92+
-modernize-use-nodiscard,
93+
-modernize-use-nullptr,
94+
-modernize-use-nodiscard,
95+
-modernize-use-nullptr,
96+
-modernize-use-trailing-return-type,
97+
-mpi-*,
98+
-objc-*,
99+
-performance-enum-size,
100+
-readability-avoid-nested-conditional-operator,
101+
-readability-container-contains,
102+
-readability-container-data-pointer,
103+
-readability-convert-member-functions-to-static,
104+
-readability-else-after-return,
105+
-readability-function-cognitive-complexity,
106+
-readability-implicit-bool-conversion,
107+
-readability-isolate-declaration,
108+
-readability-magic-numbers,
109+
-readability-make-member-function-const,
110+
-readability-named-parameter,
111+
-readability-redundant-casting,
112+
-readability-redundant-inline-specifier,
113+
-readability-redundant-member-init,
114+
-readability-redundant-string-init,
115+
-readability-uppercase-literal-suffix,
116+
-readability-use-anyofallof,
117+
WarningsAsErrors: '*'
118+
FormatStyle: google
119+
CheckOptions:
120+
- key: google-readability-function-size.StatementThreshold
121+
value: '800'
122+
- key: google-runtime-int.TypeSuffix
123+
value: '_t'
124+
- key: llvm-namespace-comment.ShortNamespaceLines
125+
value: '10'
126+
- key: llvm-namespace-comment.SpacesBeforeComments
127+
value: '2'
128+
- key: modernize-loop-convert.MaxCopySize
129+
value: '16'
130+
- key: modernize-loop-convert.MinConfidence
131+
value: reasonable
132+
- key: modernize-loop-convert.NamingStyle
133+
value: CamelCase
134+
- key: modernize-pass-by-value.IncludeStyle
135+
value: llvm
136+
- key: modernize-replace-auto-ptr.IncludeStyle
137+
value: llvm
138+
- key: modernize-use-nullptr.NullMacros
139+
value: 'NULL'
140+
- key: modernize-make-unique.MakeSmartPtrFunction
141+
value: 'make_unique'
142+
- key: modernize-make-unique.MakeSmartPtrFunctionHeader
143+
value: 'esphome/core/helpers.h'
144+
- key: readability-braces-around-statements.ShortStatementLines
145+
value: 2
146+
- key: readability-identifier-naming.LocalVariableCase
147+
value: 'lower_case'
148+
- key: readability-identifier-naming.ClassCase
149+
value: 'CamelCase'
150+
- key: readability-identifier-naming.StructCase
151+
value: 'CamelCase'
152+
- key: readability-identifier-naming.EnumCase
153+
value: 'CamelCase'
154+
- key: readability-identifier-naming.EnumConstantCase
155+
value: 'UPPER_CASE'
156+
- key: readability-identifier-naming.StaticConstantCase
157+
value: 'UPPER_CASE'
158+
- key: readability-identifier-naming.StaticVariableCase
159+
value: 'lower_case'
160+
- key: readability-identifier-naming.GlobalConstantCase
161+
value: 'UPPER_CASE'
162+
- key: readability-identifier-naming.ParameterCase
163+
value: 'lower_case'
164+
- key: readability-identifier-naming.PrivateMemberCase
165+
value: 'lower_case'
166+
- key: readability-identifier-naming.PrivateMemberSuffix
167+
value: '_'
168+
- key: readability-identifier-naming.PrivateMethodCase
169+
value: 'lower_case'
170+
- key: readability-identifier-naming.PrivateMethodSuffix
171+
value: '_'
172+
- key: readability-identifier-naming.ClassMemberCase
173+
value: 'lower_case'
174+
- key: readability-identifier-naming.ClassMemberCase
175+
value: 'lower_case'
176+
- key: readability-identifier-naming.ProtectedMemberCase
177+
value: 'lower_case'
178+
- key: readability-identifier-naming.ProtectedMemberSuffix
179+
value: '_'
180+
- key: readability-identifier-naming.FunctionCase
181+
value: 'lower_case'
182+
- key: readability-identifier-naming.ClassMethodCase
183+
value: 'lower_case'
184+
- key: readability-identifier-naming.ProtectedMethodCase
185+
value: 'lower_case'
186+
- key: readability-identifier-naming.ProtectedMethodSuffix
187+
value: '_'
188+
- key: readability-identifier-naming.VirtualMethodCase
189+
value: 'lower_case'
190+
- key: readability-identifier-naming.VirtualMethodSuffix
191+
value: ''
192+
- key: readability-qualified-auto.AddConstToQualified
193+
value: 0
194+
- key: readability-identifier-length.MinimumVariableNameLength
195+
value: 0
196+
- key: readability-identifier-length.MinimumParameterNameLength
197+
value: 0
198+
- key: readability-identifier-length.MinimumLoopCounterNameLength
199+
value: 0

.flake8

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
[flake8]
2+
max-line-length = 120
3+
# Following 4 for black compatibility
4+
# E501: line too long
5+
# W503: Line break occurred before a binary operator
6+
# E203: Whitespace before ':'
7+
# D202 No blank lines allowed after function docstring
8+
9+
# TODO fix flake8
10+
# D100 Missing docstring in public module
11+
# D101 Missing docstring in public class
12+
# D102 Missing docstring in public method
13+
# D103 Missing docstring in public function
14+
# D104 Missing docstring in public package
15+
# D105 Missing docstring in magic method
16+
# D107 Missing docstring in __init__
17+
# D200 One-line docstring should fit on one line with quotes
18+
# D205 1 blank line required between summary line and description
19+
# D209 Multi-line docstring closing quotes should be on a separate line
20+
# D400 First line should end with a period
21+
# D401 First line should be in imperative mood
22+
23+
ignore =
24+
E501,
25+
W503,
26+
E203,
27+
D202,
28+
29+
D100,
30+
D101,
31+
D102,
32+
D103,
33+
D104,
34+
D105,
35+
D107,
36+
D200,
37+
D205,
38+
D209,
39+
D400,
40+
D401,
41+
42+
exclude = api_pb2.py

0 commit comments

Comments
 (0)