diff --git a/.github/workflows/lint-format.yml b/.github/workflows/lint-format.yml index e0f816424b..36b50edf9b 100644 --- a/.github/workflows/lint-format.yml +++ b/.github/workflows/lint-format.yml @@ -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 diff --git a/cmake/modules/AddDoxygenDocs.cmake b/cmake/modules/AddDoxygenDocs.cmake index 627a41176d..257d35aa24 100644 --- a/cmake/modules/AddDoxygenDocs.cmake +++ b/cmake/modules/AddDoxygenDocs.cmake @@ -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 diff --git a/cmake/modules/CreateSourceJar.cmake b/cmake/modules/CreateSourceJar.cmake index cb83866eb8..3bc18f6fa9 100644 --- a/cmake/modules/CreateSourceJar.cmake +++ b/cmake/modules/CreateSourceJar.cmake @@ -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 ) diff --git a/cmake/scripts/GenResource.cmake b/cmake/scripts/GenResource.cmake index ad9ca913d1..63f942bc2c 100644 --- a/cmake/scripts/GenResource.cmake +++ b/cmake/scripts/GenResource.cmake @@ -8,8 +8,7 @@ string(REGEX REPLACE "[^a-zA-Z0-9]" "_" funcName "${inputBase}") set(funcName "GetResource_${funcName}") file( - WRITE - "${output}" + WRITE "${output}" "#include \n#include \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(contents), ${fileSize});\n}\n" ) if(NOT namespace STREQUAL "") diff --git a/commandsv2/src/main/native/cpp/frc2/command/PrintCommand.cpp b/commandsv2/src/main/native/cpp/frc2/command/PrintCommand.cpp index 070711f87d..e06d179a23 100644 --- a/commandsv2/src/main/native/cpp/frc2/command/PrintCommand.cpp +++ b/commandsv2/src/main/native/cpp/frc2/command/PrintCommand.cpp @@ -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; diff --git a/glass/src/lib/native/cpp/other/Field2D.cpp b/glass/src/lib/native/cpp/other/Field2D.cpp index 87cc5dc538..f67577bf69 100644 --- a/glass/src/lib/native/cpp/other/Field2D.cpp +++ b/glass/src/lib/native/cpp/other/Field2D.cpp @@ -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())}, + : m_width{ + storage.GetFloat("width", DisplayOptions::kDefaultWidth.to())}, m_length{storage.GetFloat("length", DisplayOptions::kDefaultLength.to())}, m_style{storage.GetString("style"), diff --git a/simulation/halsim_gui/src/main/native/include/wpi/halsim/gui/HALDataSource.hpp b/simulation/halsim_gui/src/main/native/include/wpi/halsim/gui/HALDataSource.hpp index 0a71a76e46..618eceef79 100644 --- a/simulation/halsim_gui/src/main/native/include/wpi/halsim/gui/HALDataSource.hpp +++ b/simulation/halsim_gui/src/main/native/include/wpi/halsim/gui/HALDataSource.hpp @@ -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, \ diff --git a/upstream_utils/sleipnir.py b/upstream_utils/sleipnir.py index ad8c66414a..27a77430ee 100755 --- a/upstream_utils/sleipnir.py +++ b/upstream_utils/sleipnir.py @@ -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 using small_vector = wpi::util::SmallVector; } // namespace gch -""" - ) +""") def main(): diff --git a/upstream_utils/stb.py b/upstream_utils/stb.py index 69b14ba725..c80192e2ab 100755 --- a/upstream_utils/stb.py +++ b/upstream_utils/stb.py @@ -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(): diff --git a/wpimath/CMakeLists.txt b/wpimath/CMakeLists.txt index 84fee0782c..273698b4d4 100644 --- a/wpimath/CMakeLists.txt +++ b/wpimath/CMakeLists.txt @@ -129,8 +129,7 @@ if(MSVC) get_property(IS_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) set(CONFIG_SUFFIX "$<$:_$>") file( - GENERATE OUTPUT - ${CMAKE_CURRENT_BINARY_DIR}/protobuf_objects${CONFIG_SUFFIX}.txt + GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/protobuf_objects${CONFIG_SUFFIX}.txt CONTENT $,\n> ) add_custom_command( diff --git a/wpimath/src/main/native/include/wpi/math/geometry/Pose3d.hpp b/wpimath/src/main/native/include/wpi/math/geometry/Pose3d.hpp index 7f288e5ce0..c9f3b034f7 100644 --- a/wpimath/src/main/native/include/wpi/math/geometry/Pose3d.hpp +++ b/wpimath/src/main/native/include/wpi/math/geometry/Pose3d.hpp @@ -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)}, diff --git a/wpimath/src/main/native/include/wpi/math/geometry/Transform3d.hpp b/wpimath/src/main/native/include/wpi/math/geometry/Transform3d.hpp index 7b0f62e2c3..6dea7ab99e 100644 --- a/wpimath/src/main/native/include/wpi/math/geometry/Transform3d.hpp +++ b/wpimath/src/main/native/include/wpi/math/geometry/Transform3d.hpp @@ -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)}, diff --git a/wpiunits/generate_units.py b/wpiunits/generate_units.py index 05f415db5d..3b7a8f0e2c 100755 --- a/wpiunits/generate_units.py +++ b/wpiunits/generate_units.py @@ -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 timesDivisor(Measure multiplier) { return (Measure) 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` (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 times(Time multiplier) { return (Measure) unit().numerator().ofBaseUnits(baseUnitMagnitude() * multiplier.baseUnitMagnitude()); } - """ - ) - } - }, + """)}}, "divide": {}, }, "Voltage": { diff --git a/wpiutil/src/main/native/include/wpi/util/protobuf/Protobuf.hpp b/wpiutil/src/main/native/include/wpi/util/protobuf/Protobuf.hpp index f864247b07..f4f48eb092 100644 --- a/wpiutil/src/main/native/include/wpi/util/protobuf/Protobuf.hpp +++ b/wpiutil/src/main/native/include/wpi/util/protobuf/Protobuf.hpp @@ -175,8 +175,9 @@ class ProtoOutputStream { * but allow manipulating the stream manually. */ ProtoOutputStream() - : m_msgDesc{Protobuf< - std::remove_cvref_t>::MessageStruct::msg_descriptor()} {} + : m_msgDesc{ + Protobuf>::MessageStruct::msg_descriptor()} { + } /** * Gets the backing nanopb stream object.