[ci] Upgrade to wpiformat 2026.56 (#8666)

This commit is contained in:
Tyler Veness
2026-03-13 13:15:01 -07:00
committed by GitHub
parent f196418297
commit 907bf05607
14 changed files with 35 additions and 58 deletions

View File

@@ -36,7 +36,7 @@ jobs:
- name: Install wpiformat
run: |
python -m venv ${{ runner.temp }}/wpiformat
${{ runner.temp }}/wpiformat/bin/pip3 install wpiformat==2025.79
${{ runner.temp }}/wpiformat/bin/pip3 install wpiformat==2026.56
- name: Run
run: ${{ runner.temp }}/wpiformat/bin/wpiformat -default-branch 2027
- name: Check output
@@ -78,7 +78,7 @@ jobs:
- name: Install wpiformat
run: |
python -m venv ${{ runner.temp }}/wpiformat
${{ runner.temp }}/wpiformat/bin/pip3 install wpiformat==2025.79
${{ runner.temp }}/wpiformat/bin/pip3 install wpiformat==2026.56
- name: Create compile_commands.json
run: |
./gradlew generateCompileCommands -Ptoolchain-optional-roboRio

View File

@@ -24,8 +24,7 @@ macro(add_doxygen_docs)
set(DOXYGEN_WARN_AS_ERROR "FAIL_ON_WARNINGS_PRINT")
list(FILTER dirs EXCLUDE REGEX fmt|memory|units)
list(
APPEND
DOXYGEN_EXCLUDE_PATTERNS
APPEND DOXYGEN_EXCLUDE_PATTERNS
# apriltag
"apriltag_pose.h"
# llvm

View File

@@ -6,8 +6,7 @@ macro(add_source_jar target)
# Find all packages
foreach(directory ${directories})
cmake_path(
RELATIVE_PATH
directory
RELATIVE_PATH directory
BASE_DIRECTORY ${base_package_dir}
OUTPUT_VARIABLE package_name
)

View File

@@ -8,8 +8,7 @@ string(REGEX REPLACE "[^a-zA-Z0-9]" "_" funcName "${inputBase}")
set(funcName "GetResource_${funcName}")
file(
WRITE
"${output}"
WRITE "${output}"
"#include <stddef.h>\n#include <string_view>\nextern \"C\" {\nstatic const unsigned char contents[] = {"
)
@@ -17,8 +16,7 @@ string(REGEX MATCHALL ".." outputData "${fileHex}")
string(REGEX REPLACE ";" ", 0x" outputData "${outputData}")
file(APPEND "${output}" " 0x${outputData} };\n")
file(
APPEND
"${output}"
APPEND "${output}"
"const unsigned char* ${prefix}${funcName}(size_t* len) {\n *len = ${fileSize};\n return contents;\n}\n}\n"
)
@@ -26,8 +24,7 @@ if(NOT namespace STREQUAL "")
file(APPEND "${output}" "namespace ${namespace} {\n")
endif()
file(
APPEND
"${output}"
APPEND "${output}"
"std::string_view ${funcName}() {\n return std::string_view(reinterpret_cast<const char*>(contents), ${fileSize});\n}\n"
)
if(NOT namespace STREQUAL "")

View File

@@ -12,8 +12,8 @@ using namespace wpi::cmd;
PrintCommand::PrintCommand(std::string_view message)
: CommandHelper{
[str = std::string(message)] { wpi::util::print("{}\n", str); },
{}} {}
[str = std::string(message)] { wpi::util::print("{}\n", str); }, {}} {
}
bool PrintCommand::RunsWhenDisabled() const {
return true;

View File

@@ -633,8 +633,8 @@ void FieldInfo::Draw(ImDrawList* drawList, const FieldFrameData& ffd) const {
}
ObjectInfo::ObjectInfo(Storage& storage)
: m_width{storage.GetFloat("width",
DisplayOptions::kDefaultWidth.to<float>())},
: m_width{
storage.GetFloat("width", DisplayOptions::kDefaultWidth.to<float>())},
m_length{storage.GetFloat("length",
DisplayOptions::kDefaultLength.to<float>())},
m_style{storage.GetString("style"),

View File

@@ -42,8 +42,8 @@
class cbname##Source : public ::wpi::glass::Type##Source { \
public: \
explicit cbname##Source(int32_t index, int channel = -1) \
: Type##Source{::wpi::glass::MakeSourceId( \
id, channel < 0 ? index : channel)}, \
: Type##Source{ \
::wpi::glass::MakeSourceId(id, channel < 0 ? index : channel)}, \
m_index{index}, \
m_channel{channel < 0 ? index : channel}, \
m_callback{HALSIM_Register##cbname##Callback(index, CallbackFunc, \

View File

@@ -28,8 +28,7 @@ def copy_upstream_src(wpilib_root: Path):
wpimath / "src/main/native/thirdparty/sleipnir/include/gch/small_vector.hpp",
"w",
) as f:
f.write(
"""// Copyright (c) Sleipnir contributors
f.write("""// Copyright (c) Sleipnir contributors
#pragma once
@@ -41,8 +40,7 @@ template <typename T>
using small_vector = wpi::util::SmallVector<T>;
} // namespace gch
"""
)
""")
def main():

View File

@@ -22,8 +22,7 @@ def copy_upstream_src(wpilib_root: Path):
(stb / "cpp").mkdir(parents=True)
with open(stb / "cpp/stb_image.cpp", "w") as f:
f.write(
"""#define STBI_WINDOWS_UTF8
f.write("""#define STBI_WINDOWS_UTF8
#define STB_IMAGE_IMPLEMENTATION
#ifdef __GNUC__
@@ -32,8 +31,7 @@ def copy_upstream_src(wpilib_root: Path):
#endif
#include "stb_image.h"
"""
)
""")
def main():

