Skip to content

Commit

Permalink
Apply pre-commit formatting
Browse files Browse the repository at this point in the history
Signed-off-by: Pablo Iranzo Gómez <[email protected]>
  • Loading branch information
iranzo committed Aug 5, 2024
1 parent 6603906 commit f7e35d4
Show file tree
Hide file tree
Showing 135 changed files with 1,409 additions and 1,252 deletions.
72 changes: 35 additions & 37 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
Language: Cpp
Language: Cpp
# BasedOnStyle: Microsoft
AccessModifierOffset: -2
AlignAfterOpenBracket: Align
Expand All @@ -8,7 +8,7 @@ AlignConsecutiveAssignments: false
AlignConsecutiveBitFields: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlines: Right
AlignOperands: Align
AlignOperands: Align
AlignTrailingComments: true
AllowAllArgumentsOnNextLine: true
AllowAllConstructorInitializersOnNextLine: true
Expand All @@ -27,21 +27,21 @@ AlwaysBreakTemplateDeclarations: MultiLine
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterCaseLabel: false
AfterClass: true
AfterCaseLabel: false
AfterClass: true
AfterControlStatement: Never
AfterEnum: false
AfterFunction: true
AfterNamespace: true
AfterEnum: false
AfterFunction: true
AfterNamespace: true
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
AfterStruct: false
AfterUnion: false
AfterExternBlock: false
BeforeCatch: false
BeforeElse: false
BeforeCatch: false
BeforeElse: false
BeforeLambdaBody: false
BeforeWhile: false
IndentBraces: false
BeforeWhile: false
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
Expand All @@ -54,48 +54,48 @@ BreakConstructorInitializersBeforeComma: false
BreakConstructorInitializers: BeforeColon
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: true
ColumnLimit: 100
CommentPragmas: '^ IWYU pragma:'
ColumnLimit: 100
CommentPragmas: '^ IWYU pragma:'
CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 8
ContinuationIndentWidth: 8
Cpp11BracedListStyle: true
DeriveLineEnding: true
DerivePointerAlignment: false
DisableFormat: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: true
ForEachMacros:
- foreach
- Q_FOREACH
- BOOST_FOREACH
IncludeBlocks: Preserve
IncludeBlocks: Preserve
IncludeCategories:
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
Priority: 2
SortPriority: 0
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
Priority: 3
SortPriority: 0
- Regex: '.*'
Priority: 1
SortPriority: 0
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
Priority: 2
SortPriority: 0
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
Priority: 3
SortPriority: 0
- Regex: '.*'
Priority: 1
SortPriority: 0
IncludeIsMainRegex: '(Test)?$'
IncludeIsMainSourceRegex: ''
IndentCaseLabels: false
IndentCaseBlocks: false
IndentGotoLabels: true
IndentPPDirectives: None
IndentExternBlock: AfterExternBlock
IndentWidth: 8
IndentWidth: 8
IndentWrappedFunctionNames: false
InsertTrailingCommas: None
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: true
MacroBlockBegin: ''
MacroBlockEnd: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCBinPackProtocolList: Auto
Expand All @@ -112,8 +112,8 @@ PenaltyBreakTemplateDeclaration: 10
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 1000
PointerAlignment: Right
ReflowComments: true
SortIncludes: true
ReflowComments: true
SortIncludes: true
SortUsingDeclarations: true
SpaceAfterCStyleCast: false
SpaceAfterLogicalNot: false
Expand All @@ -127,23 +127,21 @@ SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyBlock: false
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInAngles: false
SpacesInConditionalStatement: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
SpaceBeforeSquareBrackets: false
Standard: Latest
Standard: Latest
StatementMacros:
- Q_UNUSED
- QT_REQUIRE_VERSION
TabWidth: 8
UseCRLF: false
UseTab: ForContinuationAndIndentation
TabWidth: 8
UseCRLF: false
UseTab: ForContinuationAndIndentation
WhitespaceSensitiveMacros:
- STRINGIZE
- PP_STRINGIZE
- BOOST_PP_STRINGIZE
...

