-
Notifications
You must be signed in to change notification settings - Fork 12
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
Fix clang tidy warnings #23
Conversation
7ea61e0
to
aec72eb
Compare
So it shows up in VSCode.
It warned about unused variable as the SPDLOG_LOGGER_DEBUG is compiled out in release builds.
std::ignore used in cases where we don't need to store the connection. I think it's more descriptive than (void). Technically, using std::ignore is UB until Peppe's P2968 is ratified in C++26 but every implementation we target does the right thing so I don't care. Sue me.
LinuxWaylandPlatformWindow::scaleByFactor converted to template so it can work both for signed and unsigned types without warning.
Setting SYSTEM on FetchContent_Declare for fmt is not good as it requires CMake 3.25 (we want to support older ones) and doesn't work as clang-tidy is still invoked.
For better readability, in xcb-facing code I retained C arrays. While we're at it, replaced one KD_UNUSED with std::ignore.
Some got NOLINT treatment because they are used as wayland callbacks and it's easier to have them this way.
This fixes some issues with exceptions in constructors.
aec72eb
to
7bacedc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wonder if exception handling should be a configuration option?
This way we have less NOLINT exceptions.
1e0c1c8
to
cd9cdbb
Compare
We throw exceptions in multiple places, particularly in initializing Wayland and XCB. Plus, KDBindings may throw as well and doesn't have any support for turning exceptions on and off. I suggest we create an issue for it and start working on it once the concrete need arises. What do you think @mkrus ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't mind either way regarding KD_UNUSED vs commented out names, just saw KD_UNUSED used (sic) in some places
This is a giant PR but it's comprised of (mostly) small atomic commits. So best reviewed commit by commit.
Not everything is fixed yet. Few more complicated ones are left out. Also, fixing warnings in tests will be done separately.