SCRIPT: wpiformat

This commit is contained in:
PJ Reiniger
2025-11-07 19:57:55 -05:00
committed by Peter Johnson
parent c48b722dac
commit 1e7604f81c
1218 changed files with 2709 additions and 3267 deletions

View File

@@ -11,12 +11,12 @@
#include <fmt/format.h>
#include <gtest/gtest.h>
#include "wpi/nt/NetworkTableInstance.hpp"
#include "wpi/nt/StringArrayTopic.hpp"
#include "wpi/util/Alert.hpp"
#include "wpi/simulation/SimHooks.hpp"
#include "wpi/smartdashboard/SmartDashboard.hpp"
#include "wpi/util/Alert.hpp"
using namespace frc;
using enum Alert::AlertType;

View File

@@ -3,8 +3,8 @@
// the WPILib BSD license file in the root directory of this project.
#include <gtest/gtest.h>
#include "wpi/hal/HAL.h"
#include "wpi/hal/HAL.h"
#include "wpi/hardware/rotation/AnalogPotentiometer.hpp"
#include "wpi/simulation/AnalogInputSim.hpp"
#include "wpi/simulation/RoboRioSim.hpp"

View File

@@ -3,8 +3,8 @@
// the WPILib BSD license file in the root directory of this project.
#include <gtest/gtest.h>
#include "wpi/hal/HAL.h"
#include "wpi/hal/HAL.h"
#include "wpi/hardware/pneumatic/DoubleSolenoid.hpp"
#include "wpi/hardware/pneumatic/PneumaticsControlModule.hpp"
#include "wpi/hardware/pneumatic/Solenoid.hpp"

View File

@@ -3,8 +3,8 @@
// the WPILib BSD license file in the root directory of this project.
#include <gtest/gtest.h>
#include "wpi/hal/HAL.h"
#include "wpi/hal/HAL.h"
#include "wpi/hardware/pneumatic/DoubleSolenoid.hpp"
#include "wpi/hardware/pneumatic/PneumaticsControlModule.hpp"
#include "wpi/hardware/pneumatic/Solenoid.hpp"

View File

@@ -2,11 +2,11 @@
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
#include <gtest/gtest.h>
#include "wpi/driverstation/GenericHID.hpp"
#include "wpi/simulation/GenericHIDSim.hpp"
#include <gtest/gtest.h>
using namespace frc;
using RumbleType = GenericHID::RumbleType;
static constexpr double kEpsilon = 0.0001;

View File