37 changes: 19 additions & 18 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
---
Checks: '-*,readability-identifier-naming'
CheckOptions:
- { key: readability-identifier-naming.ClassCase, value: lower_case }
- { key: readability-identifier-naming.ClassMemberCase, value: lower_case }
- { key: readability-identifier-naming.ClassMethodCase, value: lower_case }
- { key: readability-identifier-naming.ConstantCase, value: UPPER_CASE }
- { key: readability-identifier-naming.ConstantMemberCase, value: UPPER_CASE }
- { key: readability-identifier-naming.ConstantParameterCase, value: lower_case }
- { key: readability-identifier-naming.ConstantPointerParameterCase, value: lower_case }
- { key: readability-identifier-naming.StructCase, value: lower_case }
- { key: readability-identifier-naming.FunctionCase, value: lower_case }
- { key: readability-identifier-naming.VariableCase, value: lower_case }
- { key: readability-identifier-naming.GlobalConstantCase, value: lower_case }
- { key: readability-identifier-naming.GlobalFunctionCase, value: lower_case }
- { key: readability-identifier-naming.GlobalVariableCase, value: lower_case }
- { key: readability-identifier-naming.LocalConstantCase, value: lower_case }
- { key: readability-identifier-naming.LocalVariableCase, value: lower_case }
- { key: readability-identifier-naming.MemberCase, value: lower_case }
- { key: readability-identifier-naming.EnumCase, value: lower_case }
- { key: readability-identifier-naming.ParameterCase, value: lower_case }
- {key: readability-identifier-naming.ClassCase, value: lower_case}
- {key: readability-identifier-naming.ClassMemberCase, value: lower_case}
- {key: readability-identifier-naming.ClassMethodCase, value: lower_case}
- {key: readability-identifier-naming.ConstantCase, value: UPPER_CASE}
- {key: readability-identifier-naming.ConstantMemberCase, value: UPPER_CASE}
- {key: readability-identifier-naming.ConstantParameterCase, value: lower_case}
- {key: readability-identifier-naming.ConstantPointerParameterCase, value: lower_case}
- {key: readability-identifier-naming.StructCase, value: lower_case}
- {key: readability-identifier-naming.FunctionCase, value: lower_case}
- {key: readability-identifier-naming.VariableCase, value: lower_case}
- {key: readability-identifier-naming.GlobalConstantCase, value: lower_case}
- {key: readability-identifier-naming.GlobalFunctionCase, value: lower_case}
- {key: readability-identifier-naming.GlobalVariableCase, value: lower_case}
- {key: readability-identifier-naming.LocalConstantCase, value: lower_case}
- {key: readability-identifier-naming.LocalVariableCase, value: lower_case}
- {key: readability-identifier-naming.MemberCase, value: lower_case}
- {key: readability-identifier-naming.EnumCase, value: lower_case}
- {key: readability-identifier-naming.ParameterCase, value: lower_case}
5 changes: 3 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
#
# Copyright (C) 2024 Linutronix GmbH
# Author Kurt Kanzenbach <[email protected]>
Expand All @@ -10,10 +11,10 @@ name: Build code
on:
push:
branches:
- main
- main
pull_request:
branches:
- main
- main

jobs:
build:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/qa.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
#
# Copyright (C) 2024 Linutronix GmbH
# Author Kurt Kanzenbach <[email protected]>
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/sphinx.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
name: Sphinx docs to pages

on:
Expand All @@ -7,7 +8,7 @@ on:

jobs:
deploy:
runs-on: ubuntu-latest
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

Expand Down Expand Up @@ -42,4 +43,4 @@ jobs:
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./Documentation/_build/html
publish_dir: ./Documentation/_build/html
104 changes: 104 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
---
#
# SPDX-License-Identifier: BSD-2-Clause
#
#

