-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Full rewrite, support UAVCAN/CAN (both v1 and v0), UAVCAN/serial (#7)
- Loading branch information
1 parent
fbde691
commit 667d7ba
Showing
82 changed files
with
10,785 additions
and
10,203 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
--- | ||
Language: Cpp | ||
# BasedOnStyle: LLVM | ||
AccessModifierOffset: -4 | ||
AlignAfterOpenBracket: Align | ||
AlignConsecutiveAssignments: true | ||
AlignConsecutiveDeclarations: true | ||
AlignEscapedNewlines: Left | ||
AlignOperands: true | ||
AlignTrailingComments: true | ||
AllowAllParametersOfDeclarationOnNextLine: false | ||
AllowShortBlocksOnASingleLine: false | ||
AllowShortCaseLabelsOnASingleLine: false | ||
AllowShortFunctionsOnASingleLine: Inline | ||
AllowShortIfStatementsOnASingleLine: Never | ||
AllowShortLoopsOnASingleLine: false | ||
AlwaysBreakAfterDefinitionReturnType: None | ||
AlwaysBreakAfterReturnType: None | ||
AlwaysBreakBeforeMultilineStrings: false | ||
AlwaysBreakTemplateDeclarations: Yes | ||
BinPackArguments: false | ||
BinPackParameters: false | ||
BraceWrapping: | ||
AfterCaseLabel: true | ||
AfterClass: true | ||
AfterControlStatement: true | ||
AfterEnum: true | ||
AfterFunction: true | ||
AfterNamespace: true | ||
AfterStruct: true | ||
AfterUnion: true | ||
BeforeCatch: true | ||
BeforeElse: true | ||
IndentBraces: false | ||
SplitEmptyFunction: false | ||
SplitEmptyRecord: false | ||
SplitEmptyNamespace: false | ||
AfterExternBlock: false # Keeps the contents un-indented. | ||
BreakBeforeBinaryOperators: None | ||
BreakBeforeBraces: Custom | ||
BreakBeforeTernaryOperators: true | ||
BreakConstructorInitializers: AfterColon | ||
# BreakInheritanceList: AfterColon | ||
BreakStringLiterals: true | ||
ColumnLimit: 120 | ||
CommentPragmas: '^ (coverity|pragma:)' | ||
CompactNamespaces: false | ||
ConstructorInitializerAllOnOneLineOrOnePerLine: true | ||
ConstructorInitializerIndentWidth: 4 | ||
ContinuationIndentWidth: 4 | ||
Cpp11BracedListStyle: true | ||
DerivePointerAlignment: false | ||
DisableFormat: false | ||
ExperimentalAutoDetectBinPacking: false | ||
FixNamespaceComments: true | ||
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ] | ||
IncludeBlocks: Preserve | ||
IndentCaseLabels: false | ||
IndentPPDirectives: AfterHash | ||
IndentWidth: 4 | ||
IndentWrappedFunctionNames: false | ||
KeepEmptyLinesAtTheStartOfBlocks: false | ||
MacroBlockBegin: '' | ||
MacroBlockEnd: '' | ||
MaxEmptyLinesToKeep: 1 | ||
NamespaceIndentation: None | ||
PenaltyBreakAssignment: 2 | ||
PenaltyBreakBeforeFirstCallParameter: 10000 # Raised intentionally; prefer breaking all | ||
PenaltyBreakComment: 300 | ||
PenaltyBreakFirstLessLess: 120 | ||
PenaltyBreakString: 1000 | ||
PenaltyExcessCharacter: 1000000 | ||
PenaltyReturnTypeOnItsOwnLine: 10000 # Raised intentionally because it hurts readability | ||
PointerAlignment: Left | ||
ReflowComments: true | ||
SortIncludes: false | ||
SortUsingDeclarations: false | ||
SpaceAfterCStyleCast: true | ||
SpaceAfterTemplateKeyword: true | ||
SpaceBeforeAssignmentOperators: true | ||
SpaceBeforeCpp11BracedList: false | ||
SpaceBeforeInheritanceColon: true | ||
SpaceBeforeParens: ControlStatements | ||
SpaceBeforeCtorInitializerColon: true | ||
SpaceBeforeRangeBasedForLoopColon: true | ||
SpaceInEmptyParentheses: false | ||
SpacesBeforeTrailingComments: 2 | ||
SpacesInAngles: false | ||
SpacesInCStyleCastParentheses: false | ||
SpacesInContainerLiterals: false | ||
SpacesInParentheses: false | ||
SpacesInSquareBrackets: false | ||
Standard: Cpp11 | ||
TabWidth: 8 | ||
UseTab: Never | ||
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
--- | ||
Checks: >- | ||
boost-*, | ||
bugprone-*, | ||
cert-*, | ||
clang-analyzer-*, | ||
cppcoreguidelines-*, | ||
google-*, | ||
hicpp-*, | ||
llvm-*, | ||
misc-*, | ||
modernize-*, | ||
performance-*, | ||
portability-*, | ||
readability-*, | ||
-google-readability-todo, | ||
-readability-avoid-const-params-in-decls, | ||
-readability-function-cognitive-complexity, | ||
-llvm-header-guard, | ||
-google-runtime-references, | ||
-misc-non-private-member-variables-in-classes, | ||
-cppcoreguidelines-non-private-member-variables-in-classes, | ||
-cert-msc30-c, | ||
-cert-msc50-cpp, | ||
-*-easily-swappable-parameters, | ||
WarningsAsErrors: '*' | ||
HeaderFilterRegex: '.*' | ||
AnalyzeTemporaryDtors: false | ||
FormatStyle: file | ||
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
# Kocherga contribution guide | ||
|
||
## Directory layout | ||
|
||
The production sources are located under `/kocherga/`. | ||
Do not put anything else in there. | ||
|
||
The tests are located under `/tests/`. | ||
This directory also contains the top `CMakeLists.txt` needed to build and run the tests on the local machine. | ||
|
||
The high-level documentation is written in the main README, API documentation is given directly in the header files. | ||
|
||
## Standards | ||
|
||
The library shall be implemented in ISO C++17 with partial adherence to MISRA C++. | ||
The MISRA compliance is enforced by Clang-Tidy and SonarQube. | ||
Deviations are documented directly in the source code as follows: | ||
|
||
```c | ||
// Intentional violation of MISRA: <some valid reason> | ||
<... deviant construct ...> // NOLINT NOSONAR | ||
``` | ||
|
||
The full list of deviations with the accompanying explanation can be found by grepping the sources. | ||
|
||
Do not suppress compliance warnings using the means provided by static analysis tools because such deviations | ||
are impossible to track at the source code level. | ||
An exception applies for the case of false-positive (invalid) warnings -- those should not be mentioned in the codebase. | ||
|
||
[Zubax C++ Coding Conventions](https://kb.zubax.com/x/84Ah) shall be followed. | ||
Formatting is enforced by Clang-Format; it is used also to fail the CI/CD build if violations are detected. | ||
|
||
Unfortunately, some rules are hard or impractical to enforce automatically, | ||
so code reviewers shall be aware of MISRA and general high-reliability coding practices | ||
to prevent non-compliant code from being accepted into upstream. | ||
|
||
## Tools | ||
|
||
For the full list of the tools please refer to the CI scripts. | ||
|
||
### Clang-Tidy | ||
|
||
Clang-Tidy is used to enforce compliance with MISRA and Zubax Coding Conventions. | ||
|
||
Clang-Tidy is invoked automatically on each translation unit before it is compiled; | ||
the build will fail if the tool is not available locally. | ||
To disable this behavior, pass `NO_STATIC_ANALYSIS=1` to CMake at the generation time. | ||
|
||
### Clang-Format | ||
|
||
Clang-Format is used to enforce compliance with MISRA and Zubax Coding Conventions. | ||
|
||
To reformat the sources, generate the project and build the target `format`; e.g., for Make: `make format`. | ||
|
||
### SonarQube | ||
|
||
SonarQube is a cloud solution so its use is delegated to the CI/CD pipeline. | ||
If you need access, please get in touch with the maintainers. | ||
|
||
### IDE | ||
|
||
The recommended development environment is JetBrains CLion. The root project file can be found under `tests/`. | ||
The repository contains the spelling dictionaries for CLion located under `.idea/`, be sure to use them. | ||
|
||
## Testing | ||
|
||
Generate the CMake project, build all, and then build the target `test` (e.g., `make test`). | ||
|
||
Some of the tests are intended to be run manually due to lack of adequate automation solutions in the v0 ecosystem. | ||
Please navigate to `/tests/integration/validator/` for details. | ||
|
||
## Releasing | ||
|
||
1. Bump the version numbers (`KOCHERGA_VERSION_MAJOR`, `KOCHERGA_VERSION_MINOR`) in `kocherga.hpp`. Push the change. | ||
2. Create a new release on GitHub: <https://github.com/Zubax/kocherga/releases/new> |
Oops, something went wrong.