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

Update clang format #35

Merged
merged 3 commits into from
Feb 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
18 changes: 12 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,19 @@ jobs:
python3 -m pip install -r docs/requirements.txt -r requirements.txt -r requirements-dev.txt

- name: Run cpp-linter as a py pkg
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
id: linter
run: |
sudo apt-get install clang-format-12
sudo apt-get install clang-format-14
cpp-linter \
--version=12 \
--version=14 \
--style=file \
--tidy-checks='-*' \
--files-changed-only='false' \
--ignore='!src|'
--lines-changed-only=true \
--ignore='!src|' \
--format-review=true \
--file-annotations=false

- name: C++ Linter checks failed?
if: steps.linter.outputs.checks-failed > 0
Expand All @@ -58,11 +62,13 @@ jobs:
run: python ./.github/workflows/pylint_matcher.py pylint.json

- name: Get doc dependencies
run: sudo apt-get install -y libgl1-mesa-dev libxkbcommon-x11-0 graphviz
run: |-
sudo apt-get update
sudo apt-get install -y libgl-dev libglvnd-dev libxkbcommon-x11-0 graphviz
- name: Build docs
working-directory: docs
# required for pySide6 on headless linux (as used by sphinx-social-cards extension)
env:
# required for pySide6 on headless linux (as used by sphinx-social-cards extension)
QT_QPA_PLATFORM: offscreen
run: sphinx-build -E -W -b html . _build/html

Expand Down
2 changes: 1 addition & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pylint
mypy
cpp-linter
cpp-linter>=1.7.1
black
35 changes: 13 additions & 22 deletions src/.clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ AlignTrailingComments: true
AllowAllArgumentsOnNextLine: true
AllowAllConstructorInitializersOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortEnumsOnASingleLine: true
AllowShortBlocksOnASingleLine: Always
AllowShortCaseLabelsOnASingleLine: false
AllowShortEnumsOnASingleLine: false
AllowShortBlocksOnASingleLine: Empty
AllowShortCaseLabelsOnASingleLine: true
AllowShortFunctionsOnASingleLine: All
AllowShortLambdasOnASingleLine: All
AllowShortIfStatementsOnASingleLine: WithoutElse
AllowShortLoopsOnASingleLine: true
AllowShortIfStatementsOnASingleLine: Never
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: Yes
Expand Down Expand Up @@ -67,10 +67,7 @@ DeriveLineEnding: false
DerivePointerAlignment: false
DisableFormat: false
EmptyLineBeforeAccessModifier: Always
# ---
# only in v13+
# EmptyLineAfterAccessModifier: Leave
# ---
EmptyLineAfterAccessModifier: Leave
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: true
IncludeBlocks: Preserve
Expand All @@ -89,10 +86,7 @@ IncludeCategories:
CaseSensitive: false
IncludeIsMainRegex: "(Test)?$"
IncludeIsMainSourceRegex: ""
# ---
# only in v13+
# IndentAccessModifiers: false
# ---
IndentAccessModifiers: false
IndentCaseLabels: true
IndentCaseBlocks: false
IndentGotoLabels: false
Expand All @@ -117,15 +111,12 @@ PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
PenaltyIndentedWhitespace: 0
PointerAlignment: Left
# ---
# only in v13+
# ReferenceAlignment: Right
# ---
ReferenceAlignment: Pointer
ReflowComments: true
# ---
# only in v13+
# ShortNamespaceLines: 0
# ---
SpacesInLineCommentPrefix:
Maximum: -1
Minimum: 0
ShortNamespaceLines: 0
# Sort**** is about sorting include/using statements alphabetically
SortIncludes: false
SortUsingDeclarations: false
Expand All @@ -150,7 +141,7 @@ SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
SpaceBeforeSquareBrackets: false
Standard: Latest
Standard: c++11
StatementAttributeLikeMacros: [emit]
StatementMacros: [Q_UNUSED, QT_REQUIRE_VERSION]
TabWidth: 4
Expand Down