Skip to content

Commit 5370f24

Browse files
authored
[build] Upgrade to wpiformat 2024.33 (wpilibsuite#6449)
This upgrades to clang-format and clang-tidy 18.1.1. This has the constructor attribute formatting fix, so we can remove our WPI_DEPRECATED macro.
1 parent b4674ba commit 5370f24

File tree

43 files changed

+135
-132
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+135
-132
lines changed

.clang-format

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ AlignConsecutiveMacros:
2828
AcrossComments: false
2929
AlignCompound: false
3030
PadOperators: false
31+
AlignConsecutiveShortCaseStatements:
32+
Enabled: false
33+
AcrossEmptyLines: false
34+
AcrossComments: false
35+
AlignCaseColons: false
3136
AlignEscapedNewlines: Left
3237
AlignOperands: Align
3338
AlignTrailingComments:
@@ -141,6 +146,7 @@ IntegerLiteralSeparator:
141146
JavaScriptQuotes: Leave
142147
JavaScriptWrapImports: true
143148
KeepEmptyLinesAtTheStartOfBlocks: false
149+
KeepEmptyLinesAtEOF: false
144150
LambdaBodyIndentation: Signature
145151
LineEnding: DeriveLF
146152
MacroBlockBegin: ''
@@ -201,6 +207,7 @@ RawStringFormats:
201207
ReferenceAlignment: Pointer
202208
ReflowComments: true
203209
RemoveBracesLLVM: false
210+
RemoveParentheses: Leave
204211
RemoveSemicolon: false
205212
RequiresClausePosition: OwnLine
206213
RequiresExpressionIndentation: OuterScope
@@ -218,6 +225,7 @@ SpaceBeforeCaseColon: false
218225
SpaceBeforeCpp11BracedList: false
219226
SpaceBeforeCtorInitializerColon: true
220227
SpaceBeforeInheritanceColon: true
228+
SpaceBeforeJsonColon: false
221229
SpaceBeforeParens: ControlStatements
222230
SpaceBeforeParensOptions:
223231
AfterControlStatements: true
@@ -232,23 +240,28 @@ SpaceBeforeParensOptions:
232240
SpaceBeforeRangeBasedForLoopColon: true
233241
SpaceBeforeSquareBrackets: false
234242
SpaceInEmptyBlock: false
235-
SpaceInEmptyParentheses: false
236243
SpacesBeforeTrailingComments: 2
237244
SpacesInAngles: Never
238-
SpacesInConditionalStatement: false
239245
SpacesInContainerLiterals: true
240-
SpacesInCStyleCastParentheses: false
241246
SpacesInLineCommentPrefix:
242247
Minimum: 1
243248
Maximum: -1
244-
SpacesInParentheses: false
249+
SpacesInParens: Never
250+
SpacesInParensOptions:
251+
InCStyleCasts: false
252+
InConditionalStatements: false
253+
InEmptyParentheses: false
254+
Other: false
245255
SpacesInSquareBrackets: false
246256
Standard: c++20
257+
StatementAttributeLikeMacros:
258+
- Q_EMIT
247259
StatementMacros:
248260
- Q_UNUSED
249261
- QT_REQUIRE_VERSION
250262
TabWidth: 8
251263
UseTab: Never
264+
VerilogBreakBetweenInstancePorts: true
252265
WhitespaceSensitiveMacros:
253266
- BOOST_PP_STRINGIZE
254267
- CF_SWIFT_NAME

.github/workflows/lint-format.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
with:
2828
python-version: '3.10'
2929
- name: Install wpiformat
30-
run: pip3 install wpiformat==2024.32
30+
run: pip3 install wpiformat==2024.33
3131
- name: Run
3232
run: wpiformat
3333
- name: Check output

crossConnIntegrationTests/src/main/native/include/LifetimeWrappers.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -190,12 +190,12 @@ struct RelayHandle {
190190
HAL_RelayHandle handle = 0;
191191
};
192192

193-
#define ASSERT_LAST_ERROR_STATUS(status, x) \
194-
do { \
195-
ASSERT_EQ(status, HAL_USE_LAST_ERROR); \
196-
[[maybe_unused]] const char* lastErrorMessageInMacro = \
197-
HAL_GetLastError(&status); \
198-
ASSERT_EQ(status, x); \
193+
#define ASSERT_LAST_ERROR_STATUS(status, x) \
194+
do { \
195+
ASSERT_EQ(status, HAL_USE_LAST_ERROR); \
196+
[[maybe_unused]] \
197+
const char* lastErrorMessageInMacro = HAL_GetLastError(&status); \
198+
ASSERT_EQ(status, x); \
199199
} while (0)
200200

201201
} // namespace hlt

cscore/src/main/native/cpp/MjpegServerImpl.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -438,9 +438,7 @@ void MjpegServerImpl::ConnThread::SendHTML(wpi::raw_ostream& os,
438438

439439
os << "<p>Supported Video Modes:</p>\n";
440440
os << "<table cols=\"4\" style=\"border: 1px solid black\">\n";
441-
os << "<tr><th>Pixel Format</th>"
442-
<< "<th>Width</th>"
443-
<< "<th>Height</th>"
441+
os << "<tr><th>Pixel Format</th>" << "<th>Width</th>" << "<th>Height</th>"
444442
<< "<th>FPS</th></tr>";
445443
for (auto mode : source.EnumerateVideoModes(&status)) {
446444
os << "<tr><td>";
@@ -881,8 +879,7 @@ void MjpegServerImpl::ConnThread::ProcessRequest() {
881879
ProcessCommand(os, *source, parameters, true);
882880
} else {
883881
SendHeader(os, 200, "OK", "text/plain");
884-
os << "Ignored due to no connected source."
885-
<< "\r\n";
882+
os << "Ignored due to no connected source." << "\r\n";
886883
SDEBUG("Ignored due to no connected source.");
887884
}
888885
break;

docs/build.gradle

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,12 +180,10 @@ doxygen {
180180
warn_if_undocumented false
181181
warn_no_paramdoc true
182182

183-
//enable doxygen preprocessor expansion of WPI_DEPRECATED to fix MotorController docs
184183
enable_preprocessing true
185184
macro_expansion true
186185
expand_only_predef true
187-
predefined "WPI_DEPRECATED(x)=[[deprecated(x)]]\"\\\n" +
188-
"\"__cplusplus\"\\\n" +
186+
predefined "__cplusplus\"\\\n" +
189187
"\"HAL_ENUM(name)=enum name : int32_t"
190188

191189
if (project.hasProperty('docWarningsAsErrors')) {

ntcore/src/main/native/cpp/NetworkServer.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -323,8 +323,7 @@ NetworkServer::NetworkServer(std::string_view persistentFilename,
323323
HandleLocal();
324324

325325
// load persistent file first, then initialize
326-
uv::QueueWork(
327-
m_loop, [this] { LoadPersistent(); }, [this] { Init(); });
326+
uv::QueueWork(m_loop, [this] { LoadPersistent(); }, [this] { Init(); });
328327
});
329328
}
330329

ntcore/src/main/native/include/networktables/StructArrayTopic.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,8 @@ class StructArraySubscriber : public Subscriber {
228228

229229
private:
230230
ValueType m_defaultValue;
231-
[[no_unique_address]] std::tuple<I...> m_info;
231+
[[no_unique_address]]
232+
std::tuple<I...> m_info;
232233
};
233234

234235
/**
@@ -387,7 +388,8 @@ class StructArrayPublisher : public Publisher {
387388
private:
388389
wpi::StructArrayBuffer<T, I...> m_buf;
389390
std::atomic_bool m_schemaPublished{false};
390-
[[no_unique_address]] std::tuple<I...> m_info;
391+
[[no_unique_address]]
392+
std::tuple<I...> m_info;
391393
};
392394

393395
/**
@@ -702,7 +704,8 @@ class StructArrayTopic final : public Topic {
702704
}
703705

704706
private:
705-
[[no_unique_address]] std::tuple<I...> m_info;
707+
[[no_unique_address]]
708+
std::tuple<I...> m_info;
706709
};
707710

708711
} // namespace nt

ntcore/src/main/native/include/networktables/StructTopic.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,8 @@ class StructSubscriber : public Subscriber {
180180

181181
private:
182182
ValueType m_defaultValue;
183-
[[no_unique_address]] std::tuple<I...> m_info;
183+
[[no_unique_address]]
184+
std::tuple<I...> m_info;
184185
};
185186

186187
/**
@@ -301,7 +302,8 @@ class StructPublisher : public Publisher {
301302

302303
private:
303304
std::atomic_bool m_schemaPublished{false};
304-
[[no_unique_address]] std::tuple<I...> m_info;
305+
[[no_unique_address]]
306+
std::tuple<I...> m_info;
305307
};
306308

307309
/**
@@ -522,7 +524,8 @@ class StructTopic final : public Topic {
522524
}
523525

524526
private:
525-
[[no_unique_address]] std::tuple<I...> m_info;
527+
[[no_unique_address]]
528+
std::tuple<I...> m_info;
526529
};
527530

528531
} // namespace nt

wpilibNewCommands/src/main/native/cpp/frc2/command/Command.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,7 @@ std::optional<std::string> Command::GetPreviousCompositionSite() const {
174174

175175
void Command::InitSendable(wpi::SendableBuilder& builder) {
176176
builder.SetSmartDashboardType("Command");
177-
builder.AddStringProperty(
178-
".name", [this] { return GetName(); }, nullptr);
177+
builder.AddStringProperty(".name", [this] { return GetName(); }, nullptr);
179178
builder.AddBooleanProperty(
180179
"running", [this] { return IsScheduled(); },
181180
[this](bool value) {

wpilibNewCommands/src/main/native/include/frc2/command/CommandBase.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44

55
#pragma once
66

7-
#include <wpi/deprecated.h>
8-
97
#include "frc2/command/Command.h"
108

119
namespace frc2 {
@@ -19,7 +17,7 @@ namespace frc2 {
1917
*/
2018
class [[deprecated("Use Command instead")]] CommandBase : public Command {
2119
protected:
22-
WPI_DEPRECATED("Use Command instead")
20+
[[deprecated("Use Command instead")]]
2321
CommandBase();
2422
};
2523
} // namespace frc2

0 commit comments

Comments
 (0)