Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add coding convention check workflow #20

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
5f51925
Create LICENSE.md
silabs-hieuhoang Sep 16, 2024
9661bf9
Remove content copy MSLA and list exception in LICENSE.md
silabs-hieuhoang Sep 17, 2024
4426022
Merge pull request #14 from SiliconLabs/Create-LICENSE.md
silabs-hieuhoang Sep 19, 2024
779d553
Create coding-convention.yaml
silabs-bingocth Sep 25, 2024
2405570
Rename coding-convention.yaml to coding_convention.yaml
silabs-bingocth Sep 25, 2024
859f3a8
Update coding_convention.yaml
silabs-bingocth Sep 25, 2024
da37b6c
Create README.md
silabs-bingocth Sep 25, 2024
255a82a
Create README.md
silabs-bingocth Sep 25, 2024
1153f86
Add clang-format and clang-tidy file
silabs-bingocth Sep 25, 2024
3c8f12f
Add config files
silabs-bingocth Sep 25, 2024
4f24682
Update coding_convention.yaml
silabs-bingocth Sep 25, 2024
2cb825e
Update coding_convention.yaml
silabs-bingocth Sep 25, 2024
7b06cae
Update coding_convention.yaml
silabs-bingocth Sep 25, 2024
6229f3e
Update coding_convention.yaml
silabs-bingocth Sep 25, 2024
3b791ce
Update coding_convention.yaml
silabs-bingocth Sep 25, 2024
6134886
Update coding_convention.yaml
silabs-bingocth Sep 25, 2024
b19c7cf
Update coding_convention.yaml
silabs-bingocth Sep 25, 2024
658a04b
Update coding_convention.yaml
silabs-bingocth Sep 25, 2024
531e875
Update coding_convention.yaml
silabs-bingocth Sep 25, 2024
0bbcc3a
Update coding_convention.yaml
silabs-bingocth Sep 25, 2024
039766c
Update coding_convention.yaml
silabs-bingocth Sep 25, 2024
f30e530
Update coding_convention.yaml
silabs-bingocth Sep 25, 2024
74ef256
Update coding_convention.yaml
silabs-bingocth Sep 25, 2024
adb33f0
Update coding_convention.yaml
silabs-bingocth Sep 25, 2024
2712d9e
Update coding_convention.yaml
silabs-bingocth Sep 25, 2024
cbf3480
Update coding_convention.yaml
silabs-bingocth Sep 25, 2024
4071ade
Update coding_convention.yaml
silabs-bingocth Sep 25, 2024
a0c49c8
Update coding_convention.yaml
silabs-bingocth Sep 25, 2024
a94412e
Update coding_convention.yaml
silabs-bingocth Sep 25, 2024
5e6d7f3
Update exclude-file.txt
silabs-bingocth Sep 25, 2024
e3e8270
Update coding_convention.yaml
silabs-bingocth Sep 25, 2024
244d366
Update coding_convention.yaml
silabs-bingocth Sep 25, 2024
82c9f9e
Update coding_convention.yaml
silabs-bingocth Sep 25, 2024
049d565
Update coding_convention.yaml
silabs-bingocth Sep 25, 2024
3f881ac
Update coding_convention.yaml
silabs-bingocth Sep 25, 2024
18261ef
Update coding_convention.yaml
silabs-bingocth Sep 25, 2024
db76f4f
Update coding_convention.yaml
silabs-bingocth Sep 25, 2024
e4db2c7
Update coding_convention.yaml
silabs-bingocth Sep 25, 2024
315934e
Update coding_convention.yaml
silabs-bingocth Sep 25, 2024
6b2811e
Update coding_convention.yaml
silabs-bingocth Sep 25, 2024
dca0aa4
Update coding_convention.yaml
silabs-bingocth Sep 25, 2024
65bf169
Update coding_convention.yaml
silabs-bingocth Sep 25, 2024
4d736f7
Update coding_convention.yaml
silabs-bingocth Sep 25, 2024
253602e
Update coding_convention.yaml
silabs-bingocth Sep 25, 2024
521cc7a
Update coding_convention.yaml
silabs-bingocth Sep 25, 2024
3645a1f
Update coding_convention.yaml
silabs-bingocth Sep 25, 2024
76f2fa3
Update coding_convention.yaml
silabs-bingocth Sep 25, 2024
5ac5462
Update coding_convention.yaml
silabs-bingocth Sep 25, 2024
db26937
Update coding_convention.yaml
silabs-bingocth Sep 30, 2024
dcae762
Update coding_convention.yaml
silabs-bingocth Sep 30, 2024
d67359e
Update coding_convention.yaml
silabs-bingocth Oct 1, 2024
e61c600
Update coding_convention.yaml
silabs-bingocth Oct 1, 2024
c7a611a
Update coding_convention.yaml
silabs-bingocth Oct 1, 2024
6f3b690
Update coding_convention.yaml
silabs-bingocth Oct 1, 2024
5d8a2ec
Update coding_convention.yaml
silabs-bingocth Oct 1, 2024
7c912d7
Update coding_convention.yaml
silabs-bingocth Oct 1, 2024
48d5b01
Update coding_convention.yaml
silabs-bingocth Oct 1, 2024
8552bbd
Update coding_convention.yaml
silabs-bingocth Oct 1, 2024
96933b0
Update coding_convention.yaml
silabs-bingocth Oct 2, 2024
756a6de
Update coding_convention.yaml
silabs-bingocth Oct 6, 2024
23c4f54
Update coding_convention.yaml
silabs-bingocth Oct 6, 2024
abd65d7
Update coding_convention.yaml
silabs-bingocth Oct 6, 2024
f832f8f
Update coding_convention.yaml
silabs-bingocth Oct 6, 2024
e5a170d
Merge branch 'update-workflows' into add-coding-convention-check-work…
silabs-bingocth Oct 9, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions .github/workflows/coding_convention.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@

