Skip to content

Commit

Permalink
Init: setup unity and code confg file for builtin library
Browse files Browse the repository at this point in the history
- add unity setup in CAN lib, include makefiles take unity from local install path
- code check files such like cpp checheck, clang-tidy and so on
- format CAN lib with clang-format
  • Loading branch information
LinjingZhang committed Sep 10, 2024
1 parent 52e575c commit e881454
Show file tree
Hide file tree
Showing 28 changed files with 6,790 additions and 365 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@
.vscode
pkg_build
build
.clang-format
**/__pycache__/
Empty file.
Empty file.
Empty file.
Empty file.
10 changes: 10 additions & 0 deletions config/arduinoLibraryTemplate/library.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name=CAN
version=1.0.0
author=Infineon Technologies <www.infineon.com>
maintainer=Infineon Technologies <www.infineon.com>
sentence=C++ CAN library
paragraph=C++ CAN library
category=Library
url=https://github.com/Infineon/<fill in url>
architectures=*
includes=CAN.hpp
Empty file.
26 changes: 26 additions & 0 deletions config/clang-format/.clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
# We'll use defaults from the LLVM style, but with 4 columns indentation.
#BasedOnStyle: GNU
BasedOnStyle: LLVM
#BasedOnStyle: Google
#BasedOnStyle: Mozilla
#BasedOnStyle: Chromium
IndentWidth: 4
---
Language: Cpp
# BasedOnStyle: Google
AccessModifierOffset: -4
Standard: c++17
TabWidth: 2
UseTab: Never
ColumnLimit: 100
AlignAfterOpenBracket: Align
BinPackParameters: false
AlignEscapedNewlines: Left
AlwaysBreakTemplateDeclarations: Yes
PackConstructorInitializers: Never
BreakConstructorInitializersBeforeComma: false
IndentPPDirectives: BeforeHash
SortIncludes: Never
SeparateDefinitionBlocks: Always
...
54 changes: 54 additions & 0 deletions config/clang-tidy/.clang-tidy
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
Checks: 'cppcoreguidelines-*,
performance-*,
modernize-*,
google-*,
misc-*
cert-*,
readability-*,
clang-analyzer-*,
-performance-unnecessary-value-param,
-modernize-use-trailing-return-type,
-google-runtime-references,
-misc-non-private-member-variables-in-classes,
-readability-braces-around-statements,
-google-readability-braces-around-statements,
-cppcoreguidelines-avoid-magic-numbers,
-readability-magic-numbers,
-readability-magic-numbers,
-cppcoreguidelines-pro-type-vararg,
-cppcoreguidelines-pro-bounds-pointer-arithmetic,
-cppcoreguidelines-avoid-c-arrays,
-modernize-avoid-c-arrays,
-cppcoreguidelines-pro-bounds-array-to-pointer-decay,
-readability-named-parameter,
-cert-env33-c
'


WarningsAsErrors: ''
HeaderFilterRegex: '.*'
#HeaderFilterRegex: '*spdlog/[^f].*'
AnalyzeTemporaryDtors: false
FormatStyle: none

CheckOptions:
- key: google-readability-braces-around-statements.ShortStatementLines
value: '1'
- key: google-readability-function-size.StatementThreshold
value: '800'
- key: google-readability-namespace-comments.ShortNamespaceLines
value: '10'
- key: google-readability-namespace-comments.SpacesBeforeComments
value: '2'
- key: modernize-loop-convert.MaxCopySize
value: '16'
- key: modernize-loop-convert.MinConfidence
value: reasonable
- key: modernize-loop-convert.NamingStyle
value: CamelCase
- key: modernize-pass-by-value.IncludeStyle
value: llvm
- key: modernize-replace-auto-ptr.IncludeStyle
value: llvm
- key: modernize-use-nullptr.NullMacros
value: 'NULL'
Loading

0 comments on commit e881454

Please sign in to comment.