Skip to content

Commit

Permalink
Merge branch 'current' into release/24.1
Browse files Browse the repository at this point in the history
  • Loading branch information
ra3xdh authored Mar 4, 2024
2 parents 6cb43ce + 1a7aaba commit a73ac7c
Show file tree
Hide file tree
Showing 38 changed files with 9,345 additions and 5,582 deletions.
249 changes: 249 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,249 @@
---
Language: Cpp
# BasedOnStyle: LLVM
AccessModifierOffset: -2

AlignAfterOpenBracket: Align
AlignArrayOfStructures: None

AlignConsecutiveAssignments:
# Align like this:
# int a = 1;
# int somelongname = 2;
# double c = 3;
Enabled: true
AcrossEmptyLines: false
AcrossComments: false
AlignCompound: false
PadOperators: true

AlignConsecutiveBitFields:
Enabled: false
AcrossEmptyLines: false
AcrossComments: false
AlignCompound: false
PadOperators: false
AlignConsecutiveDeclarations:
Enabled: false
AcrossEmptyLines: false
AcrossComments: false
AlignCompound: false
PadOperators: false
AlignConsecutiveMacros:
Enabled: false
AcrossEmptyLines: false
AcrossComments: false
AlignCompound: false
PadOperators: false
AlignEscapedNewlines: Right
AlignOperands: Align
AlignTrailingComments:
Kind: Always
OverEmptyLines: 0

AllowAllArgumentsOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: Never
AllowShortCaseLabelsOnASingleLine: false
AllowShortEnumsOnASingleLine: true

# Forbid 'void double(x) { return 2* x; }'
AllowShortFunctionsOnASingleLine: Inline

AllowShortIfStatementsOnASingleLine: Never
AllowShortLambdasOnASingleLine: All

# Forbid 'while (true) continue'
AllowShortLoopsOnASingleLine: false

AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: MultiLine
AttributeMacros:
- __capability
BinPackArguments: true
BinPackParameters: true
BitFieldColonSpacing: Both
BraceWrapping:
AfterCaseLabel: false
AfterClass: false
AfterControlStatement: Never
AfterEnum: false
AfterExternBlock: false
AfterFunction: false
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
BeforeCatch: false
BeforeElse: false
BeforeLambdaBody: false
BeforeWhile: false
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
BreakAfterAttributes: Never
BreakAfterJavaFieldAnnotations: false
BreakArrays: true
BreakBeforeBinaryOperators: None
BreakBeforeConceptDeclarations: Always
BreakBeforeBraces: Attach
BreakBeforeInlineASMColon: OnlyMultiline
BreakBeforeTernaryOperators: true
BreakConstructorInitializers: BeforeColon
BreakInheritanceList: BeforeColon
BreakStringLiterals: true
ColumnLimit: 80
CommentPragmas: '^ IWYU pragma:'
CompactNamespaces: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DerivePointerAlignment: false
DisableFormat: false
EmptyLineAfterAccessModifier: Never
EmptyLineBeforeAccessModifier: LogicalBlock
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: true
ForEachMacros:
- foreach
- Q_FOREACH
- BOOST_FOREACH
IfMacros:
- KJ_IF_MAYBE
IncludeBlocks: Preserve
IncludeCategories:
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
Priority: 2
SortPriority: 0
CaseSensitive: false
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
Priority: 3
SortPriority: 0
CaseSensitive: false
- Regex: '.*'
Priority: 1
SortPriority: 0
CaseSensitive: false
IncludeIsMainRegex: '(Test)?$'
IncludeIsMainSourceRegex: ''
IndentAccessModifiers: false
IndentCaseBlocks: false
IndentCaseLabels: false
IndentExternBlock: AfterExternBlock
IndentGotoLabels: true
IndentPPDirectives: None
IndentRequiresClause: true
IndentWidth: 2
IndentWrappedFunctionNames: false

#
# if (cond) if (cond) {
# action action
# }
InsertBraces: true

InsertNewlineAtEOF: false
InsertTrailingCommas: None
IntegerLiteralSeparator:
Binary: 0
BinaryMinDigits: 0
Decimal: 0
DecimalMinDigits: 0
Hex: 0
HexMinDigits: 0
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: true
LambdaBodyIndentation: Signature
LineEnding: DeriveLF
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCBinPackProtocolList: Auto
ObjCBlockIndentWidth: 2
ObjCBreakBeforeNestedBlockParam: true
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PackConstructorInitializers: BinPack
PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakOpenParenthesis: 0
PenaltyBreakString: 1000
PenaltyBreakTemplateDeclaration: 10
PenaltyExcessCharacter: 1000000
PenaltyIndentedWhitespace: 0
PenaltyReturnTypeOnItsOwnLine: 60

# Stick asterisk to type
# int* a
PointerAlignment: Left