@@ -3,11 +3,11 @@
// the WPILib BSD license file in the root directory of this project.
#include <gtest/gtest.h>
#include "wpi/util/MathExtras.hpp"
#include "wpi/util/timestamp.h"
#include "wpi/hardware/led/LEDPattern.hpp"
#include "wpi/math/util/MathUtil.hpp"
#include "wpi/util/MathExtras.hpp"
#include "wpi/util/timestamp.h"
namespace frc {

View File

@@ -6,8 +6,8 @@
#include <gtest/gtest.h>
#include "wpi/system/Notifier.hpp"
#include "wpi/simulation/SimHooks.hpp"
#include "wpi/system/Notifier.hpp"
using namespace frc;

View File

@@ -5,13 +5,13 @@
#include <string_view>
#include <gtest/gtest.h>
#include "wpi/simulation/SimHooks.hpp"
#include "wpi/system/ScopedTracer.hpp"
#include "wpi/util/SmallString.hpp"
#include "wpi/util/StringExtras.hpp"
#include "wpi/util/raw_ostream.hpp"
#include "wpi/system/ScopedTracer.hpp"
#include "wpi/simulation/SimHooks.hpp"
TEST(ScopedTracerTest, Timing) {
wpi::SmallString<128> buf;
wpi::raw_svector_ostream os(buf);

View File

@@ -3,8 +3,8 @@
// the WPILib BSD license file in the root directory of this project.
#include <gtest/gtest.h>
#include "wpi/hal/HAL.h"
#include "wpi/hal/HAL.h"
#include "wpi/hardware/pneumatic/DoubleSolenoid.hpp"
#include "wpi/hardware/pneumatic/PneumaticsControlModule.hpp"
#include "wpi/hardware/pneumatic/Solenoid.hpp"

View File

@@ -3,8 +3,8 @@
// the WPILib BSD license file in the root directory of this project.
#include <gtest/gtest.h>
#include "wpi/hal/HAL.h"
#include "wpi/hal/HAL.h"
#include "wpi/hardware/pneumatic/DoubleSolenoid.hpp"
#include "wpi/hardware/pneumatic/PneumaticsControlModule.hpp"
#include "wpi/hardware/pneumatic/Solenoid.hpp"

View File

@@ -3,6 +3,7 @@
// the WPILib BSD license file in the root directory of this project.
#include <gtest/gtest.h>
#include "wpi/nt/DoubleTopic.hpp"
#include "wpi/nt/NetworkTableInstance.hpp"
#include "wpi/nt/UnitTopic.hpp"

View File

@@ -4,8 +4,8 @@
#include <gtest/gtest.h>
#include "wpi/drive/DifferentialDrive.hpp"
#include "motorcontrol/MockPWMMotorController.hpp"
#include "wpi/drive/DifferentialDrive.hpp"
TEST(DifferentialDriveTest, ArcadeDriveIK) {
// Forward

View File

@@ -4,8 +4,8 @@
#include <gtest/gtest.h>
#include "wpi/drive/MecanumDrive.hpp"
#include "motorcontrol/MockPWMMotorController.hpp"
#include "wpi/drive/MecanumDrive.hpp"
TEST(MecanumDriveTest, CartesianIK) {
// Forward

View File

@@ -4,8 +4,8 @@
#include <gtest/gtest.h>
#include "wpi/system/Errors.hpp"
#include "wpi/event/EventLoop.hpp"
#include "wpi/system/Errors.hpp"
using namespace frc;

View File

@@ -3,11 +3,11 @@
// the WPILib BSD license file in the root directory of this project.
#include <gtest/gtest.h>
#include "wpi/nt/BooleanTopic.hpp"
#include "wpi/nt/NetworkTableInstance.hpp"
#include "wpi/event/EventLoop.hpp"
#include "wpi/event/NetworkBooleanEvent.hpp"
#include "wpi/nt/BooleanTopic.hpp"
#include "wpi/nt/NetworkTableInstance.hpp"
using namespace frc;

View File

@@ -3,6 +3,7 @@
// the WPILib BSD license file in the root directory of this project.
#include <gtest/gtest.h>
#include "wpi/hal/HALBase.h"
#ifndef __FRC_SYSTEMCORE__

View File

@@ -8,9 +8,9 @@
#include <vector>
#include <gtest/gtest.h>
#include "wpi/util/deprecated.hpp"
#include "motorcontrol/MockMotorController.hpp"
#include "wpi/util/deprecated.hpp"
using namespace frc;

View File

@@ -7,9 +7,9 @@
#include <array>
#include <gtest/gtest.h>
#include "wpi/hal/HAL.h"
#include "callback_helpers/TestCallbackHelpers.hpp"
#include "wpi/hal/HAL.h"
#include "wpi/hardware/led/AddressableLED.hpp"
namespace frc::sim {

View File

@@ -5,12 +5,12 @@
#include <numbers>
#include <gtest/gtest.h>
#include "wpi/hal/HAL.h"
#include "wpi/units/math.hpp"
#include "wpi/hardware/rotation/AnalogEncoder.hpp"
#include "wpi/hal/HAL.h"
#include "wpi/hardware/discrete/AnalogInput.hpp"
#include "wpi/hardware/rotation/AnalogEncoder.hpp"
#include "wpi/simulation/AnalogEncoderSim.hpp"
#include "wpi/units/math.hpp"
#define EXPECT_NEAR_UNITS(val1, val2, eps) \
EXPECT_LE(units::math::abs(val1 - val2), eps)

View File

@@ -5,9 +5,9 @@
#include "wpi/simulation/AnalogInputSim.hpp" // NOLINT(build/include_order)
#include <gtest/gtest.h>
#include "wpi/hal/HAL.h"
#include "callback_helpers/TestCallbackHelpers.hpp"
#include "wpi/hal/HAL.h"
#include "wpi/hardware/discrete/AnalogInput.hpp"
namespace frc::sim {

View File

@@ -5,9 +5,9 @@
#include "wpi/simulation/CTREPCMSim.hpp" // NOLINT(build/include_order)
#include <gtest/gtest.h>
#include "wpi/hal/HAL.h"
#include "callback_helpers/TestCallbackHelpers.hpp"
#include "wpi/hal/HAL.h"
#include "wpi/hardware/pneumatic/DoubleSolenoid.hpp"
#include "wpi/hardware/pneumatic/PneumaticsControlModule.hpp"

View File

@@ -4,15 +4,15 @@
#include <gtest/gtest.h>
#include "wpi/hardware/rotation/Encoder.hpp"
#include "wpi/system/RobotController.hpp"
#include "wpi/math/controller/PIDController.hpp"
#include "wpi/hardware/motor/PWMVictorSPX.hpp"
#include "wpi/hardware/rotation/Encoder.hpp"
#include "wpi/math/controller/PIDController.hpp"
#include "wpi/math/system/plant/LinearSystemId.hpp"
#include "wpi/simulation/BatterySim.hpp"
#include "wpi/simulation/DCMotorSim.hpp"
#include "wpi/simulation/EncoderSim.hpp"
#include "wpi/simulation/RoboRioSim.hpp"
#include "wpi/math/system/plant/LinearSystemId.hpp"
#include "wpi/system/RobotController.hpp"
TEST(DCMotorSimTest, VoltageSteadyState) {
frc::DCMotor gearbox = frc::DCMotor::NEO(1);

View File

@@ -5,9 +5,9 @@
#include "wpi/simulation/DIOSim.hpp" // NOLINT(build/include_order)
#include <gtest/gtest.h>
#include "wpi/hal/HAL.h"
#include "callback_helpers/TestCallbackHelpers.hpp"
#include "wpi/hal/HAL.h"
#include "wpi/hardware/discrete/DigitalInput.hpp"
#include "wpi/hardware/discrete/DigitalOutput.hpp"

View File

@@ -3,19 +3,19 @@
// the WPILib BSD license file in the root directory of this project.
#include <gtest/gtest.h>
#include "wpi/units/current.hpp"
#include "wpi/units/math.hpp"
#include "wpi/units/moment_of_inertia.hpp"
#include "wpi/math/controller/LTVUnicycleController.hpp"
#include "wpi/math/controller/LinearPlantInversionFeedforward.hpp"
#include "wpi/math/kinematics/DifferentialDriveKinematics.hpp"
#include "wpi/simulation/DifferentialDrivetrainSim.hpp"
#include "wpi/math/system/NumericalIntegration.hpp"
#include "wpi/math/system/plant/DCMotor.hpp"
#include "wpi/math/system/plant/LinearSystemId.hpp"
#include "wpi/math/trajectory/TrajectoryGenerator.hpp"
#include "wpi/math/trajectory/constraint/DifferentialDriveKinematicsConstraint.hpp"
#include "wpi/simulation/DifferentialDrivetrainSim.hpp"
#include "wpi/units/current.hpp"
#include "wpi/units/math.hpp"
#include "wpi/units/moment_of_inertia.hpp"
TEST(DifferentialDrivetrainSimTest, Convergence) {
auto motor = frc::DCMotor::NEO(2);

View File

@@ -5,9 +5,9 @@
#include "wpi/simulation/DigitalPWMSim.hpp" // NOLINT(build/include_order)
#include <gtest/gtest.h>
#include "wpi/hal/HAL.h"
#include "callback_helpers/TestCallbackHelpers.hpp"
#include "wpi/hal/HAL.h"
#include "wpi/hardware/discrete/DigitalOutput.hpp"
namespace frc::sim {

View File

@@ -5,9 +5,9 @@
#include "wpi/simulation/DutyCycleEncoderSim.hpp" // NOLINT(build/include_order)
#include <gtest/gtest.h>
#include "wpi/hal/HAL.h"
#include "callback_helpers/TestCallbackHelpers.hpp"
#include "wpi/hal/HAL.h"
#include "wpi/hardware/rotation/DutyCycleEncoder.hpp"
namespace frc::sim {

View File

@@ -5,9 +5,9 @@
#include "wpi/simulation/DutyCycleSim.hpp" // NOLINT(build/include_order)
#include <gtest/gtest.h>
#include "wpi/hal/HAL.h"
#include "callback_helpers/TestCallbackHelpers.hpp"
#include "wpi/hal/HAL.h"
#include "wpi/hardware/discrete/DigitalInput.hpp"
#include "wpi/hardware/rotation/DutyCycle.hpp"

View File

@@ -3,18 +3,18 @@
// the WPILib BSD license file in the root directory of this project.
#include <gtest/gtest.h>
#include "wpi/units/math.hpp"
#include "wpi/units/time.hpp"
#include "wpi/hardware/rotation/Encoder.hpp"
#include "wpi/system/RobotController.hpp"
#include "wpi/math/controller/PIDController.hpp"
#include "wpi/hardware/motor/PWMVictorSPX.hpp"
#include "wpi/simulation/ElevatorSim.hpp"
#include "wpi/simulation/EncoderSim.hpp"
#include "wpi/hardware/rotation/Encoder.hpp"
#include "wpi/math/controller/PIDController.hpp"
#include "wpi/math/system/NumericalIntegration.hpp"
#include "wpi/math/system/plant/DCMotor.hpp"
#include "wpi/math/system/plant/LinearSystemId.hpp"
#include "wpi/simulation/ElevatorSim.hpp"
#include "wpi/simulation/EncoderSim.hpp"
#include "wpi/system/RobotController.hpp"
#include "wpi/units/math.hpp"
#include "wpi/units/time.hpp"
#define EXPECT_NEAR_UNITS(val1, val2, eps) \
EXPECT_LE(units::math::abs(val1 - val2), eps)

View File

@@ -5,11 +5,11 @@
#include "wpi/simulation/EncoderSim.hpp" // NOLINT(build/include_order)
#include <gtest/gtest.h>
#include "wpi/hal/HAL.h"
#include "wpi/util/deprecated.hpp"
#include "callback_helpers/TestCallbackHelpers.hpp"
#include "wpi/hal/HAL.h"
#include "wpi/hardware/rotation/Encoder.hpp"
#include "wpi/util/deprecated.hpp"
namespace frc::sim {

View File

@@ -7,9 +7,9 @@
#include <vector>
#include <gtest/gtest.h>
#include "wpi/hal/HAL.h"
#include "callback_helpers/TestCallbackHelpers.hpp"
#include "wpi/hal/HAL.h"
#include "wpi/hardware/power/PowerDistribution.hpp"
namespace frc::sim {

View File

@@ -5,8 +5,8 @@
#include "wpi/simulation/PWMMotorControllerSim.hpp" // NOLINT(build/include_order)
#include <gtest/gtest.h>
#include "wpi/hal/HAL.h"
#include "wpi/hal/HAL.h"
#include "wpi/hardware/motor/Spark.hpp"
namespace frc::sim {

View File

@@ -5,9 +5,9 @@
#include "wpi/simulation/PWMSim.hpp" // NOLINT(build/include_order)
#include <gtest/gtest.h>
#include "wpi/hal/HAL.h"
#include "callback_helpers/TestCallbackHelpers.hpp"
#include "wpi/hal/HAL.h"
#include "wpi/hardware/discrete/PWM.hpp"
namespace frc::sim {

View File

@@ -5,9 +5,9 @@
#include "wpi/simulation/REVPHSim.hpp" // NOLINT(build/include_order)
#include <gtest/gtest.h>
#include "wpi/hal/HAL.h"
#include "callback_helpers/TestCallbackHelpers.hpp"
#include "wpi/hal/HAL.h"
#include "wpi/hardware/pneumatic/DoubleSolenoid.hpp"
#include "wpi/hardware/pneumatic/PneumaticHub.hpp"

View File

@@ -7,10 +7,10 @@
#include <string>
#include <gtest/gtest.h>
#include "wpi/hal/HAL.h"
#include "wpi/hal/HALBase.h"
#include "callback_helpers/TestCallbackHelpers.hpp"
#include "wpi/hal/HAL.h"
#include "wpi/hal/HALBase.h"
#include "wpi/system/RobotController.hpp"
namespace frc::sim {

View File

@@ -5,8 +5,8 @@
#include <string_view>
#include <gtest/gtest.h>
#include "wpi/hal/SimDevice.h"
#include "wpi/hal/SimDevice.h"
#include "wpi/simulation/SimDeviceSim.hpp"
using namespace frc::sim;

View File

@@ -5,8 +5,8 @@
#include <exception>
#include <gtest/gtest.h>
#include "wpi/hal/HAL.h"
#include "wpi/hal/HAL.h"
#include "wpi/simulation/AddressableLEDSim.hpp"
#include "wpi/simulation/AnalogInputSim.hpp"
#include "wpi/simulation/CTREPCMSim.hpp"

View File

@@ -3,14 +3,12 @@
// the WPILib BSD license file in the root directory of this project.
#include <gtest/gtest.h>
#include "wpi/units/angular_acceleration.hpp"
#include "wpi/units/angular_velocity.hpp"
#include "wpi/hardware/motor/PWMVictorSPX.hpp"
#include "wpi/hardware/rotation/Encoder.hpp"
#include "wpi/system/RobotController.hpp"
#include "wpi/math/controller/PIDController.hpp"
#include "wpi/math/controller/SimpleMotorFeedforward.hpp"
#include "wpi/hardware/motor/PWMVictorSPX.hpp"
#include "wpi/math/system/plant/LinearSystemId.hpp"
#include "wpi/simulation/BatterySim.hpp"
#include "wpi/simulation/DifferentialDrivetrainSim.hpp"
#include "wpi/simulation/ElevatorSim.hpp"
@@ -19,7 +17,9 @@
#include "wpi/simulation/LinearSystemSim.hpp"
#include "wpi/simulation/PWMSim.hpp"
#include "wpi/simulation/RoboRioSim.hpp"
#include "wpi/math/system/plant/LinearSystemId.hpp"
#include "wpi/system/RobotController.hpp"
#include "wpi/units/angular_acceleration.hpp"
#include "wpi/units/angular_velocity.hpp"
TEST(StateSpaceSimTest, FlywheelSim) {
const frc::LinearSystem<1, 1, 1> plant =

View File

@@ -2,14 +2,14 @@
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
#include <gtest/gtest.h>
#include "wpi/nt/NetworkTableInstance.hpp"
#include "wpi/smartdashboard/Mechanism2d.hpp"
#include "wpi/smartdashboard/MechanismLigament2d.hpp"
#include "wpi/smartdashboard/SmartDashboard.hpp"
#include "wpi/util/Color8Bit.hpp"
#include <gtest/gtest.h>
#include "wpi/nt/NetworkTableInstance.hpp"
#include "wpi/units/angle.hpp"
#include "wpi/util/Color8Bit.hpp"
class Mechanism2dTest;

View File

@@ -2,16 +2,16 @@
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
#include "wpi/simulation/SendableChooserSim.hpp"
#include "wpi/smartdashboard/SendableChooser.hpp"
#include "wpi/smartdashboard/SmartDashboard.hpp"
#include <string>
#include <fmt/format.h>
#include <gtest/gtest.h>
#include "wpi/nt/NetworkTableInstance.hpp"
#include "wpi/nt/StringTopic.hpp"
#include "wpi/simulation/SendableChooserSim.hpp"
#include "wpi/smartdashboard/SendableChooser.hpp"
#include "wpi/smartdashboard/SmartDashboard.hpp"
class SendableChooserTest : public ::testing::TestWithParam<int> {};