Skip to content

Commit

Permalink
Initial import of Postmaster
Browse files Browse the repository at this point in the history
Co-authored-by: Ron <[email protected]>
Co-authored-by: EkelmansPh <[email protected]>
  • Loading branch information
3 people committed Dec 4, 2024
0 parents commit aef3e18
Show file tree
Hide file tree
Showing 123 changed files with 11,876 additions and 0 deletions.
164 changes: 164 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
---
Language: Cpp
AccessModifierOffset: -4
AlignAfterOpenBracket: DontAlign
AlignArrayOfStructures: None
AlignConsecutiveMacros: None
AlignConsecutiveAssignments: None
AlignConsecutiveBitFields: None
AlignConsecutiveDeclarations: None
AlignEscapedNewlines: Right
AlignOperands: Align
AlignTrailingComments: true
AllowAllArgumentsOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortEnumsOnASingleLine: false
AllowShortBlocksOnASingleLine: Never
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AllowShortLambdasOnASingleLine: Empty
AllowShortIfStatementsOnASingleLine: Never
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: Yes
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterCaseLabel: true
AfterClass: true
AfterControlStatement: Always
AfterEnum: true
AfterFunction: true
AfterNamespace: true
AfterObjCDeclaration: true
AfterStruct: true
AfterUnion: true
AfterExternBlock: true
BeforeCatch: true
BeforeElse: true
BeforeLambdaBody: true
BeforeWhile: false
IndentBraces: false
SplitEmptyFunction: false
SplitEmptyRecord: false
SplitEmptyNamespace: false
BreakBeforeBinaryOperators: None
BreakBeforeConceptDeclarations: true
BreakBeforeBraces: Custom
BreakBeforeInheritanceComma: false
BreakInheritanceList: BeforeComma
BreakBeforeTernaryOperators: true
BreakConstructorInitializers: BeforeComma
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: true
ColumnLimit: 0
CommentPragmas: "^ IWYU pragma:|^NOSONAR"
QualifierAlignment: Leave
CompactNamespaces: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: false
DeriveLineEnding: true
DerivePointerAlignment: false
EmptyLineAfterAccessModifier: Never
EmptyLineBeforeAccessModifier: LogicalBlock
ExperimentalAutoDetectBinPacking: false
PackConstructorInitializers: Never
FixNamespaceComments: false
IncludeBlocks: Merge
IncludeCategories:
- Regex: ^(<|"(gtest|gmock)/)
Priority: 2
- Regex: ^(</)
Priority: 3
- Regex: .*
Priority: 1
IncludeIsMainRegex: (Test)?$
IncludeIsMainSourceRegex: ""
IndentAccessModifiers: false
IndentCaseLabels: true
IndentCaseBlocks: false
IndentGotoLabels: true
IndentPPDirectives: None
IndentExternBlock: AfterExternBlock
IndentRequires: false
IndentWidth: 4
IndentWrappedFunctionNames: false
InsertTrailingCommas: None
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: true
LambdaBodyIndentation: Signature
MacroBlockBegin: ""
MacroBlockEnd: ""
MaxEmptyLinesToKeep: 1
NamespaceIndentation: All
ObjCBinPackProtocolList: Auto
ObjCBlockIndentWidth: 2
ObjCBreakBeforeNestedBlockParam: true
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakOpenParenthesis: 0
PenaltyBreakString: 1000
PenaltyBreakTemplateDeclaration: 10
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 1000
PenaltyIndentedWhitespace: 0
PointerAlignment: Left
PPIndentWidth: -1
ReferenceAlignment: Pointer
ReflowComments: true
RemoveBracesLLVM: false
SeparateDefinitionBlocks: Always
ShortNamespaceLines: 1
SortIncludes: CaseSensitive
SortJavaStaticImport: Before
SortUsingDeclarations: true
SpaceAfterCStyleCast: false
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeCaseColon: false
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
SpaceBeforeParensOptions:
AfterControlStatements: true
AfterForeachMacros: true
AfterFunctionDefinitionName: false
AfterFunctionDeclarationName: false
AfterIfMacros: true
AfterOverloadedOperator: false
BeforeNonEmptyParentheses: false
SpaceAroundPointerQualifiers: Default
SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyBlock: false
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: Never
SpacesInConditionalStatement: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInLineCommentPrefix:
Minimum: 1
Maximum: -1
SpacesInParentheses: false
SpacesInSquareBrackets: false
SpaceBeforeSquareBrackets: false
BitFieldColonSpacing: Both
Standard: Latest
TabWidth: 4
UseCRLF: false
UseTab: Never
WhitespaceSensitiveMacros:
- STRINGIZE
- CONCAT
- GIVEN
- WHEN
- THEN
11 changes: 11 additions & 0 deletions .clangd
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
CompileFlags:
CompilationDatabase: build/
Diagnostics:
UnusedIncludes: Strict
ClangTidy:
Add: []
Remove: []
InlayHints:
Enabled: Yes
ParameterNames: No
DeducedTypes: No
3 changes: 3 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM ghcr.io/philips-software/amp-devcontainer-cpp:v5.5.1@sha256:d4c3ac71b832a967d5de37fa115679fc1c9f22313deac2d2bf8d8f575be85062

HEALTHCHECK NONE
18 changes: 18 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"build": {
"context": "..",
"dockerfile": "Dockerfile"
},
"mounts": [
"source=/var/run/docker.sock,target=/var/run/docker.sock,type=bind"
],
"runArgs": ["--add-host=host.docker.internal:host-gateway", "--privileged"],
"postCreateCommand": "git submodule update --init --recursive",
"customizations": {
"vscode": {
"extensions": [
"ms-vscode.vscode-serial-monitor"
]
}
}
}
3 changes: 3 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
* @rjaegers
* @richardapeters
* @EkelmansPh
15 changes: 15 additions & 0 deletions .github/SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Security Policy