name: Coding Convention
on:
push:
branches:
- '*' # matches every branch that doesn't contain a '/'
- '*/*' # matches every branch containing a single '/'
- '**' # matches every branch
env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
REPO_LINK: https://github.com/${{ github.repository }}.git
jobs:
job1:
name: Check coding convention
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/[email protected]
with:
ref: update-source-code-lib-iec60730
- name: Install python3.11
if: always()
run: |
sudo apt update
sudo apt upgrade
sudo add-apt-repository ppa:deadsnakes/ppa -y
sudo apt update
sudo apt install python3.11
python3.11 --version
which python3.11
sudo apt install python3.11-full
curl -sS https://bootstrap.pypa.io/get-pip.py | sudo python3.11
- name: Install Pre-commmit
run: |
python3.11 -m pip install pre-commit
sudo apt install uncrustify clang-tidy cppcheck
- name: Run test
run: |
pre-commit install
pre-commit run --all-files > CodingConventionTool.txt

- name: Upload Result
if: always()
uses: actions/[email protected]
with:
name: CodingConventionResult
path: CodingConventionTool.txt
warn: Output a warning but do not fail the action
retention-days: 90
152 changes: 76 additions & 76 deletions tools/.clang-format
Original file line number Diff line number Diff line change
@@ -1,76 +1,76 @@
---
BasedOnStyle: LLVM
IndentWidth: 2
TabWidth: 2
UseTab: Never


# General formatting
AccessModifierOffset: -2
MaxEmptyLinesToKeep: 1
# BreakBeforeBraces: Allman

# Line length
ColumnLimit: 80

# Bracing style
BreakBeforeBraces: Custom
BraceWrapping:
AfterCaseLabel: true
AfterControlStatement: Never
AfterFunction: true
AfterStruct: false
AfterUnion: false
AfterExternBlock: false
BeforeCatch: false
BeforeElse: false
IndentBraces: false
SplitEmptyFunction: false

# Use of spaces
SpacesBeforeTrailingComments: 1
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false

# Use of comments
CommentPragmas: "^ IWYU pragma:"

AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: true
AlignConsecutiveMacros: true
AlignEscapedNewlines: Right
AlignOperands: true
AlignTrailingComments: true
AllowAllArgumentsOnNextLine: false
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortBlocksOnASingleLine: Empty
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: Empty
AllowShortLoopsOnASingleLine: false
AllowShortEnumsOnASingleLine: false
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: No
BinPackArguments: false
BinPackParameters: false
BreakBeforeBinaryOperators: NonAssignment
BreakBeforeTernaryOperators: true
BreakStringLiterals: true
Cpp11BracedListStyle: true
IncludeBlocks: Regroup
IndentCaseLabels: true
IndentGotoLabels: false
IndentPPDirectives: None
IndentWrappedFunctionNames: true
KeepEmptyLinesAtTheStartOfBlocks: false
PointerAlignment: Right
ReflowComments: false
SortIncludes: false
SpaceAfterCStyleCast: true
SpaceAfterLogicalNot: false
SpaceBeforeRangeBasedForLoopColon: true
SpaceBeforeSquareBrackets: false
SpaceInEmptyBlock: false
SpacesInCStyleCastParentheses: false
SpacesInConditionalStatement: false
SpacesInContainerLiterals: false
---
BasedOnStyle: LLVM
IndentWidth: 2
TabWidth: 2
UseTab: Never
# General formatting
AccessModifierOffset: -2
MaxEmptyLinesToKeep: 1
# BreakBeforeBraces: Allman
# Line length
ColumnLimit: 80
# Bracing style
BreakBeforeBraces: Custom
BraceWrapping:
AfterCaseLabel: true
AfterControlStatement: Never
AfterFunction: true
AfterStruct: false
AfterUnion: false
AfterExternBlock: false
BeforeCatch: false
BeforeElse: false
IndentBraces: false
SplitEmptyFunction: false
# Use of spaces
SpacesBeforeTrailingComments: 1
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
# Use of comments
CommentPragmas: "^ IWYU pragma:"
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: true
AlignConsecutiveMacros: true
AlignEscapedNewlines: Right
AlignOperands: true
AlignTrailingComments: true
AllowAllArgumentsOnNextLine: false
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortBlocksOnASingleLine: Empty
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: Empty
AllowShortLoopsOnASingleLine: false
AllowShortEnumsOnASingleLine: false
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: No
BinPackArguments: false
BinPackParameters: false
BreakBeforeBinaryOperators: NonAssignment
BreakBeforeTernaryOperators: true
BreakStringLiterals: true
Cpp11BracedListStyle: true
IncludeBlocks: Regroup
IndentCaseLabels: true
IndentGotoLabels: false
IndentPPDirectives: None
IndentWrappedFunctionNames: true
KeepEmptyLinesAtTheStartOfBlocks: false
PointerAlignment: Right
ReflowComments: false
SortIncludes: false
SpaceAfterCStyleCast: true
SpaceAfterLogicalNot: false
SpaceBeforeRangeBasedForLoopColon: true
SpaceBeforeSquareBrackets: false
SpaceInEmptyBlock: false
SpacesInCStyleCastParentheses: false
SpacesInConditionalStatement: false
SpacesInContainerLiterals: false
100 changes: 50 additions & 50 deletions tools/.clang-tidy
Original file line number Diff line number Diff line change
@@ -1,50 +1,50 @@
Checks: >
-*,
readability-identifier-naming,
readability-magic-numbers,
readability-braces-around-statements

WarningsAsErrors: >
readability-identifier-naming,
readability-magic-numbers,
readability-braces-around-statements

