Skip to content

Commit

Permalink
bumped and synchronised code-style definitions with GR4
Browse files Browse the repository at this point in the history
Signed-off-by: Ralph J. Steinhagen <[email protected]>
  • Loading branch information
RalphSteinhagen committed Jun 15, 2024
1 parent cbde0f5 commit 091e294
Show file tree
Hide file tree
Showing 14 changed files with 1,238 additions and 525 deletions.
237 changes: 16 additions & 221 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -1,225 +1,20 @@
# .clang-format for Qt Creator
#
# This is for clang-format >= 5.0.
#
# The configuration below follows the Qt Creator Coding Rules [1] as closely as
# possible. For documentation of the options, see [2].
#
# Use ../../tests/manual/clang-format-for-qtc/test.cpp for documenting problems
# or testing changes.
#
# In case you update this configuration please also update the qtcStyle() in src\plugins\clangformat\clangformatutils.cpp
#
# [1] https://doc-snapshots.qt.io/qtcreator-extending/coding-style.html
# [2] https://clang.llvm.org/docs/ClangFormatStyleOptions.html
#
---
Language: Cpp
AccessModifierOffset: -4
AlignAfterOpenBracket: DontAlign
AlignConsecutiveAssignments: AcrossEmptyLines
AlignConsecutiveDeclarations: AcrossEmptyLines
AlignEscapedNewlines: DontAlign
AlignOperands: AlignAfterOperator
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowAllArgumentsOnNextLine: true
#PackConstructorInitializers: PCIS_CurrentLine # starting with clang 14
AllowAllConstructorInitializersOnNextLine: true
AllowShortLambdasOnASingleLine: All
BasedOnStyle: LLVM
AllowShortCaseLabelsOnASingleLine: true
AllowShortFunctionsOnASingleLine: All
AllowShortIfStatementsOnASingleLine: Always
AllowShortLoopsOnASingleLine: true
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: MultiLine
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterCaseLabel: false
AfterClass: false
AfterControlStatement: Never
AfterEnum: false
AfterFunction: false
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
BeforeCatch: false
BeforeElse: false
IndentBraces: false
SplitEmptyFunction: false
SplitEmptyRecord: false
SplitEmptyNamespace: false
BreakBeforeBinaryOperators: All
BreakBeforeBraces: Custom
BreakBeforeInheritanceComma: false
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BreakConstructorInitializers: BeforeComma
BreakAfterJavaFieldAnnotations: true
BreakStringLiterals: true
ColumnLimit: 0
CommentPragmas: '^ IWYU pragma:'
CompactNamespaces: true
ConstructorInitializerAllOnOneLineOrOnePerLine: true
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 8
Cpp11BracedListStyle: false
DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: true
ForEachMacros:
- forever # avoids { wrapped to next line
- foreach
- Q_FOREACH
- BOOST_FOREACH
IncludeCategories:
- Regex: '^<Q.*'
Priority: 200
IncludeIsMainRegex: '(Test)?$'
IndentCaseLabels: false
IndentWidth: 4
IndentWrappedFunctionNames: false
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: false
# Do not add QT_BEGIN_NAMESPACE/QT_END_NAMESPACE as this will indent lines in between.
MacroBlockBegin: ""
MacroBlockEnd: ""
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCBlockIndentWidth: 4
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PenaltyBreakAssignment: 150
PenaltyBreakBeforeFirstCallParameter: 300
PenaltyBreakComment: 500
PenaltyBreakFirstLessLess: 400
PenaltyBreakString: 600
PenaltyExcessCharacter: 50
PenaltyReturnTypeOnItsOwnLine: 300
PointerAlignment: Right
ReflowComments: true
SortIncludes: CaseInsensitive
SortUsingDeclarations: true
SpaceAfterCStyleCast: true
SpaceAfterTemplateKeyword: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInContainerLiterals: false
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: c++20
TabWidth: 4
UseTab: Never
---
Language: Java
JavaImportGroups: [ 'java', 'javax', 'javafx', 'org', 'io', 'com', 'de.gsi' ]
AccessModifierOffset: -4
# 2000 is a workaround to keep "unlimited" column length, since 0 doesn't always work as expected.
# For the rationale behind the "unlimited" column length policy, please refer to CORE_DEVELOPMENT_GUIDELINE.md
ColumnLimit: 2000
AlignAfterOpenBracket: DontAlign
AlignConsecutiveAssignments: None
AlignConsecutiveDeclarations: None
AlignEscapedNewlines: DontAlign
AlignOperands: AlignAfterOperator
AlignTrailingComments: false
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortLambdasOnASingleLine: All
AllowShortCaseLabelsOnASingleLine: true
AllowShortFunctionsOnASingleLine: All
AllowShortIfStatementsOnASingleLine: Always
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: Yes
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterClass: false
AfterControlStatement: Never
AfterEnum: false
AfterFunction: false
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
BeforeCatch: false
BeforeElse: false
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
BreakBeforeBinaryOperators: All
BreakBeforeBraces: Custom
BreakBeforeInheritanceComma: false
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BreakConstructorInitializers: BeforeComma
BreakAfterJavaFieldAnnotations: true
BreakStringLiterals: true
ColumnLimit: 0
CommentPragmas: '^ IWYU pragma:'
CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: true
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 8
Cpp11BracedListStyle: false
DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: true
ForEachMacros:
- forever # avoids { wrapped to next line
- foreach
- Q_FOREACH
- BOOST_FOREACH
IncludeCategories:
- Regex: '^<Q.*'
Priority: 200
IncludeIsMainRegex: '(Test)?$'
IndentCaseLabels: false
BreakBeforeBraces: Attach
IndentWidth: 4
IndentWrappedFunctionNames: false
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: false
# Do not add QT_BEGIN_NAMESPACE/QT_END_NAMESPACE as this will indent lines in between.
MacroBlockBegin: ""
MacroBlockEnd: ""
MaxEmptyLinesToKeep: 2
NamespaceIndentation: None
ObjCBlockIndentWidth: 4
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PenaltyBreakAssignment: 150
PenaltyBreakBeforeFirstCallParameter: 300
PenaltyBreakComment: 500
PenaltyBreakFirstLessLess: 400
PenaltyBreakString: 600
PenaltyExcessCharacter: 50
PenaltyReturnTypeOnItsOwnLine: 300
PointerAlignment: Right
ReflowComments: true
SortIncludes: CaseInsensitive
SortUsingDeclarations: true
SpaceAfterCStyleCast: true
AccessModifierOffset: -4
IndentRequiresClause: false
AllowShortCompoundRequirementOnASingleLine: true
AlignConsecutiveAssignments: true
AlignConsecutiveDeclarations: true
AlignConsecutiveMacros: true
MaxEmptyLinesToKeep: 1
AlwaysBreakTemplateDeclarations: true
PointerAlignment: Left
ReferenceAlignment: Left
SpaceAfterTemplateKeyword: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInContainerLiterals: false
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: c++20
TabWidth: 4
UseTab: Never

