Skip to content

Commit

Permalink
.pre-commit - autoupdate + .clang-format StatementAttributeLikeMacros (
Browse files Browse the repository at this point in the history
…#527)

autoupdate the pre-commit hooks.

add StatementAttributeLikeMacros setting to .clang-format
  "Macros which are ignored in front of a statement, as if they
   were an attribute. So that they are not parsed as identifier,
   for example for Qts emit."

As recommended in llvm/llvm-project#99758

to fix the spaces around the arrow operator problem
  • Loading branch information
Allen Winter authored Oct 17, 2024
1 parent 6ec7032 commit eac68b6
Show file tree
Hide file tree
Showing 9 changed files with 180 additions and 182 deletions.
1 change: 1 addition & 0 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,5 @@ SpaceInEmptyParentheses: false
SpacesInAngles: false
SpacesInCStyleCastParentheses: true
SpacesInParentheses: false
StatementAttributeLikeMacros: [emit,KDDW_CO_AWAIT]
...
12 changes: 6 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
ci:
skip: [pylint,clang-format]
skip: [pylint]
autoupdate_schedule: monthly

exclude: ^(cmake/ECM|cmake/KDAB/|src/3rdparty/|code.dev.code-workspace)
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
rev: v5.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
Expand All @@ -21,12 +21,12 @@ repos:
- id: destroyed-symlinks
- id: check-executables-have-shebangs
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v17.0.6
rev: v19.1.1
hooks:
- id: clang-format
exclude: (.json)
- repo: https://github.com/PyCQA/pylint
rev: v3.2.4
rev: v3.3.1
hooks:
- id: pylint
exclude: ^(.cmake-format.py|conan/conanfile.py)
Expand All @@ -53,12 +53,12 @@ repos:
files: \.(md|mdown|markdown)$
exclude: (docs/book/)
- repo: https://github.com/fsfe/reuse-tool
rev: v3.1.0a1
rev: v4.0.3
hooks:
- id: reuse
args: [--suppress-deprecation]
- repo: https://github.com/scop/pre-commit-shfmt
rev: v3.8.0-1
rev: v3.9.0-1
hooks:
- id: shfmt
- repo: https://github.com/shellcheck-py/shellcheck-py
Expand Down
2 changes: 1 addition & 1 deletion src/core/Position.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ LayoutSaver::Position Position::serialize() const
p.indexOfFloatingWindow = fw->beingDeleted()
? -1
: DockRegistry::self()->floatingWindows().indexOf(
fw);
fw);
} else {
p.mainWindowUniqueName = mainWindow->uniqueName();
assert(!p.mainWindowUniqueName.isEmpty());
Expand Down
2 changes: 1 addition & 1 deletion src/core/Separator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ Separator::Separator(LayoutingHost *host, Qt::Orientation orientation, Core::Ite
view()->show();
view()->init();
d->lazyResizeRubberBand = d->usesLazyResize ? Config::self().viewFactory()->createRubberBand(
rubberBandIsTopLevel() ? nullptr : view())
rubberBandIsTopLevel() ? nullptr : view())
: nullptr;
setVisible(true);
}
Expand Down
8 changes: 4 additions & 4 deletions src/core/TitleBar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ using namespace KDDockWidgets::Core;

TitleBar::TitleBar(Group *parent)
: Controller(
ViewType::TitleBar,
Config::self().viewFactory()->createTitleBar(this, parent ? parent->view() : nullptr))
ViewType::TitleBar,
Config::self().viewFactory()->createTitleBar(this, parent ? parent->view() : nullptr))
, Draggable(view())
, d(new Private())
, m_group(parent)
Expand All @@ -67,8 +67,8 @@ TitleBar::TitleBar(Group *parent)

TitleBar::TitleBar(FloatingWindow *parent)
: Controller(
ViewType::TitleBar,
Config::self().viewFactory()->createTitleBar(this, parent ? parent->view() : nullptr))
ViewType::TitleBar,
Config::self().viewFactory()->createTitleBar(this, parent ? parent->view() : nullptr))
, Draggable(view())
, d(new Private())
, m_group(nullptr)
Expand Down
2 changes: 1 addition & 1 deletion src/flutter/Platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ class DOCKS_EXPORT Platform : public Core::Platform
void pauseForDebugger() override;

/// Pauses execution, so we can attach Dart's debugger
virtual void pauseForDartDebugger() {};
virtual void pauseForDartDebugger() { };

// Called by unit-test's main.dart. Runs the tests.
// The tests are in C++, as they are the same ones for QtWidgets and QtQuick
Expand Down
Loading

0 comments on commit eac68b6

Please sign in to comment.