HeaderFilterRegex: ''
FormatStyle: none
InheritParentConfig: true
User: user
CheckOptions:
- key: readability-identifier-naming.VariableCase
value: lower_case
- key: readability-identifier-naming.GlobalConstantCase
value: UPPER_CASE
- key: readability-identifier-naming.GlobalConstantPrefix
value: SL_
- key: readability-identifier-naming.ConstantCase
value: UPPER_CASE
- key: readability-identifier-naming.ConstantPrefix
value: SL_
- key: readability-identifier-naming.EnumConstantCase
value: UPPER_CASE
- key: readability-identifier-naming.EnumConstantPrefix
value: SL_
- key: readability-identifier-naming.EnumCase
value: lower_case
- key: readability-identifier-naming.EnumPrefix
value: sl_
- key: readability-identifier-naming.FunctionIgnoredRegexp
value: 'sli_.*'
- key: readability-identifier-naming.FunctionCase
value: lower_case
- key: readability-identifier-naming.FunctionPrefix
value: 'sl_'
- key: readability-identifier-naming.StructCase
value: lower_case
- key: readability-identifier-naming.StructPrefix
value: 'sl_'
- key: readability-identifier-naming.StructMemberCase
value: lower_case
- key: readability-identifier-naming.TypedefCase
value: lower_case
- key: readability-identifier-naming.TypedefPrefix
value: 'sl_'
Checks: >
-*,
readability-identifier-naming,
readability-magic-numbers,
readability-braces-around-statements
WarningsAsErrors: >
readability-identifier-naming,
readability-magic-numbers,
readability-braces-around-statements
HeaderFilterRegex: ''
FormatStyle: none
InheritParentConfig: true
User: user
CheckOptions:
- key: readability-identifier-naming.VariableCase
value: lower_case
- key: readability-identifier-naming.GlobalConstantCase
value: UPPER_CASE
- key: readability-identifier-naming.GlobalConstantPrefix
value: SL_
- key: readability-identifier-naming.ConstantCase
value: UPPER_CASE
- key: readability-identifier-naming.ConstantPrefix
value: SL_
- key: readability-identifier-naming.EnumConstantCase
value: UPPER_CASE
- key: readability-identifier-naming.EnumConstantPrefix
value: SL_
- key: readability-identifier-naming.EnumCase
value: lower_case
- key: readability-identifier-naming.EnumPrefix
value: sl_
- key: readability-identifier-naming.FunctionIgnoredRegexp
value: 'sli_.*'
- key: readability-identifier-naming.FunctionCase
value: lower_case
- key: readability-identifier-naming.FunctionPrefix
value: 'sl_'
- key: readability-identifier-naming.StructCase
value: lower_case
- key: readability-identifier-naming.StructPrefix
value: 'sl_'
- key: readability-identifier-naming.StructMemberCase
value: lower_case
- key: readability-identifier-naming.TypedefCase
value: lower_case
- key: readability-identifier-naming.TypedefPrefix
value: 'sl_'
20 changes: 10 additions & 10 deletions tools/.codespell/.codespellrc
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# See: https://github.com/codespell-project/codespell#using-a-config-file
[codespell]
# In the event of a false positive, add the problematic word, in all lowercase, to 'ignore-words.txt' (one word per line).
# Or copy & paste the whole problematic line to 'exclude-file.txt'
ignore-words = ./tools/.codespell/ignore-words.txt
exclude-file = ./tools/.codespell/exclude-file.txt
check-filenames =
check-hidden =
count =
skip = .git,*.a,
# See: https://github.com/codespell-project/codespell#using-a-config-file
[codespell]
# In the event of a false positive, add the problematic word, in all lowercase, to 'ignore-words.txt' (one word per line).
# Or copy & paste the whole problematic line to 'exclude-file.txt'
ignore-words = ./tools/.codespell/ignore-words.txt
exclude-file = ./tools/.codespell/exclude-file.txt
check-filenames =
check-hidden =
count =
skip = .git,*.a,
1 change: 1 addition & 0 deletions tools/.codespell/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

2 changes: 2 additions & 0 deletions tools/.codespell/exclude-file.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
tools/**
.github/**
10 changes: 5 additions & 5 deletions tools/.codespell/ignore-words.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
teh
foobar
pris
bu
dout
teh
foobar
pris
bu
dout
1 change: 1 addition & 0 deletions tools/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Loading