fail_fast: true
repos:
- hooks:
- id: commitizen
stages:
- commit-msg
repo: https://github.com/commitizen-tools/commitizen
rev: v3.14.1
- hooks:
- id: check-useless-excludes
repo: meta
- hooks:
- files: \.(css|js|md|markdown|json)
id: prettier
repo: https://github.com/pre-commit/mirrors-prettier
rev: v4.0.0-alpha.8
- hooks:
- id: seed-isort-config
repo: https://github.com/asottile/seed-isort-config
rev: v2.2.0
- hooks:
- id: isort
repo: https://github.com/pre-commit/mirrors-isort
rev: v5.10.1
- hooks:
- id: black
repo: https://github.com/python/black
rev: 24.2.0
- hooks:
- id: check-added-large-files
- id: check-ast
- id: check-case-conflict
- id: check-executables-have-shebangs
- id: check-json
- id: check-merge-conflict
- id: check-symlinks
- id: check-vcs-permalinks
- id: debug-statements
- id: check-xml
- args:
- --unsafe
id: check-yaml
- id: end-of-file-fixer
- id: forbid-new-submodules
- args:
- --branch
- gh-pages
id: no-commit-to-branch
- id: requirements-txt-fixer
- id: sort-simple-yaml
- id: trailing-whitespace
- id: mixed-line-ending
- id: detect-private-key
- id: check-byte-order-marker
- id: check-docstring-first
repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
- hooks:
- id: flake8
repo: https://github.com/pycqa/flake8
rev: 7.0.0
- repo: https://github.com/scop/pre-commit-shfmt
rev: v3.8.0-1
hooks:
# Choose one of:
- id: shfmt # native (requires/installs Go to build)
args:
- -w
- -i
- "2"
- -s

types:
- shell
- hooks:
- id: blacken-docs
repo: https://github.com/asottile/blacken-docs
rev: 1.16.0

# - repo: https://github.com/asottile/pyupgrade
# rev: v2.38.0
# hooks:
# - id: pyupgrade
# args: [--py39-plus]

- repo: https://github.com/jumanjihouse/pre-commit-hook-yamlfmt
rev: 0.2.3 # or other specific tag
hooks:
- id: yamlfmt
args: [--mapping, '2', --sequence, '4', --offset, '2', '--preserve-quotes']


# - repo: https://github.com/hcodes/yaspeller.git
# rev: v8.0.1
# hooks:
# - id: yaspeller
# types:
# - markdown
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ reports and/or code contributions.
The Linux TSN Testbench follows the Github development model using pull
request. To contribute code to the project use the following workflow:

1. Fork the repo and create your branch from ``main``
1. Fork the repo and create your branch from `main`
2. Develop and test your changes
3. Adhere to the coding style
4. Update the documentation if necessary
Expand All @@ -24,7 +24,7 @@ and necessary information how to reproduce the issue. This includes:

In addition, contributions are accepted via email as well:

1. Clone the repo and create your branch from ``main``
1. Clone the repo and create your branch from `main`
2. Develop and test your changes
3. Adhere to the coding style
4. Update the documentation if necessary
Expand All @@ -47,7 +47,7 @@ https://www.kernel.org/doc/html/latest/process/submitting-patches.html#sign-your
## Code Style

The coding style is the Linux kernel one. If unsure about it, run
``clang-format`` on the C files.
`clang-format` on the C files.

In addition, the reverse xmas tree variable ordering is used:

Expand Down
8 changes: 4 additions & 4 deletions ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ How can the issue be reproduced?

Please provide the following information:

- [ ] Hardware and NIC(s) being used
- [ ] Configuration files being used
- [ ] Linux kernel version being used
- [ ] Linux distribution being used
- [ ] Hardware and NIC(s) being used
- [ ] Configuration files being used
- [ ] Linux kernel version being used
- [ ] Linux distribution being used
2 changes: 1 addition & 1 deletion LICENSES/BSD-2-Clause.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) <year> <owner>
Copyright (c) <year> <owner>

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

Expand Down
Loading

0 comments on commit f7e35d4

Please sign in to comment.