PPIndentWidth: -1
QualifierAlignment: Leave
ReferenceAlignment: Pointer
ReflowComments: true
RemoveBracesLLVM: false
RemoveSemicolon: false
RequiresClausePosition: OwnLine
RequiresExpressionIndentation: OuterScope
SeparateDefinitionBlocks: Leave
ShortNamespaceLines: 1
SortIncludes: CaseSensitive
SortJavaStaticImport: Before
SortUsingDeclarations: LexicographicNumeric
SpaceAfterCStyleCast: false
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: true
SpaceAroundPointerQualifiers: Default
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
AfterRequiresInClause: false
AfterRequiresInExpression: false
BeforeNonEmptyParentheses: false
SpaceBeforeRangeBasedForLoopColon: true
SpaceBeforeSquareBrackets: false
SpaceInEmptyBlock: false
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: Never
SpacesInConditionalStatement: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInLineCommentPrefix:
Minimum: 1
Maximum: -1
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Latest
StatementAttributeLikeMacros:
- Q_EMIT
StatementMacros:
- Q_UNUSED
- QT_REQUIRE_VERSION
TabWidth: 8
UseTab: Never
WhitespaceSensitiveMacros:
- BOOST_PP_STRINGIZE
- CF_SWIFT_NAME
- NS_SWIFT_NAME
- PP_STRINGIZE
- STRINGIZE
...

14 changes: 14 additions & 0 deletions .clangd
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Documentation for this file: https://clangd.llvm.org/config
If:
PathMatch: [ .*\.cpp, .*\.h ]

CompileFlags:
Add: [-std=c++17]

Diagnostics:
# List of clang-tidy checks: https://clang.llvm.org/extra/clang-tidy/checks/list.html
ClangTidy:
# Put here checks you want to use
Add: [ bugprone-*, readability-*, misc-*, cppcoreguidelines-* ]
# Put here checks you don't want to use
Remove: [ ]
6 changes: 4 additions & 2 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ name: CMake

on:
push:
branches: [ "master","current" ]
branches: [ "master", "current", "release/*" ]
paths: [ "**.cpp", "**.h", "**/CMakeLists.txt" ]
pull_request:
branches: [ "master","current" ]
branches: [ "master", "current", "release/*" ]
paths: [ "**.cpp", "**.h", "**/CMakeLists.txt" ]

env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/cmake_qt6.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ name: CMake-Qt6

on:
push:
branches: [ "master","current" ]
branches: [ "master", "current", "release/*" ]
paths: [ "**.cpp", "**.h", "**/CMakeLists.txt" ]
pull_request:
branches: [ "master","current" ]
branches: [ "master", "current", "release/*" ]
paths: [ "**.cpp", "**.h", "**/CMakeLists.txt" ]

env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
Expand Down
55 changes: 55 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Qucs-S guidelines

## Communicating and contributing
### I have a question…
If you have a question, please use [discussions](https://github.com/ra3xdh/qucs_s/discussions) to ask it. Restrain from opening an issue: it will be transfered to discussions if it's a question only.

### I want to report a bug…
Check if there is no existing issue for the bug you've discovered. If there is no one, then feel free to open a new issue.

Write a concise title, shortly describing the bug. Don't go all along there, provide details in the description.

Write the description:
1. Mention the platform (Windows, Linux), QT and Qucs-S version
2. Show how to reproduce the bug step by step
3. Add anything that would ease reproducing and/or understanding the problem: screenshots, videos, error messages.
If the bug is related to schematic and its elements, then provide the schematic file. If you can't provide it for any reason (NDA, etc.), try to make a minimal substitute which is enough to reproduce the bug.

### I want to open a PR…
#### General rules:
1. Your branch must merge without any problem
2. Your changes must be about one thing (i.e. one logical unit) be it a bugfix or a new feature or refactoring, etc. Please restrain from making "packs" or other compound forms of fixes/features/…
3. Commits must be atomic, relatively small, easy to digest. Think in advance how easy it will be to review the changes you offer.
4. Commit messages must follow a general structure:
- brief description on the first line
- blank line
- detailed description
You can omit blank line and detailed description if have nothing to say. Commit messages must be no wider than 80 columns.
5. PR title must be concise, briefly describing what the PR does: adds a feature, removes smth, fixes a bug, etc.
6. In PR description write all about the changes you offer, like the intention behind them, what is fixed/added/removed, etc.

#### Rules for current release bugfixes
1. Use `release/YY.N` as a base branch for your bugfix branch
2. If you make a fix for a specific issue, then make its ID the first word in branch name. For example '310-fix-window-size'
3. Don't be afraid to use GitHub's facilities to [link](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue) a PR to an issue.

#### Rules for other PRs
1. Use `current` as a base branch for your changes

## Tooling and code guidelines
Code base is old and at the moment it doesn't follow any rules uniformly. But for your changes please follow these guidelines:
- Prefer modern C++ features, everything up to and including C++17 is OK
- Use `camelCaseWithSmallFirstLetter` for variable names
- Do not write `if`, `for`, etc. without a code block even when it contains a single statement
Bad:
```c++
if (blah-blah)
doFooBar();
```
Good:
```c++
if (blah-blah) {
doFooBar();
}
```
- Format your changes with `clang-format`. You can use it to format a portion of a file: `clang-format --lines=<first line number>:<last line number> path/to/file` (number of last line is *inclusive*, i.e. `--lines=15:17` formats lines 15, 16 and 17)
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
[![Boosty](https://img.shields.io/badge/Boosty-donate-orange.svg)](https://boosty.to/qucs_s)
[![Telegram](https://img.shields.io/badge/Telegram-chat-blue.svg)](https://t.me/qucs_s)
[![Website](https://img.shields.io/badge/Website-ra3xdh.github.io-29d682.svg)](https://ra3xdh.github.io/)
[![Packaging status](https://repology.org/badge/tiny-repos/qucs-s.svg)](https://repology.org/project/qucs-s/versions)

## About Qucs-S

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
24.1.0
24.2.0
Loading

0 comments on commit a73ac7c

Please sign in to comment.