InsertBraces: true
5 changes: 5 additions & 0 deletions .remarkrc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name" : "remark-preset-lint-markdown-style-guide", "version" : "4.0.0", "description" : "remark preset to configure remark-lint with rules that enforce the markdown style guide", "license" : "MIT", "keywords" : ["remark", "remark-preset", "preset", "markdown", "style", "guide"], "repository" : { "type": "git", "url": "https://github.com/remarkjs/remark-lint/tree/main/packages/remark-preset-lint-markdown-style-guide" }, "bugs" : { "url": "https://github.com/remarkjs/remark-lint/issues" }, "funding" : { "type": "opencollective", "url": "https://opencollective.com/unified" }, "author" : { "name": "Titus Wormer", "email": "[email protected]", "url": "https://wooorm.com" }, "contributors" : [{ "name": "Titus Wormer", "email": "[email protected]", "url": "https://wooorm.com" }], "dependencies" : { "remark-lint": "^8.0.0", "remark-lint-file-extension": "^1.0.0", "remark-lint-no-file-name-mixed-case": "^1.0.0", "remark-lint-no-file-name-articles": "^1.0.0", "remark-lint-no-file-name-irregular-characters": "^1.0.0", "remark-lint-no-file-name-consecutive-dashes": "^1.0.0", "remark-lint-no-file-name-outer-dashes": "^1.0.0", "remark-lint-no-consecutive-blank-lines": "^3.0.0", "remark-lint-maximum-line-length": "^2.0.0", "remark-lint-no-shell-dollars": "^2.0.0", "remark-lint-hard-break-spaces": "^2.0.0", "remark-lint-heading-style": "^2.0.0", "remark-lint-heading-increment": "^2.0.0", "remark-lint-no-duplicate-headings": "^2.0.0", "remark-lint-no-multiple-toplevel-headings": "^2.0.0", "remark-lint-maximum-heading-length": "^2.0.0", "remark-lint-no-heading-punctuation": "^2.0.0", "remark-lint-blockquote-indentation": "^2.0.0", "remark-lint-no-blockquote-without-marker": "^4.0.0", "remark-lint-unordered-list-marker-style": "^2.0.0", "remark-lint-ordered-list-marker-style": "^2.0.0", "remark-lint-ordered-list-marker-value": "^2.0.0", "remark-lint-list-item-indent": "^2.0.0", "remark-lint-list-item-content-indent": "^2.0.0", "remark-lint-list-item-spacing": "^3.0.0", "remark-lint-code-block-style": "^2.0.0", "remark-lint-fenced-code-flag": "^2.0.0", "remark-lint-fenced-code-marker": "^2.0.0", "remark-lint-rule-style": "^2.0.0", "remark-lint-no-table-indentation": "^3.0.0", "remark-lint-table-pipes": "^3.0.0", "remark-lint-table-pipe-alignment": "^2.0.0", "remark-lint-table-cell-padding": "^3.0.0", "remark-lint-no-inline-padding": "^3.0.0", "remark-lint-no-shortcut-reference-image": "^2.0.0", "remark-lint-no-shortcut-reference-link": "^2.0.0", "remark-lint-final-definition": "^2.0.0", "remark-lint-definition-case": "^2.0.0", "remark-lint-definition-spacing": "^2.0.0", "remark-lint-link-title-style": "^2.0.0", "remark-lint-strong-marker": "^2.0.0", "remark-lint-emphasis-marker": "^2.0.0", "remark-lint-no-emphasis-as-heading": "^2.0.0", "remark-lint-no-literal-urls": "^2.0.0", "remark-lint-no-auto-link-without-protocol": "^2.0.0" }, "xo" : false, "_id" : "[email protected]", "_nodeVersion" : "14.13.1", "_npmVersion" : "6.14.8", "dist" : { "shasum": "976b6ffd7f37aa90868e081a69241fcde3a297d4", "size": 4080, "noattachment": false, "tarball": "https://registry.npm.taobao.org/remark-preset-lint-markdown-style-guide/download/remark-preset-lint-markdown-style-guide-4.0.0.tgz?spm=a2c6h.14275010.0.0.2cdc371bP2pX35&file=4.0.0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fremark-preset-lint-markdown-style-guide%2Fdownload%2Fremark-preset-lint-markdown-style-guide-4.0.0.tgz" }, "maintainers" : [{ "name": "johno", "email": "[email protected]" }, { "name": "wooorm", "email": "[email protected]" }], "_npmUser" : { "name": "wooorm", "email": "[email protected]" }, "directories" : {}, "_npmOperationalInternal" : { "host": "s3://npm-registry-packages", "tmp": "tmp/remark-preset-lint-markdown-style-guide_4.0.0_1602513927653_0.06771682892310782" }, "_hasShrinkwrap" : false, "publish_time" : 1602513927818, "_cnpm_publish_time" : 1602513927818, "dist-tags" : {
"latest" : "4.0.0"
}
}
8 changes: 1 addition & 7 deletions .restyled.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
# Default Restyler Configuration: https://github.com/restyled-io/restyler/blob/main/config/default.yaml
exclude:
- "**/node_modules/**/*"
- "**/vendor/**/*"

