Skip to content

Commit 449327b

Browse files
committed
all: fix clang 18 lints
1 parent e957e88 commit 449327b

File tree

26 files changed

+46
-34
lines changed

26 files changed

+46
-34
lines changed

.clang-tidy

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Checks: >
66
bugprone-*,
77
-bugprone-easily-swappable-parameters,
88
-bugprone-forward-declararion-namespace,
9+
-bugprone-forward-declararion-namespace,
910
concurrency-*,
1011
cppcoreguidelines-*,
1112
-cppcoreguidelines-owning-memory,
@@ -42,6 +43,7 @@ Checks: >
4243
-readability-else-after-return,
4344
-readability-container-data-pointer,
4445
-readability-implicit-bool-conversion,
46+
-readability-avoid-nested-conditional-operator,
4547
tidyfox-*,
4648
CheckOptions:
4749
performance-for-range-copy.WarnOnAllAutoCopies: true

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: Build
2-
on: [push, pull_request]
2+
on: [push, pull_request, workflow_dispatch]
33

44
jobs:
55
nix:

.github/workflows/lint.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: Lint
2-
on: [push, pull_request]
2+
on: [push, pull_request, workflow_dispatch]
33

44
jobs:
55
lint:
@@ -22,4 +22,4 @@ jobs:
2222
just build
2323
2424
- name: Run lints
25-
run: just lint 2>&1
25+
run: just lint-ci

Justfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ fmt:
44
find src -type f \( -name "*.cpp" -o -name "*.hpp" \) -print0 | xargs -0 clang-format -i
55

66
lint:
7-
find src -type f -name "*.cpp" -print0 | parallel -q0 --bar clang-tidy --use-color --load={{ env_var("TIDYFOX") }}
7+
find src -type f -name "*.cpp" -print0 | parallel -q0 --no-notice --will-cite --tty --bar clang-tidy --load={{ env_var("TIDYFOX") }}
8+
9+
lint-ci:
10+
find src -type f -name "*.cpp" -print0 | parallel -q0 --no-notice --will-cite --tty clang-tidy --load={{ env_var("TIDYFOX") }}
811

912
configure target='debug' *FLAGS='':
1013
cmake -GNinja -B {{builddir}} \

src/core/clock.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#include <qqmlintegration.h>
66
#include <qtimer.h>
77
#include <qtmetamacros.h>
8+
#include <qtypes.h>
89

910
#include "util.hpp"
1011

@@ -27,7 +28,7 @@ class SystemClock: public QObject {
2728

2829
public:
2930
// must be named enum until docgen is ready to handle member enums better
30-
enum Enum {
31+
enum Enum : quint8 {
3132
Hours = 1,
3233
Minutes = 2,
3334
Seconds = 3,

src/core/logging_qtprivate.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include <qlogging.h>
1111
#include <qloggingcategory.h>
1212
#include <qstringview.h>
13+
#include <qtypes.h>
1314

1415
namespace qs::log {
1516
Q_DECLARE_LOGGING_CATEGORY(logLogging);
@@ -22,7 +23,7 @@ class QLoggingRule {
2223
QLoggingRule(QStringView pattern, bool enabled);
2324
[[nodiscard]] int pass(QLatin1StringView categoryName, QtMsgType type) const;
2425

25-
enum PatternFlag {
26+
enum PatternFlag : quint8 {
2627
FullText = 0x1,
2728
LeftFilter = 0x2,
2829
RightFilter = 0x4,

src/core/paths.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#pragma once
22
#include <qdatetime.h>
33
#include <qdir.h>
4+
#include <qtypes.h>
45

56
#include "instanceinfo.hpp"
67

@@ -31,7 +32,7 @@ class QsPaths {
3132
void createLock();
3233

3334
private:
34-
enum class DirState {
35+
enum class DirState : quint8 {
3536
Unknown = 0,
3637
Ready = 1,
3738
Failed = 2,

src/core/popupanchor.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include <qsize.h>
1111
#include <qtclasshelpermacros.h>
1212
#include <qtmetamacros.h>
13+
#include <qtypes.h>
1314
#include <qwindow.h>
1415

1516
#include "../window/proxywindow.hpp"
@@ -26,7 +27,7 @@ namespace PopupAdjustment { // NOLINT
2627
Q_NAMESPACE;
2728
QML_ELEMENT;
2829

29-
enum Enum {
30+
enum Enum : quint8 {
3031
None = 0,
3132
/// If the X axis is constrained, the popup will slide along the X axis until it fits onscreen.
3233
SlideX = 1,

src/core/qsmenu.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class QsMenuButtonType: public QObject {
2020
QML_SINGLETON;
2121

2222
public:
23-
enum Enum {
23+
enum Enum : quint8 {
2424
/// This menu item does not have a checkbox or a radiobutton associated with it.
2525
None = 0,
2626
/// This menu item should draw a checkbox.

src/core/region.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ namespace RegionShape { // NOLINT
1515
Q_NAMESPACE;
1616
QML_ELEMENT;
1717

18-
enum Enum {
18+
enum Enum : quint8 {
1919
Rect = 0,
2020
Ellipse = 1,
2121
};
@@ -29,7 +29,7 @@ namespace Intersection { // NOLINT
2929
Q_NAMESPACE;
3030
QML_ELEMENT;
3131

32-
enum Enum {
32+
enum Enum : quint8 {
3333
/// Combine this region, leaving a union of this and the other region. (opposite of `Subtract`)
3434
Combine = 0,
3535
/// Subtract this region, cutting this region out of the other. (opposite of `Combine`)

0 commit comments

Comments
 (0)