View File

@@ -129,8 +129,7 @@ if(MSVC)
get_property(IS_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
set(CONFIG_SUFFIX "$<$<BOOL:${IS_MULTI_CONFIG}>:_$<CONFIG>>")
file(
GENERATE OUTPUT
${CMAKE_CURRENT_BINARY_DIR}/protobuf_objects${CONFIG_SUFFIX}.txt
GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/protobuf_objects${CONFIG_SUFFIX}.txt
CONTENT $<LIST:JOIN,$<TARGET_OBJECTS:protobuf>,\n>
)
add_custom_command(

View File

@@ -62,8 +62,8 @@ class WPILIB_DLLEXPORT Pose3d {
* @throws std::domain_error if the affine transformation matrix is invalid.
*/
constexpr explicit Pose3d(const Eigen::Matrix4d& matrix)
: m_translation{Eigen::Vector3d{
{matrix(0, 3)}, {matrix(1, 3)}, {matrix(2, 3)}}},
: m_translation{
Eigen::Vector3d{{matrix(0, 3)}, {matrix(1, 3)}, {matrix(2, 3)}}},
m_rotation{
Eigen::Matrix3d{{matrix(0, 0), matrix(0, 1), matrix(0, 2)},
{matrix(1, 0), matrix(1, 1), matrix(1, 2)},

View File

@@ -60,8 +60,8 @@ class WPILIB_DLLEXPORT Transform3d {
* @throws std::domain_error if the affine transformation matrix is invalid.
*/
constexpr explicit Transform3d(const Eigen::Matrix4d& matrix)
: m_translation{Eigen::Vector3d{
{matrix(0, 3)}, {matrix(1, 3)}, {matrix(2, 3)}}},
: m_translation{
Eigen::Vector3d{{matrix(0, 3)}, {matrix(1, 3)}, {matrix(2, 3)}}},
m_rotation{
Eigen::Matrix3d{{matrix(0, 0), matrix(0, 1), matrix(0, 2)},
{matrix(1, 0), matrix(1, 1), matrix(1, 2)},

View File

@@ -79,11 +79,9 @@ UNIT_CONFIGURATIONS = {
"base_unit": "RadiansPerSecond",
"multiply": {"Time": "Angle", "Frequency": "AngularAcceleration"},
"divide": {"Time": "AngularAcceleration"},
"extra": inspect.cleandoc(
"""
"extra": inspect.cleandoc("""
public Frequency asFrequency() { return Hertz.of(baseUnitMagnitude()); }
"""
),
"""),
},
"Current": {
"base_unit": "Amps",
@@ -161,12 +159,10 @@ UNIT_CONFIGURATIONS = {
"AngularVelocity": "AngularAcceleration",
},
"divide": {},
"extra": inspect.cleandoc(
"""
"extra": inspect.cleandoc("""
/** Converts this frequency to the time period between cycles. */
public Time asPeriod() { return Seconds.of(1 / baseUnitMagnitude()); }
"""
),
"""),
},
"LinearAcceleration": {
"base_unit": "MetersPerSecondPerSecond",
@@ -204,8 +200,7 @@ UNIT_CONFIGURATIONS = {
"generics": {"Dividend": {"extends": "Unit"}, "Divisor": {"extends": "Unit"}},
"multiply": {},
"divide": {},
"extra": inspect.cleandoc(
"""
"extra": inspect.cleandoc("""
public Measure<Dividend> timesDivisor(Measure<? extends Divisor> multiplier) {
return (Measure<Dividend>) baseUnit().numerator().ofBaseUnits(baseUnitMagnitude() * multiplier.baseUnitMagnitude());
}
@@ -214,8 +209,7 @@ UNIT_CONFIGURATIONS = {
// May return a velocity if Divisor == TimeUnit, so we can't guarantee a "Per" instance
return baseUnit().reciprocal().ofBaseUnits(1 / baseUnitMagnitude());
}
"""
),
"""),
},
"Power": {
"base_unit": "Watts",
@@ -250,11 +244,9 @@ UNIT_CONFIGURATIONS = {
# `Velocity<TimeUnit>` (i.e. a time per unit time ratio)
"Time": "Dimensionless"
},
"extra": inspect.cleandoc(
"""
"extra": inspect.cleandoc("""
public Frequency asFrequency() { return Hertz.of(1 / baseUnitMagnitude()); }
"""
),
"""),
},
"Torque": {
"base_unit": "NewtonMeters",
@@ -264,18 +256,12 @@ UNIT_CONFIGURATIONS = {
"Velocity": {
"base_unit": "unit()",
"generics": {"D": {"extends": "Unit"}},
"multiply": {
"Time": {
"implementation": inspect.cleandoc(
"""
"multiply": {"Time": {"implementation": inspect.cleandoc("""
@Override
public Measure<D> times(Time multiplier) {
return (Measure<D>) unit().numerator().ofBaseUnits(baseUnitMagnitude() * multiplier.baseUnitMagnitude());
}
"""
)
}
},
""")}},
"divide": {},
},
"Voltage": {

View File

@@ -175,8 +175,9 @@ class ProtoOutputStream {
* but allow manipulating the stream manually.
*/
ProtoOutputStream()
: m_msgDesc{Protobuf<
std::remove_cvref_t<T>>::MessageStruct::msg_descriptor()} {}
: m_msgDesc{
Protobuf<std::remove_cvref_t<T>>::MessageStruct::msg_descriptor()} {
}
/**
* Gets the backing nanopb stream object.