remote_files: []

pull_requests: false # Open Restyle PRs?
request_review: none
labels: []
Expand All @@ -28,7 +22,7 @@ restylers_version: stable
restylers:
- clang-format:
image:
tag: v17
tag: v18
- cmake-format
- prettier-markdown
- prettier-yaml
Expand Down
54 changes: 37 additions & 17 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,40 +1,59 @@
#Contributing to OpenDigitizer
# Contributing to GNU Radio

:+1::tada: First off, thanks for taking the time to contribute! :tada::+1:

The following is a set of guidelines for contributing to OpenDigitizer and its packages. These are mostly guidelines, not rules. Use your best judgement, and feel free to propose changes to this document in a pull request.
The following is a set of guidelines for contributing. These are mostly guidelines, not rules. Use your best judgement, and feel free to propose changes to this document in a pull request.

## Open an issue

For bugs, issues, or other discussion, please log a new issue in the GitHub repository.

GitHub supports [markdown](https://help.github.com/categories/writing-on-github/), so when filing bugs make sure you check the formatting before clicking submit.

## Other discussions

For general "how-to" and guidance questions about using GNU Radio to build and run applications, please have a look at the various
examples or if you cannot find anything that fits your use-case use GitHub's discussions forum.

## Contributing code and content

We welcome all forms of contributions from the community. Please read the following guidelines to maximise the chances of your PR being merged.

### DCO Signing

Any code contributions going into GNU Radio will become part of a LGPL-licensed, open source repository. It is therefore imperative that code submissions belong to the authors, and that submitters have the authority to merge that code into the public GNU Radio codebase.

For that purpose, we use the [Developer's Certificate of Origin](DCO.txt). It is the same document used by other projects. Signing the DCO states that there are no legal reasons to not merge your code.

To sign the DCO, suffix your git commits with a "Signed-off-by" line. When using the command line, you can use `git commit -s` to automatically add this line. If there were multiple authors of the code, or other types of stakeholders, make sure that all are listed, each with a separate Signed-off-by line.

### Communication
- Before starting work on a feature, check if there isn't already an examples in the 'samples' sub-module.
If not, then please open an issue on GitHub describing the proposed feature. We want to make sure any feature work goes smoothly.
We're happy to work with you to determine if it fits the current project direction and make sure no one else is already working on it.

- For any work related to setting up build, test, and CI for OpenDigitizer on GitHub, or for small patches or bug fixes, please open an issue
for tracking purposes, but we generally don't need a discussion prior to opening a PR.
- Before starting work on a feature, check if there isn't already an examples in the 'samples' sub-module.
If not, then please open an issue on GitHub describing the proposed feature. We want to make sure any feature work goes smoothly.
We're happy to work with you to determine if it fits the current project direction and make sure no one else is already working on it.

- For any work related to setting up build, test, and CI for GNU Radio on GitHub, or for small patches or bug fixes, please open an issue
for tracking purposes, but we generally don't need a discussion prior to opening a PR.

### Development process

Please be sure to follow the usual process for submitting PRs:

- Fork the repository
- Make sure it compiles w/o errors against the current release 'main' branch:
- Write and add a descriptive/meaningful JUnit test-case or [minimal working example]
- apply the default code formatter (to minimise future refactoring)
- Please check against the current [PMD](https://pmd.github.io/) [default rules](https://github.com/fair-acc/opencwm-java/blob/master/rules.xml), [FindBugs](http://findbugs.sourceforge.net/) or similar QA code checker (N.B. other/further code improvements are welcome)
- Create a pull request
- Make sure your PR title is descriptive
- Include a link back to an open issue in the PR description
- Fork the repository
- Make sure it compiles w/o errors against the current release 'main' branch:
- Write and add a descriptive/meaningful unit-test-case
- apply the default code formatter (to minimise future refactoring)
- Please check against common sanitizers, the CI/CD pipeline, or similar other QA code checker (N.B. other/further code improvements are welcome)
- Create a pull request
- Make sure your PR title is descriptive
- Include a link back to an open issue in the PR description

We reserve the right to close PRs that are not making progress. Closed PRs can be reopened again later and work can resume.

### Contributor License Agreement
By contributing your code to OpenDigitizer you grant us a non-exclusive,

By contributing your code to GNU Radio you grant us a non-exclusive,
irrevocable, worldwide, royalty-free, sublicenseable, transferable
license under all of Your relevant intellectual property rights
(including copyright, patent, and any other rights), to use, copy,
Expand Down Expand Up @@ -65,5 +84,6 @@ ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.

## Code of Conduct
To ensure an inclusive community, contributors and users in the OpenDigitizer

To ensure an inclusive community, contributors and users in the GNU Radio
community should follow the [code of conduct](./CODE_OF_CONDUCT.md).
Loading

0 comments on commit 091e294

Please sign in to comment.