## Supported Versions

The [latest](https://github.com/philips-internal/amp-postmaster/releases/latest) version of
amp-postmaster is supported with security updates.

## Reporting a Vulnerability

If you find a significant vulnerability, or evidence of one, please report it privately.

Vulnerabilities should be reported using [GitHub's mechanism for privately reporting a vulnerability](https://docs.github.com/en/code-security/security-advisories/guidance-on-reporting-and-writing/privately-reporting-a-security-vulnerability#privately-reporting-a-security-vulnerability). Under the
[main repository's security tab](https://github.com/philips-internal/amp-postmaster/security), click "Report a vulnerability" to open the advisory form.

A member of the amp-postmaster team will triage the reported vulnerability and if the vulnerability is accepted a security advisory will be published and all further communication will be done via that security advisory.
26 changes: 26 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
version: 2

updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: daily
groups:
github-actions:
update-types:
- minor
- patch
- package-ecosystem: docker
directory: .devcontainer
schedule:
interval: daily
- package-ecosystem: gitsubmodule
directory: /
schedule:
interval: daily
commit-message:
prefix: "feat(deps)"
groups:
git-submodules:
patterns: ["amp-*"]
8 changes: 8 additions & 0 deletions .github/linters/actionlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
self-hosted-runner:
labels:
- linux
- philips-code-hub
- self-hosted
- ubuntu-latest
- x64
8 changes: 8 additions & 0 deletions .github/philips-repo.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Business Category ID according to https://share.philips.com/sites/SWCoE/Lists/List%20of%20Business%20Categories/AllItems.aspx
business-category: 52
business-category-details: https://share.philips.com/sites/SWCoE/Lists/List%20of%20Business%20Categories/DispForm.aspx?ID=52

version: 1
export-control-eccn: EAR99
export-control-sgi: 3
export-control-rationale: Based on export control screening questionnaire results
50 changes: 50 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
name: Continuous Integration

on:
push:
branches: [main]
pull_request:
types: [opened, synchronize, reopened]

permissions:
contents: read

concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true

jobs:
build:
name: Build
strategy:
matrix:
target: ["host", "stm32f407", "windows"]
configuration: ["RelWithDebInfo"]
include:
- target: "stm32f407"
configuration: "MinSizeRel"
runs-on: [ubuntu-latest]
container: ghcr.io/philips-software/amp-devcontainer-cpp:5.1.4@sha256:46239906460dedb3baf3c33d9275f3de4f17d7a237fc136c2013b021589a6dbd # 5.1.4
steps:
- uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
if: ${{ matrix.target == 'windows' }}
id: cache-winsdk
with:
path: /winsdk
key: cache-winsdk
- if: ${{ matrix.target == 'windows' && steps.cache-winsdk.outputs.cache-hit != 'true' }}
run: xwin --accept-license splat --preserve-ms-arch-notation --include-debug-libs && mv .xwin-cache/splat/ /winsdk
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
submodules: true
token: ${{ secrets.AMP_ACCESS_TOKEN }}
- uses: hendrikmuhs/ccache-action@ed74d11c0b343532753ecead8a951bb09bb34bc9 # v1.2.14
with:
key: ${{ matrix.target}}-${{ matrix.configuration }}
- uses: lukka/run-cmake@af1be47fd7c933593f687731bc6fdbee024d3ff4 # v10.8
with:
configurePreset: "${{ matrix.target }}"
buildPreset: "${{ matrix.target }}-${{ matrix.configuration }}"
configurePresetAdditionalArgs: "['-DCMAKE_C_COMPILER_LAUNCHER=ccache', '-DCMAKE_CXX_COMPILER_LAUNCHER=ccache']"
68 changes: 68 additions & 0 deletions .github/workflows/linting-formatting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
---
name: Linting & Formatting

on:
push:
branches: [main]
pull_request:
types: [opened, synchronize, reopened]

permissions:
contents: read

concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true

jobs:
formatter:
name: Formatting
runs-on: [ubuntu-latest]
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
persist-credentials: false
- uses: DoozyX/clang-format-lint-action@c71d0bf4e21876ebec3e5647491186f8797fde31
with:
clangFormatVersion: 14
inplace: true
extensions: "cpp,hpp"
exclude: "./external"
- uses: reviewdog/action-suggester@db4abb16fbaabe386831e5addb7be1485d0d63d3
with:
tool_name: clang-format
filter_mode: diff_context
linter:
name: Linting
runs-on: [ubuntu-latest]
permissions:
contents: read
pull-requests: write
security-events: write
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
fetch-depth: 0
persist-credentials: false
- uses: oxsecurity/megalinter/flavors/documentation@1fc052d03c7a43c78fe0fee19c9d648b749e0c01 # v8.3.0
env:
APPLY_FIXES: all
VALIDATE_ALL_CODEBASE: true
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# - uses: github/codeql-action/upload-sarif@515828d97454b8354517688ddc5b48402b723750 # v2.1.38
# if: ${{ success() || failure() }}
# with:
# sarif_file: megalinter-reports/megalinter-report.sarif
- uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882
if: ${{ success() || failure() }}
with:
name: linter
path: |
megalinter-reports
- uses: reviewdog/action-suggester@db4abb16fbaabe386831e5addb7be1485d0d63d3
with:
tool_name: MegaLinter
filter_mode: diff_context
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.cache/
.vs/
.vscode/.cortex-debug*
.xwin-cache/
build/
install/
out/
3 changes: 3 additions & 0 deletions .markdown-link-check.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"aliveStatusCodes": [0, 200, 401, 403]
}
Loading

0 comments on commit aef3e18

Please sign in to comment.