mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
[ci] Upgrade to wpiformat 2026.56 (#8666)
This commit is contained in:
4
.github/workflows/lint-format.yml
vendored
4
.github/workflows/lint-format.yml
vendored
@@ -36,7 +36,7 @@ jobs:
|
|||||||
- name: Install wpiformat
|
- name: Install wpiformat
|
||||||
run: |
|
run: |
|
||||||
python -m venv ${{ runner.temp }}/wpiformat
|
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
|
- name: Run
|
||||||
run: ${{ runner.temp }}/wpiformat/bin/wpiformat -default-branch 2027
|
run: ${{ runner.temp }}/wpiformat/bin/wpiformat -default-branch 2027
|
||||||
- name: Check output
|
- name: Check output
|
||||||
@@ -78,7 +78,7 @@ jobs:
|
|||||||
- name: Install wpiformat
|
- name: Install wpiformat
|
||||||
run: |
|
run: |
|
||||||
python -m venv ${{ runner.temp }}/wpiformat
|
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
|
- name: Create compile_commands.json
|
||||||
run: |
|
run: |
|
||||||
./gradlew generateCompileCommands -Ptoolchain-optional-roboRio
|
./gradlew generateCompileCommands -Ptoolchain-optional-roboRio
|
||||||
|
|||||||
@@ -24,8 +24,7 @@ macro(add_doxygen_docs)
|
|||||||
set(DOXYGEN_WARN_AS_ERROR "FAIL_ON_WARNINGS_PRINT")
|
set(DOXYGEN_WARN_AS_ERROR "FAIL_ON_WARNINGS_PRINT")
|
||||||
list(FILTER dirs EXCLUDE REGEX fmt|memory|units)
|
list(FILTER dirs EXCLUDE REGEX fmt|memory|units)
|
||||||
list(
|
list(
|
||||||
APPEND
|
APPEND DOXYGEN_EXCLUDE_PATTERNS
|
||||||
DOXYGEN_EXCLUDE_PATTERNS
|
|
||||||
# apriltag
|
# apriltag
|
||||||
"apriltag_pose.h"
|
"apriltag_pose.h"
|
||||||
# llvm
|
# llvm
|
||||||
|
|||||||
@@ -6,8 +6,7 @@ macro(add_source_jar target)
|
|||||||
# Find all packages
|
# Find all packages
|
||||||
foreach(directory ${directories})
|
foreach(directory ${directories})
|
||||||
cmake_path(
|
cmake_path(
|
||||||
RELATIVE_PATH
|
RELATIVE_PATH directory
|
||||||
directory
|
|
||||||
BASE_DIRECTORY ${base_package_dir}
|
BASE_DIRECTORY ${base_package_dir}
|
||||||
OUTPUT_VARIABLE package_name
|
OUTPUT_VARIABLE package_name
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -8,8 +8,7 @@ string(REGEX REPLACE "[^a-zA-Z0-9]" "_" funcName "${inputBase}")
|
|||||||
set(funcName "GetResource_${funcName}")
|
set(funcName "GetResource_${funcName}")
|
||||||
|
|
||||||
file(
|
file(
|
||||||
WRITE
|
WRITE "${output}"
|
||||||
"${output}"
|
|
||||||
"#include <stddef.h>\n#include <string_view>\nextern \"C\" {\nstatic const unsigned char contents[] = {"
|
"#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}")
|
string(REGEX REPLACE ";" ", 0x" outputData "${outputData}")
|
||||||
file(APPEND "${output}" " 0x${outputData} };\n")
|
file(APPEND "${output}" " 0x${outputData} };\n")
|
||||||
file(
|
file(
|
||||||
APPEND
|
APPEND "${output}"
|
||||||
"${output}"
|
|
||||||
"const unsigned char* ${prefix}${funcName}(size_t* len) {\n *len = ${fileSize};\n return contents;\n}\n}\n"
|
"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")
|
file(APPEND "${output}" "namespace ${namespace} {\n")
|
||||||
endif()
|
endif()
|
||||||
file(
|
file(
|
||||||
APPEND
|
APPEND "${output}"
|
||||||
"${output}"
|
|
||||||
"std::string_view ${funcName}() {\n return std::string_view(reinterpret_cast<const char*>(contents), ${fileSize});\n}\n"
|
"std::string_view ${funcName}() {\n return std::string_view(reinterpret_cast<const char*>(contents), ${fileSize});\n}\n"
|
||||||
)
|
)
|
||||||
if(NOT namespace STREQUAL "")
|
if(NOT namespace STREQUAL "")
|
||||||
|
|||||||
@@ -12,8 +12,8 @@ using namespace wpi::cmd;
|
|||||||
|
|
||||||
PrintCommand::PrintCommand(std::string_view message)
|
PrintCommand::PrintCommand(std::string_view message)
|
||||||
: CommandHelper{
|
: CommandHelper{
|
||||||
[str = std::string(message)] { wpi::util::print("{}\n", str); },
|
[str = std::string(message)] { wpi::util::print("{}\n", str); }, {}} {
|
||||||
{}} {}
|
}
|
||||||
|
|
||||||
bool PrintCommand::RunsWhenDisabled() const {
|
bool PrintCommand::RunsWhenDisabled() const {
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -633,8 +633,8 @@ void FieldInfo::Draw(ImDrawList* drawList, const FieldFrameData& ffd) const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ObjectInfo::ObjectInfo(Storage& storage)
|
ObjectInfo::ObjectInfo(Storage& storage)
|
||||||
: m_width{storage.GetFloat("width",
|
: m_width{
|
||||||
DisplayOptions::kDefaultWidth.to<float>())},
|
storage.GetFloat("width", DisplayOptions::kDefaultWidth.to<float>())},
|
||||||
m_length{storage.GetFloat("length",
|
m_length{storage.GetFloat("length",
|
||||||
DisplayOptions::kDefaultLength.to<float>())},
|
DisplayOptions::kDefaultLength.to<float>())},
|
||||||
m_style{storage.GetString("style"),
|
m_style{storage.GetString("style"),
|
||||||
|
|||||||
@@ -42,8 +42,8 @@
|
|||||||
class cbname##Source : public ::wpi::glass::Type##Source { \
|
class cbname##Source : public ::wpi::glass::Type##Source { \
|
||||||
public: \
|
public: \
|
||||||
explicit cbname##Source(int32_t index, int channel = -1) \
|
explicit cbname##Source(int32_t index, int channel = -1) \
|
||||||
: Type##Source{::wpi::glass::MakeSourceId( \
|
: Type##Source{ \
|
||||||
id, channel < 0 ? index : channel)}, \
|
::wpi::glass::MakeSourceId(id, channel < 0 ? index : channel)}, \
|
||||||
m_index{index}, \
|
m_index{index}, \
|
||||||
m_channel{channel < 0 ? index : channel}, \
|
m_channel{channel < 0 ? index : channel}, \
|
||||||
m_callback{HALSIM_Register##cbname##Callback(index, CallbackFunc, \
|
m_callback{HALSIM_Register##cbname##Callback(index, CallbackFunc, \
|
||||||
|
|||||||
@@ -28,8 +28,7 @@ def copy_upstream_src(wpilib_root: Path):
|
|||||||
wpimath / "src/main/native/thirdparty/sleipnir/include/gch/small_vector.hpp",
|
wpimath / "src/main/native/thirdparty/sleipnir/include/gch/small_vector.hpp",
|
||||||
"w",
|
"w",
|
||||||
) as f:
|
) as f:
|
||||||
f.write(
|
f.write("""// Copyright (c) Sleipnir contributors
|
||||||
"""// Copyright (c) Sleipnir contributors
|
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
@@ -41,8 +40,7 @@ template <typename T>
|
|||||||
using small_vector = wpi::util::SmallVector<T>;
|
using small_vector = wpi::util::SmallVector<T>;
|
||||||
|
|
||||||
} // namespace gch
|
} // namespace gch
|
||||||
"""
|
""")
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
|||||||
@@ -22,8 +22,7 @@ def copy_upstream_src(wpilib_root: Path):
|
|||||||
(stb / "cpp").mkdir(parents=True)
|
(stb / "cpp").mkdir(parents=True)
|
||||||
|
|
||||||
with open(stb / "cpp/stb_image.cpp", "w") as f:
|
with open(stb / "cpp/stb_image.cpp", "w") as f:
|
||||||
f.write(
|
f.write("""#define STBI_WINDOWS_UTF8
|
||||||
"""#define STBI_WINDOWS_UTF8
|
|
||||||
#define STB_IMAGE_IMPLEMENTATION
|
#define STB_IMAGE_IMPLEMENTATION
|
||||||
|
|
||||||
#ifdef __GNUC__
|
#ifdef __GNUC__
|
||||||
@@ -32,8 +31,7 @@ def copy_upstream_src(wpilib_root: Path):
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "stb_image.h"
|
#include "stb_image.h"
|
||||||
"""
|
""")
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
|||||||
@@ -129,8 +129,7 @@ if(MSVC)
|
|||||||
get_property(IS_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
|
get_property(IS_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
|
||||||
set(CONFIG_SUFFIX "$<$<BOOL:${IS_MULTI_CONFIG}>:_$<CONFIG>>")
|
set(CONFIG_SUFFIX "$<$<BOOL:${IS_MULTI_CONFIG}>:_$<CONFIG>>")
|
||||||
file(
|
file(
|
||||||
GENERATE OUTPUT
|
GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/protobuf_objects${CONFIG_SUFFIX}.txt
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/protobuf_objects${CONFIG_SUFFIX}.txt
|
|
||||||
CONTENT $<LIST:JOIN,$<TARGET_OBJECTS:protobuf>,\n>
|
CONTENT $<LIST:JOIN,$<TARGET_OBJECTS:protobuf>,\n>
|
||||||
)
|
)
|
||||||
add_custom_command(
|
add_custom_command(
|
||||||
|
|||||||
@@ -62,8 +62,8 @@ class WPILIB_DLLEXPORT Pose3d {
|
|||||||
* @throws std::domain_error if the affine transformation matrix is invalid.
|
* @throws std::domain_error if the affine transformation matrix is invalid.
|
||||||
*/
|
*/
|
||||||
constexpr explicit Pose3d(const Eigen::Matrix4d& matrix)
|
constexpr explicit Pose3d(const Eigen::Matrix4d& matrix)
|
||||||
: m_translation{Eigen::Vector3d{
|
: m_translation{
|
||||||
{matrix(0, 3)}, {matrix(1, 3)}, {matrix(2, 3)}}},
|
Eigen::Vector3d{{matrix(0, 3)}, {matrix(1, 3)}, {matrix(2, 3)}}},
|
||||||
m_rotation{
|
m_rotation{
|
||||||
Eigen::Matrix3d{{matrix(0, 0), matrix(0, 1), matrix(0, 2)},
|
Eigen::Matrix3d{{matrix(0, 0), matrix(0, 1), matrix(0, 2)},
|
||||||
{matrix(1, 0), matrix(1, 1), matrix(1, 2)},
|
{matrix(1, 0), matrix(1, 1), matrix(1, 2)},
|
||||||
|
|||||||
@@ -60,8 +60,8 @@ class WPILIB_DLLEXPORT Transform3d {
|
|||||||
* @throws std::domain_error if the affine transformation matrix is invalid.
|
* @throws std::domain_error if the affine transformation matrix is invalid.
|
||||||
*/
|
*/
|
||||||
constexpr explicit Transform3d(const Eigen::Matrix4d& matrix)
|
constexpr explicit Transform3d(const Eigen::Matrix4d& matrix)
|
||||||
: m_translation{Eigen::Vector3d{
|
: m_translation{
|
||||||
{matrix(0, 3)}, {matrix(1, 3)}, {matrix(2, 3)}}},
|
Eigen::Vector3d{{matrix(0, 3)}, {matrix(1, 3)}, {matrix(2, 3)}}},
|
||||||
m_rotation{
|
m_rotation{
|
||||||
Eigen::Matrix3d{{matrix(0, 0), matrix(0, 1), matrix(0, 2)},
|
Eigen::Matrix3d{{matrix(0, 0), matrix(0, 1), matrix(0, 2)},
|
||||||
{matrix(1, 0), matrix(1, 1), matrix(1, 2)},
|
{matrix(1, 0), matrix(1, 1), matrix(1, 2)},
|
||||||
|
|||||||
@@ -79,11 +79,9 @@ UNIT_CONFIGURATIONS = {
|
|||||||
"base_unit": "RadiansPerSecond",
|
"base_unit": "RadiansPerSecond",
|
||||||
"multiply": {"Time": "Angle", "Frequency": "AngularAcceleration"},
|
"multiply": {"Time": "Angle", "Frequency": "AngularAcceleration"},
|
||||||
"divide": {"Time": "AngularAcceleration"},
|
"divide": {"Time": "AngularAcceleration"},
|
||||||
"extra": inspect.cleandoc(
|
"extra": inspect.cleandoc("""
|
||||||
"""
|
|
||||||
public Frequency asFrequency() { return Hertz.of(baseUnitMagnitude()); }
|
public Frequency asFrequency() { return Hertz.of(baseUnitMagnitude()); }
|
||||||
"""
|
"""),
|
||||||
),
|
|
||||||
},
|
},
|
||||||
"Current": {
|
"Current": {
|
||||||
"base_unit": "Amps",
|
"base_unit": "Amps",
|
||||||
@@ -161,12 +159,10 @@ UNIT_CONFIGURATIONS = {
|
|||||||
"AngularVelocity": "AngularAcceleration",
|
"AngularVelocity": "AngularAcceleration",
|
||||||
},
|
},
|
||||||
"divide": {},
|
"divide": {},
|
||||||
"extra": inspect.cleandoc(
|
"extra": inspect.cleandoc("""
|
||||||
"""
|
|
||||||
/** Converts this frequency to the time period between cycles. */
|
/** Converts this frequency to the time period between cycles. */
|
||||||
public Time asPeriod() { return Seconds.of(1 / baseUnitMagnitude()); }
|
public Time asPeriod() { return Seconds.of(1 / baseUnitMagnitude()); }
|
||||||
"""
|
"""),
|
||||||
),
|
|
||||||
},
|
},
|
||||||
"LinearAcceleration": {
|
"LinearAcceleration": {
|
||||||
"base_unit": "MetersPerSecondPerSecond",
|
"base_unit": "MetersPerSecondPerSecond",
|
||||||
@@ -204,8 +200,7 @@ UNIT_CONFIGURATIONS = {
|
|||||||
"generics": {"Dividend": {"extends": "Unit"}, "Divisor": {"extends": "Unit"}},
|
"generics": {"Dividend": {"extends": "Unit"}, "Divisor": {"extends": "Unit"}},
|
||||||
"multiply": {},
|
"multiply": {},
|
||||||
"divide": {},
|
"divide": {},
|
||||||
"extra": inspect.cleandoc(
|
"extra": inspect.cleandoc("""
|
||||||
"""
|
|
||||||
public Measure<Dividend> timesDivisor(Measure<? extends Divisor> multiplier) {
|
public Measure<Dividend> timesDivisor(Measure<? extends Divisor> multiplier) {
|
||||||
return (Measure<Dividend>) baseUnit().numerator().ofBaseUnits(baseUnitMagnitude() * multiplier.baseUnitMagnitude());
|
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
|
// May return a velocity if Divisor == TimeUnit, so we can't guarantee a "Per" instance
|
||||||
return baseUnit().reciprocal().ofBaseUnits(1 / baseUnitMagnitude());
|
return baseUnit().reciprocal().ofBaseUnits(1 / baseUnitMagnitude());
|
||||||
}
|
}
|
||||||
"""
|
"""),
|
||||||
),
|
|
||||||
},
|
},
|
||||||
"Power": {
|
"Power": {
|
||||||
"base_unit": "Watts",
|
"base_unit": "Watts",
|
||||||
@@ -250,11 +244,9 @@ UNIT_CONFIGURATIONS = {
|
|||||||
# `Velocity<TimeUnit>` (i.e. a time per unit time ratio)
|
# `Velocity<TimeUnit>` (i.e. a time per unit time ratio)
|
||||||
"Time": "Dimensionless"
|
"Time": "Dimensionless"
|
||||||
},
|
},
|
||||||
"extra": inspect.cleandoc(
|
"extra": inspect.cleandoc("""
|
||||||
"""
|
|
||||||
public Frequency asFrequency() { return Hertz.of(1 / baseUnitMagnitude()); }
|
public Frequency asFrequency() { return Hertz.of(1 / baseUnitMagnitude()); }
|
||||||
"""
|
"""),
|
||||||
),
|
|
||||||
},
|
},
|
||||||
"Torque": {
|
"Torque": {
|
||||||
"base_unit": "NewtonMeters",
|
"base_unit": "NewtonMeters",
|
||||||
@@ -264,18 +256,12 @@ UNIT_CONFIGURATIONS = {
|
|||||||
"Velocity": {
|
"Velocity": {
|
||||||
"base_unit": "unit()",
|
"base_unit": "unit()",
|
||||||
"generics": {"D": {"extends": "Unit"}},
|
"generics": {"D": {"extends": "Unit"}},
|
||||||
"multiply": {
|
"multiply": {"Time": {"implementation": inspect.cleandoc("""
|
||||||
"Time": {
|
|
||||||
"implementation": inspect.cleandoc(
|
|
||||||
"""
|
|
||||||
@Override
|
@Override
|
||||||
public Measure<D> times(Time multiplier) {
|
public Measure<D> times(Time multiplier) {
|
||||||
return (Measure<D>) unit().numerator().ofBaseUnits(baseUnitMagnitude() * multiplier.baseUnitMagnitude());
|
return (Measure<D>) unit().numerator().ofBaseUnits(baseUnitMagnitude() * multiplier.baseUnitMagnitude());
|
||||||
}
|
}
|
||||||
"""
|
""")}},
|
||||||
)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"divide": {},
|
"divide": {},
|
||||||
},
|
},
|
||||||
"Voltage": {
|
"Voltage": {
|
||||||
|
|||||||
@@ -175,8 +175,9 @@ class ProtoOutputStream {
|
|||||||
* but allow manipulating the stream manually.
|
* but allow manipulating the stream manually.
|
||||||
*/
|
*/
|
||||||
ProtoOutputStream()
|
ProtoOutputStream()
|
||||||
: m_msgDesc{Protobuf<
|
: m_msgDesc{
|
||||||
std::remove_cvref_t<T>>::MessageStruct::msg_descriptor()} {}
|
Protobuf<std::remove_cvref_t<T>>::MessageStruct::msg_descriptor()} {
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the backing nanopb stream object.
|
* Gets the backing nanopb stream object.
|
||||||
|
|||||||
Reference in New Issue
Block a user