From 1705b2d61c9057fd59801ac46b29042e9fed0ef5 Mon Sep 17 00:00:00 2001 From: Tyler Veness Date: Tue, 11 Nov 2025 18:05:12 -0800 Subject: [PATCH] Upgrade wpiformat and use clang-format's include sorting (#8350) This PR also uses the newly added -default-branch flag to generate the list of changed files with respect to the correct branch (2027). --- .clang-format | 65 +++++++++++++------ .github/workflows/lint-format.yml | 18 ++--- .styleguide | 18 ----- .../src/main/native/cpp/jni/AprilTagJNI.cpp | 5 +- .../test/native/cpp/AprilTagDetectorTest.cpp | 4 +- .../src/main/native/cpp/CartPoleBenchmark.hpp | 3 +- cameraserver/.styleguide | 7 -- commandsv2/.styleguide | 11 ---- .../native/cpp/frc2/command/ProxyCommand.cpp | 4 +- .../native/cpp/wpi/command/CommandPtrTest.cpp | 3 +- .../wpi/command/ConditionalCommandTest.cpp | 3 +- .../cpp/wpi/command/DeferredCommandTest.cpp | 3 +- .../cpp/wpi/command/FunctionalCommandTest.cpp | 3 +- .../cpp/wpi/command/InstantCommandTest.cpp | 3 +- .../cpp/wpi/command/NotifierCommandTest.cpp | 3 +- .../native/cpp/wpi/command/POVButtonTest.cpp | 3 +- .../wpi/command/ParallelCommandGroupTest.cpp | 3 +- .../wpi/command/ParallelDeadlineGroupTest.cpp | 3 +- .../cpp/wpi/command/ParallelRaceGroupTest.cpp | 3 +- .../cpp/wpi/command/PrintCommandTest.cpp | 3 +- .../cpp/wpi/command/ProxyCommandTest.cpp | 3 +- .../cpp/wpi/command/RepeatCommandTest.cpp | 3 +- .../native/cpp/wpi/command/RunCommandTest.cpp | 3 +- .../cpp/wpi/command/ScheduleCommandTest.cpp | 3 +- .../cpp/wpi/command/SelectCommandTest.cpp | 3 +- .../command/SequentialCommandGroupTest.cpp | 3 +- .../cpp/wpi/command/StartEndCommandTest.cpp | 3 +- .../cpp/wpi/command/WaitCommandTest.cpp | 3 +- .../cpp/wpi/command/WaitUntilCommandTest.cpp | 3 +- .../wpi/command/button/NetworkButtonTest.cpp | 3 +- .../command/button/RobotModeTriggersTest.cpp | 3 +- .../cpp/wpi/command/button/TriggerTest.cpp | 3 +- .../wpi/command/sysid/SysIdRoutineTest.cpp | 3 +- cscore/.styleguide | 9 --- .../main/native/cpp/UsbCameraImplCommon.cpp | 4 +- .../main/native/cpp/jni/CameraServerJNI.cpp | 7 +- cscore/src/main/native/linux/NetworkUtil.cpp | 4 +- .../src/main/native/windows/COMCreators.cpp | 3 +- .../main/native/windows/NetworkListener.cpp | 17 ++--- .../src/main/native/windows/NetworkUtil.cpp | 3 +- .../src/main/native/windows/UsbCameraImpl.cpp | 7 +- .../src/main/native/windows/UsbCameraImpl.hpp | 10 ++- .../main/native/windows/UsbCameraListener.cpp | 9 +-- .../main/native/windows/UsbCameraProperty.hpp | 3 +- .../native/windows/WindowsMessagePump.cpp | 5 +- datalog/.styleguide | 6 -- .../native/cpp/DataLogBackgroundWriter.cpp | 2 +- .../native/include/wpi/datalog/DataLog_c.h | 3 +- .../src/test/native/cpp/FileLoggerTest.cpp | 4 +- glass/.styleguide | 12 ---- glass/src/app/native/cpp/camerasupport.cpp | 17 ++++- glass/src/lib/native/cpp/other/Plot.cpp | 8 +-- hal/.styleguide | 15 ----- .../native/include/wpi/hal/DriverStation.h | 3 +- hal/src/main/native/include/wpi/hal/HALBase.h | 4 +- hal/src/main/native/sim/HAL.cpp | 2 +- .../native/sim/mockdata/SimDeviceData.cpp | 2 +- hal/src/test/native/cpp/HALTest.cpp | 4 +- .../native/cpp/mockdata/AnalogInDataTest.cpp | 3 +- .../test/native/cpp/mockdata/DIODataTest.cpp | 3 +- .../cpp/mockdata/DriverStationDataTest.cpp | 3 +- .../test/native/cpp/mockdata/I2CDataTest.cpp | 3 +- .../test/native/cpp/mockdata/PWMDataTest.cpp | 3 +- .../native/cpp/mockdata/SimDeviceDataTest.cpp | 3 +- ntcore/.styleguide | 6 -- .../src/test/native/cpp/LocalStorageTest.cpp | 3 +- .../src/test/native/cpp/NetworkTableTest.cpp | 3 +- ntcore/src/test/native/cpp/StructTest.cpp | 3 +- .../test/native/cpp/net/WireDecoderTest.cpp | 3 +- .../test/native/cpp/net/WireEncoderTest.cpp | 3 +- .../test/native/cpp/server/ServerImplTest.cpp | 3 +- ntcoreffi/.styleguide | 6 -- romiVendordep/.styleguide | 9 --- .../src/test/native/cpp/DSCommPacketTest.cpp | 4 +- .../halsim_gui/src/main/native/cpp/main.cpp | 3 +- .../src/dev/native/cpp/main.cpp | 3 +- .../src/dev/native/cpp/main.cpp | 3 +- .../main/native/cpp/HALSimHttpConnection.cpp | 4 +- .../src/test/native/cpp/main.cpp | 3 +- tools/datalogtool/.styleguide | 7 -- tools/outlineviewer/.styleguide | 8 --- tools/sysid/.styleguide | 8 --- tools/sysid/src/main/native/cpp/App.cpp | 10 +-- .../native/cpp/analysis/AnalysisTypeTest.cpp | 4 +- .../cpp/analysis/FeedbackAnalysisTest.cpp | 3 +- .../cpp/analysis/FeedforwardAnalysisTest.cpp | 3 +- .../src/test/native/cpp/analysis/OLSTest.cpp | 4 +- .../cpp/analysis/TrackwidthAnalysisTest.cpp | 4 +- tools/wpical/.styleguide | 11 ---- wpigui/.styleguide | 6 -- wpigui/src/main/native/cpp/wpigui_openurl.cpp | 2 +- .../native/directx11/wpigui_directx11.cpp | 3 +- .../cpp/driverstation/DriverStation.cpp | 2 +- .../src/main/native/cpp/hardware/bus/CAN.cpp | 2 +- .../src/main/native/cpp/hardware/bus/I2C.cpp | 2 +- .../native/cpp/hardware/bus/SerialPort.cpp | 2 +- .../cpp/hardware/discrete/AnalogInput.cpp | 2 +- .../main/native/cpp/hardware/discrete/PWM.cpp | 2 +- .../cpp/hardware/led/AddressableLED.cpp | 2 +- .../cpp/hardware/power/PowerDistribution.cpp | 2 +- .../cpp/hardware/rotation/DutyCycle.cpp | 2 +- .../native/cpp/hardware/rotation/Encoder.cpp | 2 +- .../src/main/native/cpp/system/Notifier.cpp | 2 +- .../main/native/cpp/system/SystemServer.cpp | 3 +- .../src/main/native/cpp/system/Threads.cpp | 2 +- wpilibc/src/test/native/cpp/AlertTest.cpp | 3 +- .../native/cpp/AnalogPotentiometerTest.cpp | 3 +- .../src/test/native/cpp/DriverStationTest.cpp | 3 +- .../src/test/native/cpp/GenericHIDTest.cpp | 3 +- wpilibc/src/test/native/cpp/JoystickTest.cpp | 2 +- .../src/test/native/cpp/LEDPatternTest.cpp | 3 +- wpilibc/src/test/native/cpp/NotifierTest.cpp | 3 +- .../src/test/native/cpp/PS4ControllerTest.cpp | 2 +- .../src/test/native/cpp/PS5ControllerTest.cpp | 2 +- .../src/test/native/cpp/ScopedTracerTest.cpp | 3 +- wpilibc/src/test/native/cpp/SharpIRTest.cpp | 3 +- .../src/test/native/cpp/TimedRobotTest.cpp | 2 +- wpilibc/src/test/native/cpp/TimerTest.cpp | 2 +- .../test/native/cpp/TimesliceRobotTest.cpp | 2 +- wpilibc/src/test/native/cpp/WatchdogTest.cpp | 2 +- .../test/native/cpp/XboxControllerTest.cpp | 2 +- .../cpp/drive/DifferentialDriveTest.cpp | 3 +- .../native/cpp/drive/MecanumDriveTest.cpp | 3 +- .../native/cpp/event/BooleanEventTest.cpp | 3 +- .../test/native/cpp/event/EventLoopTest.cpp | 3 +- .../cpp/event/NetworkBooleanEventTest.cpp | 3 +- .../cpp/simulation/AddressableLEDSimTest.cpp | 2 +- .../cpp/simulation/AnalogEncoderSimTest.cpp | 3 +- .../cpp/simulation/AnalogInputSimTest.cpp | 2 +- .../native/cpp/simulation/CTREPCMSimTest.cpp | 2 +- .../native/cpp/simulation/DCMotorSimTest.cpp | 3 +- .../test/native/cpp/simulation/DIOSimTest.cpp | 2 +- .../DifferentialDrivetrainSimTest.cpp | 3 +- .../cpp/simulation/DigitalPWMSimTest.cpp | 2 +- .../cpp/simulation/DriverStationSimTest.cpp | 3 +- .../simulation/DutyCycleEncoderSimTest.cpp | 2 +- .../cpp/simulation/DutyCycleSimTest.cpp | 2 +- .../native/cpp/simulation/ElevatorSimTest.cpp | 3 +- .../native/cpp/simulation/EncoderSimTest.cpp | 2 +- .../simulation/PWMMotorControlllerSimTest.cpp | 4 +- .../test/native/cpp/simulation/PWMSimTest.cpp | 2 +- ...mTest.cpp => PowerDistributionSimTest.cpp} | 2 +- .../native/cpp/simulation/REVPHSimTest.cpp | 2 +- .../native/cpp/simulation/RoboRioSimTest.cpp | 2 +- .../cpp/simulation/SimDeviceSimTest.cpp | 3 +- .../simulation/SingleJointedArmSimTest.cpp | 4 +- .../cpp/smartdashboard/Mechanism2dTest.cpp | 3 +- .../smartdashboard/SendableChooserTest.cpp | 3 +- .../test/native/cpp/util/Color8BitTest.cpp | 4 +- .../src/test/native/cpp/util/ColorTest.cpp | 4 +- wpilibcExamples/.styleguide | 6 -- .../UnitTest/cpp/subsystems/IntakeTest.cpp | 3 +- wpimath/.styleguide | 13 ---- .../include/wpi/math/geometry/Pose2d.hpp | 3 +- .../native/cpp/ComputerVisionUtilTest.cpp | 4 +- wpimath/src/test/native/cpp/DARETest.cpp | 3 +- wpimath/src/test/native/cpp/MathUtilTest.cpp | 3 +- .../test/native/cpp/StateSpaceUtilTest.cpp | 3 +- .../cpp/controller/ArmFeedforwardTest.cpp | 3 +- ...rolAffinePlantInversionFeedforwardTest.cpp | 3 +- ...fferentialDriveAccelerationLimiterTest.cpp | 3 +- .../DifferentialDriveFeedforwardTest.cpp | 3 +- .../controller/ElevatorFeedforwardTest.cpp | 3 +- .../controller/ImplicitModelFollowerTest.cpp | 3 +- .../LTVDifferentialDriveControllerTest.cpp | 3 +- .../controller/LTVUnicycleControllerTest.cpp | 3 +- .../LinearPlantInversionFeedforwardTest.cpp | 3 +- .../LinearQuadraticRegulatorTest.cpp | 3 +- .../controller/SimpleMotorFeedforwardTest.cpp | 3 +- .../proto/SimpleMotorFeedforwardProtoTest.cpp | 3 +- .../SimpleMotorFeedforwardStructTest.cpp | 3 +- .../cpp/estimator/AngleStatisticsTest.cpp | 3 +- .../DifferentialDrivePoseEstimator3dTest.cpp | 3 +- .../DifferentialDrivePoseEstimatorTest.cpp | 3 +- .../estimator/ExtendedKalmanFilterTest.cpp | 3 +- .../native/cpp/estimator/KalmanFilterTest.cpp | 3 +- .../MecanumDrivePoseEstimator3dTest.cpp | 3 +- .../MecanumDrivePoseEstimatorTest.cpp | 3 +- .../estimator/MerweScaledSigmaPointsTest.cpp | 4 +- .../native/cpp/estimator/MerweUKFTest.cpp | 3 +- .../cpp/estimator/S3SigmaPointsTest.cpp | 4 +- .../test/native/cpp/estimator/S3UKFTest.cpp | 3 +- .../SwerveDrivePoseEstimator3dTest.cpp | 3 +- .../SwerveDrivePoseEstimatorTest.cpp | 3 +- .../test/native/cpp/filter/DebouncerTest.cpp | 3 +- .../cpp/filter/LinearFilterNoiseTest.cpp | 4 +- .../cpp/filter/LinearFilterOutputTest.cpp | 4 +- .../native/cpp/filter/MedianFilterTest.cpp | 4 +- .../native/cpp/filter/SlewRateLimiterTest.cpp | 3 +- .../cpp/geometry/CoordinateSystemTest.cpp | 3 +- .../native/cpp/geometry/Ellipse2dTest.cpp | 4 +- .../test/native/cpp/geometry/Pose2dTest.cpp | 4 +- .../test/native/cpp/geometry/Pose3dTest.cpp | 3 +- .../native/cpp/geometry/QuaternionTest.cpp | 3 +- .../native/cpp/geometry/Rectangle2dTest.cpp | 4 +- .../native/cpp/geometry/Rotation2dTest.cpp | 4 +- .../native/cpp/geometry/Rotation3dTest.cpp | 3 +- .../native/cpp/geometry/Transform2dTest.cpp | 3 +- .../native/cpp/geometry/Transform3dTest.cpp | 3 +- .../native/cpp/geometry/Translation2dTest.cpp | 4 +- .../native/cpp/geometry/Translation3dTest.cpp | 4 +- .../TimeInterpolatableBufferTest.cpp | 3 +- .../cpp/kinematics/ChassisSpeedsTest.cpp | 4 +- .../DifferentialDriveKinematicsTest.cpp | 3 +- .../DifferentialDriveOdometry3dTest.cpp | 3 +- .../DifferentialDriveOdometryTest.cpp | 3 +- .../DifferentialDriveWheelSpeedsTest.cpp | 4 +- .../kinematics/MecanumDriveKinematicsTest.cpp | 3 +- .../kinematics/MecanumDriveOdometry3dTest.cpp | 3 +- .../kinematics/MecanumDriveOdometryTest.cpp | 3 +- .../MecanumDriveWheelSpeedsTest.cpp | 4 +- .../kinematics/SwerveDriveKinematicsTest.cpp | 3 +- .../kinematics/SwerveDriveOdometry3dTest.cpp | 3 +- .../kinematics/SwerveDriveOdometryTest.cpp | 3 +- .../kinematics/SwerveModulePositionTest.cpp | 3 +- .../cpp/kinematics/SwerveModuleStateTest.cpp | 3 +- .../proto/SwerveDriveKinematicsProtoTest.cpp | 3 +- .../SwerveDriveKinematicsStructTest.cpp | 3 +- .../optimization/SimulatedAnnealingTest.cpp | 4 +- .../native/cpp/path/TravelingSalesmanTest.cpp | 3 +- .../test/native/cpp/proto/MatrixProtoTest.cpp | 3 +- .../test/native/cpp/proto/VectorProtoTest.cpp | 3 +- .../cpp/spline/QuinticHermiteSplineTest.cpp | 3 +- .../native/cpp/struct/VectorStructTest.cpp | 3 +- .../native/cpp/system/DiscretizationTest.cpp | 3 +- ...ystemIDTest.cpp => LinearSystemIdTest.cpp} | 3 +- .../cpp/system/NumericalIntegrationTest.cpp | 3 +- .../cpp/system/NumericalJacobianTest.cpp | 4 +- .../system/proto/LinearSystemProtoTest.cpp | 3 +- .../system/struct/LinearSystemStructTest.cpp | 3 +- .../CentripetalAccelerationConstraintTest.cpp | 3 +- .../DifferentialDriveKinematicsTest.cpp | 3 +- .../EllipticalRegionConstraintTest.cpp | 3 +- .../cpp/trajectory/ExponentialProfileTest.cpp | 2 +- .../RectangularRegionConstraintTest.cpp | 3 +- .../trajectory/TrajectoryGeneratorTest.cpp | 3 +- .../cpp/trajectory/TrapezoidProfileTest.cpp | 2 +- wpinet/.styleguide | 6 -- wpinet/examples/dsclient/dsclient.cpp | 3 +- .../native/cpp/MulticastHandleManager.hpp | 2 + .../native/cpp/MulticastServiceAnnouncer.cpp | 2 + .../native/cpp/MulticastServiceResolver.cpp | 2 + wpinet/src/main/native/cpp/UDPClient.cpp | 4 +- wpinet/src/main/native/cpp/WebServer.cpp | 18 ++--- wpinet/src/main/native/cpp/uv/NameToAddr.cpp | 3 +- .../wpi/net/MulticastServiceAnnouncer.h | 13 ++++ .../wpi/net/MulticastServiceResolver.h | 19 ++++++ .../main/native/include/wpi/net/uv/Async.hpp | 4 +- .../include/wpi/net/uv/AsyncFunction.hpp | 3 +- .../main/native/include/wpi/net/uv/Buffer.hpp | 4 +- .../main/native/include/wpi/net/uv/Check.hpp | 4 +- .../native/include/wpi/net/uv/FsEvent.hpp | 4 +- .../native/include/wpi/net/uv/GetAddrInfo.hpp | 4 +- .../native/include/wpi/net/uv/GetNameInfo.hpp | 4 +- .../main/native/include/wpi/net/uv/Handle.hpp | 4 +- .../main/native/include/wpi/net/uv/Idle.hpp | 4 +- .../main/native/include/wpi/net/uv/Loop.hpp | 4 +- .../include/wpi/net/uv/NetworkStream.hpp | 4 +- .../main/native/include/wpi/net/uv/Pipe.hpp | 4 +- .../main/native/include/wpi/net/uv/Poll.hpp | 4 +- .../native/include/wpi/net/uv/Prepare.hpp | 4 +- .../native/include/wpi/net/uv/Process.hpp | 4 +- .../native/include/wpi/net/uv/Request.hpp | 4 +- .../main/native/include/wpi/net/uv/Signal.hpp | 4 +- .../main/native/include/wpi/net/uv/Stream.hpp | 4 +- .../main/native/include/wpi/net/uv/Tcp.hpp | 4 +- .../main/native/include/wpi/net/uv/Timer.hpp | 4 +- .../main/native/include/wpi/net/uv/Tty.hpp | 4 +- .../main/native/include/wpi/net/uv/Udp.hpp | 4 +- .../main/native/include/wpi/net/uv/Work.hpp | 4 +- .../main/native/include/wpi/net/uv/util.hpp | 4 +- wpinet/src/main/native/windows/DynamicDns.hpp | 3 +- wpinet/src/test/native/cpp/HttpParserTest.cpp | 2 +- wpinet/src/test/native/cpp/HttpUtilTest.cpp | 2 +- .../cpp/HttpWebSocketServerConnectionTest.cpp | 2 +- .../test/native/cpp/WebSocketClientTest.cpp | 4 +- .../native/cpp/WebSocketIntegrationTest.cpp | 4 +- .../native/cpp/WebSocketSerializerTest.cpp | 2 +- .../test/native/cpp/WebSocketServerTest.cpp | 4 +- wpinet/src/test/native/cpp/WebSocketTest.cpp | 5 +- .../src/test/native/cpp/WorkerThreadTest.cpp | 2 +- ...tream_test.cpp => raw_uv_ostream_test.cpp} | 10 +-- .../native/cpp/uv/UvAsyncFunctionTest.cpp | 4 +- wpinet/src/test/native/cpp/uv/UvAsyncTest.cpp | 4 +- .../src/test/native/cpp/uv/UvBufferTest.cpp | 4 +- .../test/native/cpp/uv/UvGetAddrInfoTest.cpp | 4 +- .../test/native/cpp/uv/UvGetNameInfoTest.cpp | 4 +- .../uv/{UvLoopWalkTest.cpp => UvLoopTest.cpp} | 4 +- wpinet/src/test/native/cpp/uv/UvTimerTest.cpp | 4 +- wpiutil/.styleguide | 8 --- .../src/main/native/cpp/MappedFileRegion.cpp | 7 +- wpiutil/src/main/native/cpp/RuntimeCheck.cpp | 2 +- wpiutil/src/main/native/cpp/string.cpp | 2 +- .../native/include/wpi/util/Synchronization.h | 3 +- wpiutil/src/main/native/unix/Demangle.cpp | 3 +- wpiutil/src/main/native/windows/Demangle.cpp | 3 +- wpiutil/src/test/native/cpp/ArrayTest.cpp | 4 +- wpiutil/src/test/native/cpp/Base64Test.cpp | 3 +- wpiutil/src/test/native/cpp/FastQueueTest.cpp | 4 +- .../src/test/native/cpp/StringExtrasTest.cpp | 4 +- wpiutil/src/test/native/cpp/StringMapTest.cpp | 2 +- .../test/native/cpp/SynchronizationTest.cpp | 2 +- wpiutil/src/test/native/cpp/UidVectorTest.cpp | 2 +- ...ufferTest.cpp => circular_buffer_test.cpp} | 2 +- .../src/test/native/cpp/ct_string_test.cpp | 2 +- .../test/native/cpp/expected/ExpectedTest.cpp | 4 +- wpiutil/src/test/native/cpp/future_test.cpp | 2 +- ...MapTest.cpp => interpolating_map_test.cpp} | 2 +- .../test/native/cpp/priority_mutex_test.cpp | 2 +- .../src/test/native/cpp/rotated_span_test.cpp | 18 ++--- .../cpp/{sha1Test.cpp => sha1_test.cpp} | 4 +- .../native/cpp/sigslot/function-traits.cpp | 4 +- .../src/test/native/cpp/sigslot/recursive.cpp | 4 +- .../native/cpp/sigslot/signal-extended.cpp | 4 +- .../native/cpp/sigslot/signal-threaded.cpp | 4 +- .../native/cpp/sigslot/signal-tracking.cpp | 4 +- .../src/test/native/cpp/sigslot/signal.cpp | 2 +- .../src/test/native/cpp/spinlock_bench.cpp | 2 +- ...st.cpp => static_circular_buffer_test.cpp} | 2 +- .../native/cpp/struct/DynamicStructTest.cpp | 2 +- .../native/cpp/struct/SchemaParserTest.cpp | 2 +- 321 files changed, 677 insertions(+), 628 deletions(-) rename wpilibc/src/test/native/cpp/simulation/{PDPSimTest.cpp => PowerDistributionSimTest.cpp} (97%) rename wpimath/src/test/native/cpp/system/{LinearSystemIDTest.cpp => LinearSystemIdTest.cpp} (99%) rename wpinet/src/test/native/cpp/{raw_uv_stream_test.cpp => raw_uv_ostream_test.cpp} (87%) rename wpinet/src/test/native/cpp/uv/{UvLoopWalkTest.cpp => UvLoopTest.cpp} (97%) rename wpiutil/src/test/native/cpp/{CircularBufferTest.cpp => circular_buffer_test.cpp} (98%) rename wpiutil/src/test/native/cpp/{InterpolatingMapTest.cpp => interpolating_map_test.cpp} (94%) rename wpiutil/src/test/native/cpp/{sha1Test.cpp => sha1_test.cpp} (100%) rename wpiutil/src/test/native/cpp/{StaticCircularBufferTest.cpp => static_circular_buffer_test.cpp} (97%) diff --git a/.clang-format b/.clang-format index d424ff940a..140923ec0d 100644 --- a/.clang-format +++ b/.clang-format @@ -104,25 +104,52 @@ ForEachMacros: - BOOST_FOREACH IfMacros: - KJ_IF_MAYBE -IncludeBlocks: Regroup +IncludeBlocks: Regroup IncludeCategories: - - Regex: '^' - Priority: 2 - SortPriority: 0 - CaseSensitive: false - - Regex: '^<.*\.h>' - Priority: 1 - SortPriority: 0 - CaseSensitive: false - - Regex: '^<.*' - Priority: 2 - SortPriority: 0 - CaseSensitive: false - - Regex: '.*' - Priority: 3 - SortPriority: 0 - CaseSensitive: false -IncludeIsMainRegex: '([-_](test|unittest))?$' + # C standard library headers + # + # https://en.cppreference.com/w/cpp/header: + # * C compatibility headers + # * Special C compatibility headers + # * Empty C headers + # * Meaningless C headers + # * Unsupported C headers + - Regex: '^<(assert\.h|ctype\.h|errno\.h|fenv\.h|float\.h|inttypes\.h|limits\.h|locale\.h|math\.h|setjmp\.h|signal\.h|stdarg\.h|stddef\.h|stdint\.h|stdio\.h|stdlib\.h|string\.h|time\.h|uchar\.h|wchar\.h|wctype\.h|stdatomic\.h|ccomplex|complex\.h|ctgmath|tgmath\.h|ciso646|cstdalign|cstdbool|iso646\.h|stdalign\.h|stdbool\.h|stdatomic\.h|stdnoreturn\.h|threads\.h)>' + Priority: 1 + SortPriority: 0 + # Linux system headers + - Regex: '^<((arpa\/|linux\/|net/|netinet\/|sys\/).*|arm_neon\.h|dirent\.h|dlfcn\.h|fcntl\.h|ifaddrs\.h|jni\.h|libgen\.h|poll\.h|spawn\.h|termios\.h|unistd\.h)>' + Priority: 1 + SortPriority: 1 + # winsock2.h + - Regex: '^' + Priority: 1 + SortPriority: 2 + # windows.h + - Regex: '^' + Priority: 1 + SortPriority: 3 + # Windows def.h headers + - Regex: '^<(comdef\.h|ws2def\.h|ws2ipdef\.h)>' + Priority: 1 + SortPriority: 4 + # Windows system headers + - Regex: '^<(dbghelp\.h|dbt\.h|delayimp\.h|dshow\.h|io\.h|iphlpapi\.h|ks\.h|ksmedia\.h|memoryapi\.h|mfapi\.h|mferror\.h|mfidl\.h|mfreadwrite\.h|netioapi\.h|shellapi\.h|shlwapi\.h|sysinfoapi\.h|windns\.h|windowsx\.h|ws2tcpip\.h)>' + Priority: 1 + SortPriority: 5 + # C++ standard library headers (lowercase and underscores with no .h suffix) + - Regex: '^<([a-z_]+|cxxabi\.h)>' + Priority: 2 + SortPriority: 6 + # Other library headers (angle brackets) + - Regex: '^<.*' + Priority: 3 + SortPriority: 7 + # Project headers (double quotes) + - Regex: '^".*' + Priority: 4 + SortPriority: 8 +IncludeIsMainRegex: '(Test|_bench|_test)?$' IncludeIsMainSourceRegex: '' IndentAccessModifiers: false IndentCaseBlocks: false @@ -213,7 +240,7 @@ RequiresClausePosition: OwnLine RequiresExpressionIndentation: OuterScope SeparateDefinitionBlocks: Leave ShortNamespaceLines: 1 -SortIncludes: false +SortIncludes: true SortJavaStaticImport: Before SortUsingDeclarations: LexicographicNumeric SpaceAfterCStyleCast: false diff --git a/.github/workflows/lint-format.yml b/.github/workflows/lint-format.yml index e615bf8d77..4a653c2756 100644 --- a/.github/workflows/lint-format.yml +++ b/.github/workflows/lint-format.yml @@ -28,7 +28,7 @@ jobs: - name: Fetch all history and metadata run: | git checkout -b pr - git branch -f main origin/main + git branch -f 2027 origin/2027 - name: Set up Python 3.12 uses: actions/setup-python@v5 with: @@ -36,9 +36,9 @@ jobs: - name: Install wpiformat run: | python -m venv ${{ runner.temp }}/wpiformat - ${{ runner.temp }}/wpiformat/bin/pip3 install wpiformat==2025.36 + ${{ runner.temp }}/wpiformat/bin/pip3 install wpiformat==2025.48 - name: Run - run: ${{ runner.temp }}/wpiformat/bin/wpiformat + run: ${{ runner.temp }}/wpiformat/bin/wpiformat -default-branch 2027 - name: Check output run: git --no-pager diff --exit-code HEAD - name: Generate diff @@ -70,7 +70,7 @@ jobs: run: | git config --global --add safe.directory /__w/allwpilib/allwpilib git checkout -b pr - git branch -f main origin/main + git branch -f 2027 origin/2027 - name: Set up Python 3.12 uses: actions/setup-python@v5 with: @@ -78,18 +78,18 @@ jobs: - name: Install wpiformat run: | python -m venv ${{ runner.temp }}/wpiformat - ${{ runner.temp }}/wpiformat/bin/pip3 install wpiformat==2025.36 + ${{ runner.temp }}/wpiformat/bin/pip3 install wpiformat==2025.48 - name: Create compile_commands.json run: | ./gradlew generateCompileCommands -Ptoolchain-optional-roboRio ./.github/workflows/fix_compile_commands.py build/TargetedCompileCommands/linuxx86-64release/compile_commands.json ./.github/workflows/fix_compile_commands.py build/TargetedCompileCommands/linuxx86-64debug/compile_commands.json - name: List changed files - run: ${{ runner.temp }}/wpiformat/bin/wpiformat -list-changed-files + run: ${{ runner.temp }}/wpiformat/bin/wpiformat -default-branch 2027 -list-changed-files - name: Run clang-tidy release - run: ${{ runner.temp }}/wpiformat/bin/wpiformat -no-format -tidy-changed -compile-commands=build/TargetedCompileCommands/linuxx86-64release + run: ${{ runner.temp }}/wpiformat/bin/wpiformat -default-branch 2027 -no-format -tidy-changed -compile-commands=build/TargetedCompileCommands/linuxx86-64release - name: Run clang-tidy debug - run: ${{ runner.temp }}/wpiformat/bin/wpiformat -no-format -tidy-changed -compile-commands=build/TargetedCompileCommands/linuxx86-64debug + run: ${{ runner.temp }}/wpiformat/bin/wpiformat -default-branch 2027 -no-format -tidy-changed -compile-commands=build/TargetedCompileCommands/linuxx86-64debug javaformat: name: "Java format" runs-on: ubuntu-24.04 @@ -103,7 +103,7 @@ jobs: run: | git config --global --add safe.directory /__w/allwpilib/allwpilib git checkout -b pr - git branch -f main origin/main + git branch -f 2027 origin/2027 - name: Run Java format run: ./gradlew javaFormat spotbugsMain spotbugsTest spotbugsDev - name: Check output diff --git a/.styleguide b/.styleguide index 71becc3ccf..0658c78717 100644 --- a/.styleguide +++ b/.styleguide @@ -35,21 +35,3 @@ generatedFileExclude { repoRootNameOverride { wpilib } - -includeOtherLibs { - ^Eigen/ - ^cameraserver/ - ^cscore - ^fmt/ - ^glass/ - ^gtest/ - ^imgui - ^implot - ^mockdata/ - ^opencv2/ - ^support/ - ^units/ - ^unsupported/ - ^upb/ - ^vision/ -} diff --git a/apriltag/src/main/native/cpp/jni/AprilTagJNI.cpp b/apriltag/src/main/native/cpp/jni/AprilTagJNI.cpp index b47c9ef5d6..3ce8e7bf8c 100644 --- a/apriltag/src/main/native/cpp/jni/AprilTagJNI.cpp +++ b/apriltag/src/main/native/cpp/jni/AprilTagJNI.cpp @@ -8,13 +8,12 @@ #include #define WPI_RAWFRAME_JNI -#include "wpi/util/RawFrame.h" -#include "wpi/util/jni_util.hpp" - #include "org_wpilib_vision_apriltag_jni_AprilTagJNI.h" #include "wpi/apriltag/AprilTag.hpp" #include "wpi/apriltag/AprilTagDetector.hpp" #include "wpi/apriltag/AprilTagPoseEstimator.hpp" +#include "wpi/util/RawFrame.h" +#include "wpi/util/jni_util.hpp" using namespace wpi::apriltag; using namespace wpi::util::java; diff --git a/apriltag/src/test/native/cpp/AprilTagDetectorTest.cpp b/apriltag/src/test/native/cpp/AprilTagDetectorTest.cpp index 365e72dc57..c868c6d6a0 100644 --- a/apriltag/src/test/native/cpp/AprilTagDetectorTest.cpp +++ b/apriltag/src/test/native/cpp/AprilTagDetectorTest.cpp @@ -2,10 +2,10 @@ // 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 - #include "wpi/apriltag/AprilTagDetector.hpp" +#include + using namespace wpi::apriltag; TEST(AprilTagDetectorTest, ConfigDefaults) { diff --git a/benchmark/src/main/native/cpp/CartPoleBenchmark.hpp b/benchmark/src/main/native/cpp/CartPoleBenchmark.hpp index 8ff790f8cd..ab07064f8b 100644 --- a/benchmark/src/main/native/cpp/CartPoleBenchmark.hpp +++ b/benchmark/src/main/native/cpp/CartPoleBenchmark.hpp @@ -4,10 +4,9 @@ #pragma once -#include - #include +#include #include #include "wpi/math/system/NumericalIntegration.hpp" diff --git a/cameraserver/.styleguide b/cameraserver/.styleguide index db5b6737b8..241bcd0f19 100644 --- a/cameraserver/.styleguide +++ b/cameraserver/.styleguide @@ -12,13 +12,6 @@ repoRootNameOverride { cameraserver } -includeOtherLibs { - ^fmt/ - ^gtest/ - ^opencv2/ - ^support/ -} - includeGuardRoots { cameraserver/src/main/native/include/ } diff --git a/commandsv2/.styleguide b/commandsv2/.styleguide index 0198969b56..2c9b469246 100644 --- a/commandsv2/.styleguide +++ b/commandsv2/.styleguide @@ -15,14 +15,3 @@ repoRootNameOverride { generatedFileExclude { commandsv2/src/generated/ } - -includeOtherLibs { - ^gtest/ - ^imgui - ^mockdata/ - ^networktables/ - ^opencv2/ - ^support/ - ^units/ - ^vision/ -} diff --git a/commandsv2/src/main/native/cpp/frc2/command/ProxyCommand.cpp b/commandsv2/src/main/native/cpp/frc2/command/ProxyCommand.cpp index e51a1633e5..eced9d2f48 100644 --- a/commandsv2/src/main/native/cpp/frc2/command/ProxyCommand.cpp +++ b/commandsv2/src/main/native/cpp/frc2/command/ProxyCommand.cpp @@ -4,11 +4,11 @@ #include "wpi/commands2/ProxyCommand.hpp" -#include - #include #include +#include + #include "wpi/util/deprecated.hpp" #include "wpi/util/sendable/SendableBuilder.hpp" diff --git a/commandsv2/src/test/native/cpp/wpi/command/CommandPtrTest.cpp b/commandsv2/src/test/native/cpp/wpi/command/CommandPtrTest.cpp index c9b0761250..b6e388dcae 100644 --- a/commandsv2/src/test/native/cpp/wpi/command/CommandPtrTest.cpp +++ b/commandsv2/src/test/native/cpp/wpi/command/CommandPtrTest.cpp @@ -2,10 +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 "wpi/commands2/CommandPtr.hpp" + #include #include "CommandTestBase.hpp" -#include "wpi/commands2/CommandPtr.hpp" #include "wpi/commands2/CommandScheduler.hpp" #include "wpi/commands2/Commands.hpp" #include "wpi/system/Errors.hpp" diff --git a/commandsv2/src/test/native/cpp/wpi/command/ConditionalCommandTest.cpp b/commandsv2/src/test/native/cpp/wpi/command/ConditionalCommandTest.cpp index 12555f4ab5..59eeaa462d 100644 --- a/commandsv2/src/test/native/cpp/wpi/command/ConditionalCommandTest.cpp +++ b/commandsv2/src/test/native/cpp/wpi/command/ConditionalCommandTest.cpp @@ -2,12 +2,13 @@ // 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/commands2/ConditionalCommand.hpp" + #include #include #include "CommandTestBase.hpp" #include "wpi/commands2/Commands.hpp" -#include "wpi/commands2/ConditionalCommand.hpp" #include "wpi/commands2/InstantCommand.hpp" using namespace wpi::cmd; diff --git a/commandsv2/src/test/native/cpp/wpi/command/DeferredCommandTest.cpp b/commandsv2/src/test/native/cpp/wpi/command/DeferredCommandTest.cpp index 62457e694f..65f48d477b 100644 --- a/commandsv2/src/test/native/cpp/wpi/command/DeferredCommandTest.cpp +++ b/commandsv2/src/test/native/cpp/wpi/command/DeferredCommandTest.cpp @@ -2,9 +2,10 @@ // 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/commands2/DeferredCommand.hpp" + #include "CommandTestBase.hpp" #include "wpi/commands2/Commands.hpp" -#include "wpi/commands2/DeferredCommand.hpp" #include "wpi/commands2/FunctionalCommand.hpp" using namespace wpi::cmd; diff --git a/commandsv2/src/test/native/cpp/wpi/command/FunctionalCommandTest.cpp b/commandsv2/src/test/native/cpp/wpi/command/FunctionalCommandTest.cpp index b5852e7073..344035629b 100644 --- a/commandsv2/src/test/native/cpp/wpi/command/FunctionalCommandTest.cpp +++ b/commandsv2/src/test/native/cpp/wpi/command/FunctionalCommandTest.cpp @@ -2,9 +2,10 @@ // 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 "CommandTestBase.hpp" #include "wpi/commands2/FunctionalCommand.hpp" +#include "CommandTestBase.hpp" + using namespace wpi::cmd; class FunctionalCommandTest : public CommandTestBase {}; diff --git a/commandsv2/src/test/native/cpp/wpi/command/InstantCommandTest.cpp b/commandsv2/src/test/native/cpp/wpi/command/InstantCommandTest.cpp index 24b3a01c30..ac80f69ffa 100644 --- a/commandsv2/src/test/native/cpp/wpi/command/InstantCommandTest.cpp +++ b/commandsv2/src/test/native/cpp/wpi/command/InstantCommandTest.cpp @@ -2,9 +2,10 @@ // 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/commands2/InstantCommand.hpp" + #include "CommandTestBase.hpp" #include "wpi/commands2/Commands.hpp" -#include "wpi/commands2/InstantCommand.hpp" using namespace wpi::cmd; class InstantCommandTest : public CommandTestBase {}; diff --git a/commandsv2/src/test/native/cpp/wpi/command/NotifierCommandTest.cpp b/commandsv2/src/test/native/cpp/wpi/command/NotifierCommandTest.cpp index 5597093439..7a5eec8d44 100644 --- a/commandsv2/src/test/native/cpp/wpi/command/NotifierCommandTest.cpp +++ b/commandsv2/src/test/native/cpp/wpi/command/NotifierCommandTest.cpp @@ -2,8 +2,9 @@ // 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 "CommandTestBase.hpp" #include "wpi/commands2/NotifierCommand.hpp" + +#include "CommandTestBase.hpp" #include "wpi/simulation/SimHooks.hpp" using namespace wpi::cmd; diff --git a/commandsv2/src/test/native/cpp/wpi/command/POVButtonTest.cpp b/commandsv2/src/test/native/cpp/wpi/command/POVButtonTest.cpp index 01f4cc4086..1a2a58ecd6 100644 --- a/commandsv2/src/test/native/cpp/wpi/command/POVButtonTest.cpp +++ b/commandsv2/src/test/native/cpp/wpi/command/POVButtonTest.cpp @@ -2,13 +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 "wpi/commands2/button/POVButton.hpp" + #include #include "CommandTestBase.hpp" #include "wpi/commands2/CommandScheduler.hpp" #include "wpi/commands2/RunCommand.hpp" #include "wpi/commands2/WaitUntilCommand.hpp" -#include "wpi/commands2/button/POVButton.hpp" #include "wpi/driverstation/DriverStation.hpp" #include "wpi/driverstation/Joystick.hpp" #include "wpi/simulation/JoystickSim.hpp" diff --git a/commandsv2/src/test/native/cpp/wpi/command/ParallelCommandGroupTest.cpp b/commandsv2/src/test/native/cpp/wpi/command/ParallelCommandGroupTest.cpp index 9eaec16cd0..eb52bf45ad 100644 --- a/commandsv2/src/test/native/cpp/wpi/command/ParallelCommandGroupTest.cpp +++ b/commandsv2/src/test/native/cpp/wpi/command/ParallelCommandGroupTest.cpp @@ -2,13 +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 "wpi/commands2/ParallelCommandGroup.hpp" + #include #include #include "CommandTestBase.hpp" #include "CompositionTestBase.hpp" #include "wpi/commands2/InstantCommand.hpp" -#include "wpi/commands2/ParallelCommandGroup.hpp" #include "wpi/commands2/WaitUntilCommand.hpp" using namespace wpi::cmd; diff --git a/commandsv2/src/test/native/cpp/wpi/command/ParallelDeadlineGroupTest.cpp b/commandsv2/src/test/native/cpp/wpi/command/ParallelDeadlineGroupTest.cpp index a74e7c1cdb..4edbaef6a5 100644 --- a/commandsv2/src/test/native/cpp/wpi/command/ParallelDeadlineGroupTest.cpp +++ b/commandsv2/src/test/native/cpp/wpi/command/ParallelDeadlineGroupTest.cpp @@ -2,6 +2,8 @@ // 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/commands2/ParallelDeadlineGroup.hpp" + #include #include #include @@ -9,7 +11,6 @@ #include "CommandTestBase.hpp" #include "CompositionTestBase.hpp" #include "wpi/commands2/InstantCommand.hpp" -#include "wpi/commands2/ParallelDeadlineGroup.hpp" #include "wpi/commands2/WaitUntilCommand.hpp" using namespace wpi::cmd; diff --git a/commandsv2/src/test/native/cpp/wpi/command/ParallelRaceGroupTest.cpp b/commandsv2/src/test/native/cpp/wpi/command/ParallelRaceGroupTest.cpp index 8c0343d2e6..bcf12bbb73 100644 --- a/commandsv2/src/test/native/cpp/wpi/command/ParallelRaceGroupTest.cpp +++ b/commandsv2/src/test/native/cpp/wpi/command/ParallelRaceGroupTest.cpp @@ -2,13 +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 "wpi/commands2/ParallelRaceGroup.hpp" + #include #include #include "CommandTestBase.hpp" #include "CompositionTestBase.hpp" #include "wpi/commands2/InstantCommand.hpp" -#include "wpi/commands2/ParallelRaceGroup.hpp" #include "wpi/commands2/SequentialCommandGroup.hpp" #include "wpi/commands2/WaitUntilCommand.hpp" diff --git a/commandsv2/src/test/native/cpp/wpi/command/PrintCommandTest.cpp b/commandsv2/src/test/native/cpp/wpi/command/PrintCommandTest.cpp index 0d8ca526b3..1773db64df 100644 --- a/commandsv2/src/test/native/cpp/wpi/command/PrintCommandTest.cpp +++ b/commandsv2/src/test/native/cpp/wpi/command/PrintCommandTest.cpp @@ -2,11 +2,12 @@ // 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/commands2/PrintCommand.hpp" + #include #include "CommandTestBase.hpp" #include "wpi/commands2/Commands.hpp" -#include "wpi/commands2/PrintCommand.hpp" using namespace wpi::cmd; class PrintCommandTest : public CommandTestBase {}; diff --git a/commandsv2/src/test/native/cpp/wpi/command/ProxyCommandTest.cpp b/commandsv2/src/test/native/cpp/wpi/command/ProxyCommandTest.cpp index 214a4ba2e8..4efa04f5a2 100644 --- a/commandsv2/src/test/native/cpp/wpi/command/ProxyCommandTest.cpp +++ b/commandsv2/src/test/native/cpp/wpi/command/ProxyCommandTest.cpp @@ -2,13 +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 "wpi/commands2/ProxyCommand.hpp" + #include #include "CommandTestBase.hpp" #include "wpi/commands2/CommandPtr.hpp" #include "wpi/commands2/Commands.hpp" #include "wpi/commands2/InstantCommand.hpp" -#include "wpi/commands2/ProxyCommand.hpp" #include "wpi/commands2/WaitUntilCommand.hpp" using namespace wpi::cmd; diff --git a/commandsv2/src/test/native/cpp/wpi/command/RepeatCommandTest.cpp b/commandsv2/src/test/native/cpp/wpi/command/RepeatCommandTest.cpp index 1504ef0c30..e4acfe84f6 100644 --- a/commandsv2/src/test/native/cpp/wpi/command/RepeatCommandTest.cpp +++ b/commandsv2/src/test/native/cpp/wpi/command/RepeatCommandTest.cpp @@ -2,10 +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 "wpi/commands2/RepeatCommand.hpp" + #include "CommandTestBase.hpp" #include "CompositionTestBase.hpp" #include "wpi/commands2/FunctionalCommand.hpp" -#include "wpi/commands2/RepeatCommand.hpp" using namespace wpi::cmd; class RepeatCommandTest : public CommandTestBase {}; diff --git a/commandsv2/src/test/native/cpp/wpi/command/RunCommandTest.cpp b/commandsv2/src/test/native/cpp/wpi/command/RunCommandTest.cpp index 6da6204d55..ef7fa767e1 100644 --- a/commandsv2/src/test/native/cpp/wpi/command/RunCommandTest.cpp +++ b/commandsv2/src/test/native/cpp/wpi/command/RunCommandTest.cpp @@ -2,9 +2,10 @@ // 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/commands2/RunCommand.hpp" + #include "CommandTestBase.hpp" #include "wpi/commands2/Commands.hpp" -#include "wpi/commands2/RunCommand.hpp" using namespace wpi::cmd; class RunCommandTest : public CommandTestBase {}; diff --git a/commandsv2/src/test/native/cpp/wpi/command/ScheduleCommandTest.cpp b/commandsv2/src/test/native/cpp/wpi/command/ScheduleCommandTest.cpp index 2121a5056c..0d5a0c1837 100644 --- a/commandsv2/src/test/native/cpp/wpi/command/ScheduleCommandTest.cpp +++ b/commandsv2/src/test/native/cpp/wpi/command/ScheduleCommandTest.cpp @@ -2,11 +2,12 @@ // 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/commands2/ScheduleCommand.hpp" + #include #include "CommandTestBase.hpp" #include "wpi/commands2/InstantCommand.hpp" -#include "wpi/commands2/ScheduleCommand.hpp" #include "wpi/commands2/SequentialCommandGroup.hpp" using namespace wpi::cmd; diff --git a/commandsv2/src/test/native/cpp/wpi/command/SelectCommandTest.cpp b/commandsv2/src/test/native/cpp/wpi/command/SelectCommandTest.cpp index 406267ba0e..8e9f1c41f4 100644 --- a/commandsv2/src/test/native/cpp/wpi/command/SelectCommandTest.cpp +++ b/commandsv2/src/test/native/cpp/wpi/command/SelectCommandTest.cpp @@ -2,6 +2,8 @@ // 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/commands2/SelectCommand.hpp" + #include #include #include @@ -9,7 +11,6 @@ #include "CommandTestBase.hpp" #include "CompositionTestBase.hpp" #include "wpi/commands2/InstantCommand.hpp" -#include "wpi/commands2/SelectCommand.hpp" using namespace wpi::cmd; class SelectCommandTest : public CommandTestBase {}; diff --git a/commandsv2/src/test/native/cpp/wpi/command/SequentialCommandGroupTest.cpp b/commandsv2/src/test/native/cpp/wpi/command/SequentialCommandGroupTest.cpp index dcd69bf048..691bc44ba4 100644 --- a/commandsv2/src/test/native/cpp/wpi/command/SequentialCommandGroupTest.cpp +++ b/commandsv2/src/test/native/cpp/wpi/command/SequentialCommandGroupTest.cpp @@ -2,13 +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 "wpi/commands2/SequentialCommandGroup.hpp" + #include #include #include "CommandTestBase.hpp" #include "CompositionTestBase.hpp" #include "wpi/commands2/InstantCommand.hpp" -#include "wpi/commands2/SequentialCommandGroup.hpp" #include "wpi/commands2/WaitUntilCommand.hpp" using namespace wpi::cmd; diff --git a/commandsv2/src/test/native/cpp/wpi/command/StartEndCommandTest.cpp b/commandsv2/src/test/native/cpp/wpi/command/StartEndCommandTest.cpp index 6e1ce9b46f..11d291e4b7 100644 --- a/commandsv2/src/test/native/cpp/wpi/command/StartEndCommandTest.cpp +++ b/commandsv2/src/test/native/cpp/wpi/command/StartEndCommandTest.cpp @@ -2,9 +2,10 @@ // 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/commands2/StartEndCommand.hpp" + #include "CommandTestBase.hpp" #include "wpi/commands2/Commands.hpp" -#include "wpi/commands2/StartEndCommand.hpp" using namespace wpi::cmd; class StartEndCommandTest : public CommandTestBase {}; diff --git a/commandsv2/src/test/native/cpp/wpi/command/WaitCommandTest.cpp b/commandsv2/src/test/native/cpp/wpi/command/WaitCommandTest.cpp index 2b59dfcdb4..ced6ba08ff 100644 --- a/commandsv2/src/test/native/cpp/wpi/command/WaitCommandTest.cpp +++ b/commandsv2/src/test/native/cpp/wpi/command/WaitCommandTest.cpp @@ -2,9 +2,10 @@ // 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/commands2/WaitCommand.hpp" + #include "CommandTestBase.hpp" #include "wpi/commands2/Commands.hpp" -#include "wpi/commands2/WaitCommand.hpp" #include "wpi/commands2/WaitUntilCommand.hpp" #include "wpi/simulation/SimHooks.hpp" diff --git a/commandsv2/src/test/native/cpp/wpi/command/WaitUntilCommandTest.cpp b/commandsv2/src/test/native/cpp/wpi/command/WaitUntilCommandTest.cpp index 3f2cf88a08..4f9a18a0ca 100644 --- a/commandsv2/src/test/native/cpp/wpi/command/WaitUntilCommandTest.cpp +++ b/commandsv2/src/test/native/cpp/wpi/command/WaitUntilCommandTest.cpp @@ -2,9 +2,10 @@ // 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/commands2/WaitUntilCommand.hpp" + #include "CommandTestBase.hpp" #include "wpi/commands2/Commands.hpp" -#include "wpi/commands2/WaitUntilCommand.hpp" using namespace wpi::cmd; class WaitUntilCommandTest : public CommandTestBase {}; diff --git a/commandsv2/src/test/native/cpp/wpi/command/button/NetworkButtonTest.cpp b/commandsv2/src/test/native/cpp/wpi/command/button/NetworkButtonTest.cpp index b925e44100..f5ea250104 100644 --- a/commandsv2/src/test/native/cpp/wpi/command/button/NetworkButtonTest.cpp +++ b/commandsv2/src/test/native/cpp/wpi/command/button/NetworkButtonTest.cpp @@ -2,13 +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 "wpi/commands2/button/NetworkButton.hpp" + #include #include "../CommandTestBase.hpp" #include "wpi/commands2/CommandScheduler.hpp" #include "wpi/commands2/RunCommand.hpp" #include "wpi/commands2/WaitUntilCommand.hpp" -#include "wpi/commands2/button/NetworkButton.hpp" #include "wpi/nt/NetworkTableInstance.hpp" using namespace wpi::cmd; diff --git a/commandsv2/src/test/native/cpp/wpi/command/button/RobotModeTriggersTest.cpp b/commandsv2/src/test/native/cpp/wpi/command/button/RobotModeTriggersTest.cpp index b23ffa3e03..d58d945b52 100644 --- a/commandsv2/src/test/native/cpp/wpi/command/button/RobotModeTriggersTest.cpp +++ b/commandsv2/src/test/native/cpp/wpi/command/button/RobotModeTriggersTest.cpp @@ -2,8 +2,9 @@ // 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 "../CommandTestBase.hpp" #include "wpi/commands2/button/RobotModeTriggers.hpp" + +#include "../CommandTestBase.hpp" #include "wpi/commands2/button/Trigger.hpp" #include "wpi/driverstation/DriverStation.hpp" #include "wpi/simulation/DriverStationSim.hpp" diff --git a/commandsv2/src/test/native/cpp/wpi/command/button/TriggerTest.cpp b/commandsv2/src/test/native/cpp/wpi/command/button/TriggerTest.cpp index 3792d34602..3cb74c224a 100644 --- a/commandsv2/src/test/native/cpp/wpi/command/button/TriggerTest.cpp +++ b/commandsv2/src/test/native/cpp/wpi/command/button/TriggerTest.cpp @@ -2,6 +2,8 @@ // 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/commands2/button/Trigger.hpp" + #include #include @@ -12,7 +14,6 @@ #include "wpi/commands2/Commands.hpp" #include "wpi/commands2/RunCommand.hpp" #include "wpi/commands2/WaitUntilCommand.hpp" -#include "wpi/commands2/button/Trigger.hpp" #include "wpi/simulation/SimHooks.hpp" using namespace wpi::cmd; diff --git a/commandsv2/src/test/native/cpp/wpi/command/sysid/SysIdRoutineTest.cpp b/commandsv2/src/test/native/cpp/wpi/command/sysid/SysIdRoutineTest.cpp index 6e9c79b463..3dace6f3d0 100644 --- a/commandsv2/src/test/native/cpp/wpi/command/sysid/SysIdRoutineTest.cpp +++ b/commandsv2/src/test/native/cpp/wpi/command/sysid/SysIdRoutineTest.cpp @@ -2,13 +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 "wpi/commands2/sysid/SysIdRoutine.hpp" + #include #include #include #include "wpi/commands2/Subsystem.hpp" -#include "wpi/commands2/sysid/SysIdRoutine.hpp" #include "wpi/simulation/SimHooks.hpp" #include "wpi/system/Timer.hpp" #include "wpi/units/math.hpp" diff --git a/cscore/.styleguide b/cscore/.styleguide index e92a14b205..30e1e912df 100644 --- a/cscore/.styleguide +++ b/cscore/.styleguide @@ -33,12 +33,3 @@ includeGuardRoots { repoRootNameOverride { cscore } - -includeOtherLibs { - ^fmt/ - ^gtest/ - ^opencv2/ - ^imgui - ^support/ - ^tcpsockets/ -} diff --git a/cscore/src/main/native/cpp/UsbCameraImplCommon.cpp b/cscore/src/main/native/cpp/UsbCameraImplCommon.cpp index 9d4b8cdafc..bd521e67fe 100644 --- a/cscore/src/main/native/cpp/UsbCameraImplCommon.cpp +++ b/cscore/src/main/native/cpp/UsbCameraImplCommon.cpp @@ -2,7 +2,9 @@ // 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/cs/cscore_c.h" // NOLINT(build/include_order) +// clang-format off +#include "wpi/cs/cscore_c.h" +// clang-format on #include "c_util.hpp" #include "wpi/cs/cscore_cpp.hpp" diff --git a/cscore/src/main/native/cpp/jni/CameraServerJNI.cpp b/cscore/src/main/native/cpp/jni/CameraServerJNI.cpp index 15b6a5114b..347da052fd 100644 --- a/cscore/src/main/native/cpp/jni/CameraServerJNI.cpp +++ b/cscore/src/main/native/cpp/jni/CameraServerJNI.cpp @@ -9,14 +9,13 @@ #include #define WPI_RAWFRAME_JNI +#include "org_wpilib_vision_camera_CameraServerJNI.h" +#include "wpi/cs/cscore_raw.h" +#include "wpi/cs/cscore_runloop.hpp" #include "wpi/util/RawFrame.h" #include "wpi/util/SmallString.hpp" #include "wpi/util/jni_util.hpp" -#include "wpi/cs/cscore_raw.h" -#include "wpi/cs/cscore_runloop.hpp" -#include "org_wpilib_vision_camera_CameraServerJNI.h" - namespace cv { class Mat; } // namespace cv diff --git a/cscore/src/main/native/linux/NetworkUtil.cpp b/cscore/src/main/native/linux/NetworkUtil.cpp index 160ab4458c..6cbdbd7bef 100644 --- a/cscore/src/main/native/linux/NetworkUtil.cpp +++ b/cscore/src/main/native/linux/NetworkUtil.cpp @@ -2,7 +2,9 @@ // 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/cs/cscore_cpp.hpp" // NOLINT(build/include_order) +// clang-format off +#include "wpi/cs/cscore_cpp.hpp" +// clang-format on #include #include diff --git a/cscore/src/main/native/windows/COMCreators.cpp b/cscore/src/main/native/windows/COMCreators.cpp index eefea1b94b..a3054c7076 100644 --- a/cscore/src/main/native/windows/COMCreators.cpp +++ b/cscore/src/main/native/windows/COMCreators.cpp @@ -2,13 +2,12 @@ // 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 #include #include #include #include -#include - #include "UsbCameraImpl.hpp" // https://github.com/opencv/opencv/blob/master/modules/videoio/src/cap_msmf.cpp diff --git a/cscore/src/main/native/windows/NetworkListener.cpp b/cscore/src/main/native/windows/NetworkListener.cpp index 51424830d2..6e319aafde 100644 --- a/cscore/src/main/native/windows/NetworkListener.cpp +++ b/cscore/src/main/native/windows/NetworkListener.cpp @@ -4,17 +4,12 @@ #include "NetworkListener.hpp" -#include // NOLINT(build/include_order) - -#include // NOLINT(build/include_order) - -#include // NOLINT(build/include_order) - -#include // NOLINT(build/include_order) - -#include // NOLINT(build/include_order) - -#include // NOLINT(build/include_order) +#include +#include +#include +#include +#include +#include #include "Instance.hpp" #include "Log.hpp" diff --git a/cscore/src/main/native/windows/NetworkUtil.cpp b/cscore/src/main/native/windows/NetworkUtil.cpp index ac7b561cc1..eb438cca86 100644 --- a/cscore/src/main/native/windows/NetworkUtil.cpp +++ b/cscore/src/main/native/windows/NetworkUtil.cpp @@ -2,12 +2,13 @@ // 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 #include #include #include +#include + #include "wpi/cs/cscore_cpp.hpp" #pragma comment(lib, "Ws2_32.lib") diff --git a/cscore/src/main/native/windows/UsbCameraImpl.cpp b/cscore/src/main/native/windows/UsbCameraImpl.cpp index 60ed6b84bb..474af4830a 100644 --- a/cscore/src/main/native/windows/UsbCameraImpl.cpp +++ b/cscore/src/main/native/windows/UsbCameraImpl.cpp @@ -5,6 +5,9 @@ #define _WINSOCKAPI_ #include "UsbCameraImpl.hpp" +#include +#include +#include #include #include #include @@ -19,10 +22,6 @@ #include #include -#include -#include -#include - #include "COMCreators.hpp" #include "ComPtr.hpp" #include "Handle.hpp" diff --git a/cscore/src/main/native/windows/UsbCameraImpl.hpp b/cscore/src/main/native/windows/UsbCameraImpl.hpp index ff040b7e9f..2192e39593 100644 --- a/cscore/src/main/native/windows/UsbCameraImpl.hpp +++ b/cscore/src/main/native/windows/UsbCameraImpl.hpp @@ -5,14 +5,14 @@ #ifndef CSCORE_USBCAMERAIMPL_HPP_ #define CSCORE_USBCAMERAIMPL_HPP_ +#include +#include +#include +#include #include #include #include -#include // NOLINT(build/include_order) - -#include // NOLINT(build/include_order) - #include #include #include @@ -21,8 +21,6 @@ #include #include -#include - #include "COMCreators.hpp" #include "ComPtr.hpp" #include "SourceImpl.hpp" diff --git a/cscore/src/main/native/windows/UsbCameraListener.cpp b/cscore/src/main/native/windows/UsbCameraListener.cpp index fdd2cf42f5..cfa3d6866c 100644 --- a/cscore/src/main/native/windows/UsbCameraListener.cpp +++ b/cscore/src/main/native/windows/UsbCameraListener.cpp @@ -4,13 +4,14 @@ #include "UsbCameraListener.hpp" -#include "Notifier.hpp" -#include "WindowsMessagePump.hpp" - -#include // NOLINT(build/include_order) +#include +#include #include +#include "Notifier.hpp" +#include "WindowsMessagePump.hpp" + #define IDT_TIMER1 1001 using namespace wpi::cs; diff --git a/cscore/src/main/native/windows/UsbCameraProperty.hpp b/cscore/src/main/native/windows/UsbCameraProperty.hpp index f5e1b5227e..6274e6e017 100644 --- a/cscore/src/main/native/windows/UsbCameraProperty.hpp +++ b/cscore/src/main/native/windows/UsbCameraProperty.hpp @@ -4,6 +4,7 @@ #pragma once +#include #include #include #include @@ -11,8 +12,6 @@ #include #include -#include - #include "PropertyImpl.hpp" #include "wpi/util/mutex.hpp" diff --git a/cscore/src/main/native/windows/WindowsMessagePump.cpp b/cscore/src/main/native/windows/WindowsMessagePump.cpp index 3f0d93ff60..174a21f675 100644 --- a/cscore/src/main/native/windows/WindowsMessagePump.cpp +++ b/cscore/src/main/native/windows/WindowsMessagePump.cpp @@ -4,17 +4,16 @@ #include "WindowsMessagePump.hpp" +#include +#include #include #include #include #include -#include #include #include -#include - #pragma comment(lib, "Mfplat.lib") #pragma comment(lib, "Mf.lib") #pragma comment(lib, "mfuuid.lib") diff --git a/datalog/.styleguide b/datalog/.styleguide index 91b25b9cc5..317db43e1f 100644 --- a/datalog/.styleguide +++ b/datalog/.styleguide @@ -23,9 +23,3 @@ modifiableFileExclude { repoRootNameOverride { datalog } - -includeOtherLibs { - ^fmt/ - ^gtest/ - ^upb/ -} diff --git a/datalog/src/main/native/cpp/DataLogBackgroundWriter.cpp b/datalog/src/main/native/cpp/DataLogBackgroundWriter.cpp index 1ae973e7d5..811a0457aa 100644 --- a/datalog/src/main/native/cpp/DataLogBackgroundWriter.cpp +++ b/datalog/src/main/native/cpp/DataLogBackgroundWriter.cpp @@ -13,7 +13,7 @@ #define WIN32_LEAN_AND_MEAN #endif -#include // NOLINT(build/include_order) +#include #endif diff --git a/datalog/src/main/native/include/wpi/datalog/DataLog_c.h b/datalog/src/main/native/include/wpi/datalog/DataLog_c.h index d3f4f4e18b..b5e8a11236 100644 --- a/datalog/src/main/native/include/wpi/datalog/DataLog_c.h +++ b/datalog/src/main/native/include/wpi/datalog/DataLog_c.h @@ -4,8 +4,7 @@ #pragma once -#include // NOLINT - +#include #include #include "wpi/util/string.h" diff --git a/datalog/src/test/native/cpp/FileLoggerTest.cpp b/datalog/src/test/native/cpp/FileLoggerTest.cpp index a043718e95..23e8716213 100644 --- a/datalog/src/test/native/cpp/FileLoggerTest.cpp +++ b/datalog/src/test/native/cpp/FileLoggerTest.cpp @@ -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 "wpi/datalog/FileLogger.hpp" + #include #include #include #include -#include "wpi/datalog/FileLogger.hpp" - TEST(FileLoggerTest, BufferSingleLine) { std::vector buf; auto func = wpi::log::FileLogger::Buffer( diff --git a/glass/.styleguide b/glass/.styleguide index bb70965dc0..3be6b4f48f 100644 --- a/glass/.styleguide +++ b/glass/.styleguide @@ -18,15 +18,3 @@ generatedFileExclude { repoRootNameOverride { glass } - -includeOtherLibs { - ^GLFW - ^fmt/ - ^imgui - ^upb/ -} - -includeProject { - wpi/gui/portable-file-dialogs.h - wpi/util/expected -} diff --git a/glass/src/app/native/cpp/camerasupport.cpp b/glass/src/app/native/cpp/camerasupport.cpp index 1c284a1438..215ea075b6 100644 --- a/glass/src/app/native/cpp/camerasupport.cpp +++ b/glass/src/app/native/cpp/camerasupport.cpp @@ -5,9 +5,12 @@ #include "camerasupport.hpp" #ifdef _WIN32 -#include "Windows.h" -#include "delayimp.h" + +#include +#include + #pragma comment(lib, "delayimp.lib") + static int CheckDelayException(int exception_value) { if (exception_value == VcppException(ERROR_SEVERITY_ERROR, ERROR_MOD_NOT_FOUND) || @@ -16,9 +19,11 @@ static int CheckDelayException(int exception_value) { // This example just executes the handler. return EXCEPTION_EXECUTE_HANDLER; } + // Don't attempt to handle other errors return EXCEPTION_CONTINUE_SEARCH; } + static bool TryDelayLoadAllImports(LPCSTR szDll) { __try { HRESULT hr = __HrLoadAllImportsForDll(szDll); @@ -30,7 +35,9 @@ static bool TryDelayLoadAllImports(LPCSTR szDll) { } return true; } + namespace wpi::glass { + bool HasCameraSupport() { bool hasCameraSupport = false; hasCameraSupport = TryDelayLoadAllImports("MF.dll"); @@ -42,11 +49,17 @@ bool HasCameraSupport() { } return hasCameraSupport; } + } // namespace wpi::glass + #else + namespace wpi::glass { + bool HasCameraSupport() { return true; } + } // namespace wpi::glass + #endif diff --git a/glass/src/lib/native/cpp/other/Plot.cpp b/glass/src/lib/native/cpp/other/Plot.cpp index ae9ac3b9bd..e8de7f325a 100644 --- a/glass/src/lib/native/cpp/other/Plot.cpp +++ b/glass/src/lib/native/cpp/other/Plot.cpp @@ -27,10 +27,6 @@ #include #include #include -#include "wpi/util/Signal.h" -#include "wpi/util/SmallString.hpp" -#include "wpi/util/SmallVector.hpp" -#include "wpi/util/timestamp.h" #include "wpi/glass/Context.hpp" #include "wpi/glass/DataSource.hpp" @@ -38,6 +34,10 @@ #include "wpi/glass/support/ColorSetting.hpp" #include "wpi/glass/support/EnumSetting.hpp" #include "wpi/glass/support/ExtraGuiWidgets.hpp" +#include "wpi/util/Signal.h" +#include "wpi/util/SmallString.hpp" +#include "wpi/util/SmallVector.hpp" +#include "wpi/util/timestamp.h" using namespace wpi::glass; diff --git a/hal/.styleguide b/hal/.styleguide index d4e5130759..fec10d1175 100644 --- a/hal/.styleguide +++ b/hal/.styleguide @@ -32,18 +32,3 @@ modifiableFileExclude { repoRootNameOverride { hal } - -includeOtherLibs { - ^fmt/ - ^gtest/ - ^i2clib/ - ^llvm/ - ^opencv2/ - ^spilib/ - ^support/ -} - -includeProject { - ^ctre/ - ^mockdata/ -} diff --git a/hal/src/main/native/include/wpi/hal/DriverStation.h b/hal/src/main/native/include/wpi/hal/DriverStation.h index c1af5b605d..96362c6729 100644 --- a/hal/src/main/native/include/wpi/hal/DriverStation.h +++ b/hal/src/main/native/include/wpi/hal/DriverStation.h @@ -4,10 +4,9 @@ #pragma once +#include #include -#include //NOLINT - #include "wpi/hal/DriverStationTypes.h" #include "wpi/hal/Types.h" #include "wpi/util/Synchronization.h" diff --git a/hal/src/main/native/include/wpi/hal/HALBase.h b/hal/src/main/native/include/wpi/hal/HALBase.h index 94a37d5d49..589836bda2 100644 --- a/hal/src/main/native/include/wpi/hal/HALBase.h +++ b/hal/src/main/native/include/wpi/hal/HALBase.h @@ -9,9 +9,7 @@ #ifdef __cplusplus #include #else - -#include // NOLINT(build/include_order) - +#include #endif #include "wpi/hal/Types.h" diff --git a/hal/src/main/native/sim/HAL.cpp b/hal/src/main/native/sim/HAL.cpp index 7dde70c872..67063bca93 100644 --- a/hal/src/main/native/sim/HAL.cpp +++ b/hal/src/main/native/sim/HAL.cpp @@ -10,7 +10,7 @@ #include #ifdef _WIN32 -#include +#include #pragma comment(lib, "Winmm.lib") #pragma comment(lib, "ntdll.lib") extern "C" NTSYSAPI NTSTATUS NTAPI NtSetTimerResolution( diff --git a/hal/src/main/native/sim/mockdata/SimDeviceData.cpp b/hal/src/main/native/sim/mockdata/SimDeviceData.cpp index 55aac569f3..355a378fa7 100644 --- a/hal/src/main/native/sim/mockdata/SimDeviceData.cpp +++ b/hal/src/main/native/sim/mockdata/SimDeviceData.cpp @@ -2,7 +2,7 @@ // 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/hal/simulation/SimDeviceData.h" // NOLINT(build/include_order) +#include "wpi/hal/simulation/SimDeviceData.h" #include #include diff --git a/hal/src/test/native/cpp/HALTest.cpp b/hal/src/test/native/cpp/HALTest.cpp index 3c867f777d..011830dcbf 100644 --- a/hal/src/test/native/cpp/HALTest.cpp +++ b/hal/src/test/native/cpp/HALTest.cpp @@ -2,10 +2,10 @@ // 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 - #include "wpi/hal/HAL.h" +#include + namespace wpi::hal { TEST(HALTest, RuntimeType) { EXPECT_EQ(HAL_RuntimeType::HAL_Runtime_Simulation, HAL_GetRuntimeType()); diff --git a/hal/src/test/native/cpp/mockdata/AnalogInDataTest.cpp b/hal/src/test/native/cpp/mockdata/AnalogInDataTest.cpp index 6a1d4b84a9..15e799c5c6 100644 --- a/hal/src/test/native/cpp/mockdata/AnalogInDataTest.cpp +++ b/hal/src/test/native/cpp/mockdata/AnalogInDataTest.cpp @@ -2,6 +2,8 @@ // 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/hal/simulation/AnalogInData.h" + #include #include @@ -9,7 +11,6 @@ #include "wpi/hal/AnalogInput.h" #include "wpi/hal/HAL.h" #include "wpi/hal/handles/HandlesInternal.h" -#include "wpi/hal/simulation/AnalogInData.h" namespace wpi::hal { diff --git a/hal/src/test/native/cpp/mockdata/DIODataTest.cpp b/hal/src/test/native/cpp/mockdata/DIODataTest.cpp index b396cdf0de..4b4e7f2b81 100644 --- a/hal/src/test/native/cpp/mockdata/DIODataTest.cpp +++ b/hal/src/test/native/cpp/mockdata/DIODataTest.cpp @@ -2,6 +2,8 @@ // 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/hal/simulation/DIOData.h" + #include #include @@ -9,7 +11,6 @@ #include "wpi/hal/DIO.h" #include "wpi/hal/HAL.h" #include "wpi/hal/handles/HandlesInternal.h" -#include "wpi/hal/simulation/DIOData.h" namespace wpi::hal { diff --git a/hal/src/test/native/cpp/mockdata/DriverStationDataTest.cpp b/hal/src/test/native/cpp/mockdata/DriverStationDataTest.cpp index e7e1005ca1..a4dc8dac8a 100644 --- a/hal/src/test/native/cpp/mockdata/DriverStationDataTest.cpp +++ b/hal/src/test/native/cpp/mockdata/DriverStationDataTest.cpp @@ -2,13 +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 "wpi/hal/simulation/DriverStationData.h" + #include #include #include #include "wpi/hal/HAL.h" -#include "wpi/hal/simulation/DriverStationData.h" #include "wpi/util/StringExtras.hpp" namespace wpi::hal { diff --git a/hal/src/test/native/cpp/mockdata/I2CDataTest.cpp b/hal/src/test/native/cpp/mockdata/I2CDataTest.cpp index cb310ec021..af45acb02b 100644 --- a/hal/src/test/native/cpp/mockdata/I2CDataTest.cpp +++ b/hal/src/test/native/cpp/mockdata/I2CDataTest.cpp @@ -2,12 +2,13 @@ // 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/hal/simulation/I2CData.h" + #include #include #include "wpi/hal/I2C.h" -#include "wpi/hal/simulation/I2CData.h" namespace wpi::hal { diff --git a/hal/src/test/native/cpp/mockdata/PWMDataTest.cpp b/hal/src/test/native/cpp/mockdata/PWMDataTest.cpp index 9b61e14bca..ec86d9fd9f 100644 --- a/hal/src/test/native/cpp/mockdata/PWMDataTest.cpp +++ b/hal/src/test/native/cpp/mockdata/PWMDataTest.cpp @@ -2,6 +2,8 @@ // 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/hal/simulation/PWMData.h" + #include #include @@ -9,7 +11,6 @@ #include "wpi/hal/HAL.h" #include "wpi/hal/PWM.h" #include "wpi/hal/handles/HandlesInternal.h" -#include "wpi/hal/simulation/PWMData.h" namespace wpi::hal { diff --git a/hal/src/test/native/cpp/mockdata/SimDeviceDataTest.cpp b/hal/src/test/native/cpp/mockdata/SimDeviceDataTest.cpp index f331de6ffc..a0ea177061 100644 --- a/hal/src/test/native/cpp/mockdata/SimDeviceDataTest.cpp +++ b/hal/src/test/native/cpp/mockdata/SimDeviceDataTest.cpp @@ -2,10 +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 "wpi/hal/simulation/SimDeviceData.h" + #include #include "wpi/hal/SimDevice.h" -#include "wpi/hal/simulation/SimDeviceData.h" namespace wpi::hal { diff --git a/ntcore/.styleguide b/ntcore/.styleguide index 1c714627fe..3785189816 100644 --- a/ntcore/.styleguide +++ b/ntcore/.styleguide @@ -31,9 +31,3 @@ includeGuardRoots { ntcore/src/main/native/include/ ntcore/src/test/native/cpp/ } - -includeOtherLibs { - ^fmt/ - ^gtest/ - ^support/ -} diff --git a/ntcore/src/test/native/cpp/LocalStorageTest.cpp b/ntcore/src/test/native/cpp/LocalStorageTest.cpp index 80275ae6c6..b3c9b728ad 100644 --- a/ntcore/src/test/native/cpp/LocalStorageTest.cpp +++ b/ntcore/src/test/native/cpp/LocalStorageTest.cpp @@ -2,12 +2,13 @@ // 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 "LocalStorage.hpp" + #include #include #include -#include "LocalStorage.hpp" #include "MockListenerStorage.hpp" #include "MockLogger.hpp" #include "PubSubOptionsMatcher.hpp" diff --git a/ntcore/src/test/native/cpp/NetworkTableTest.cpp b/ntcore/src/test/native/cpp/NetworkTableTest.cpp index 0076978928..95b3defb9c 100644 --- a/ntcore/src/test/native/cpp/NetworkTableTest.cpp +++ b/ntcore/src/test/native/cpp/NetworkTableTest.cpp @@ -2,13 +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 "wpi/nt/NetworkTable.hpp" + #include #include #include #include "TestPrinters.hpp" -#include "wpi/nt/NetworkTable.hpp" #include "wpi/nt/NetworkTableInstance.hpp" class NetworkTableTest : public ::testing::Test {}; diff --git a/ntcore/src/test/native/cpp/StructTest.cpp b/ntcore/src/test/native/cpp/StructTest.cpp index 2271a079b9..82d66e40c9 100644 --- a/ntcore/src/test/native/cpp/StructTest.cpp +++ b/ntcore/src/test/native/cpp/StructTest.cpp @@ -2,13 +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 "wpi/util/struct/Struct.hpp" + #include #include "wpi/nt/NetworkTableInstance.hpp" #include "wpi/nt/StructArrayTopic.hpp" #include "wpi/nt/StructTopic.hpp" #include "wpi/util/SpanMatcher.hpp" -#include "wpi/util/struct/Struct.hpp" namespace { struct Inner { diff --git a/ntcore/src/test/native/cpp/net/WireDecoderTest.cpp b/ntcore/src/test/native/cpp/net/WireDecoderTest.cpp index 5fa50878f4..517eaa1839 100644 --- a/ntcore/src/test/native/cpp/net/WireDecoderTest.cpp +++ b/ntcore/src/test/native/cpp/net/WireDecoderTest.cpp @@ -2,6 +2,8 @@ // 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 "net/WireDecoder.hpp" + #include #include @@ -13,7 +15,6 @@ #include "PubSubOptions.hpp" #include "gmock/gmock.h" #include "net/MessageHandler.hpp" -#include "net/WireDecoder.hpp" #include "wpi/nt/NetworkTableValue.hpp" #include "wpi/util/SmallString.hpp" #include "wpi/util/raw_ostream.hpp" diff --git a/ntcore/src/test/native/cpp/net/WireEncoderTest.cpp b/ntcore/src/test/native/cpp/net/WireEncoderTest.cpp index 9c2c905f31..e8bdf9134e 100644 --- a/ntcore/src/test/native/cpp/net/WireEncoderTest.cpp +++ b/ntcore/src/test/native/cpp/net/WireEncoderTest.cpp @@ -2,6 +2,8 @@ // 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 "net/WireEncoder.hpp" + #include #include #include @@ -14,7 +16,6 @@ #include "PubSubOptions.hpp" #include "gmock/gmock-matchers.h" #include "net/Message.hpp" -#include "net/WireEncoder.hpp" #include "wpi/nt/NetworkTableValue.hpp" #include "wpi/util/SpanMatcher.hpp" #include "wpi/util/json.hpp" diff --git a/ntcore/src/test/native/cpp/server/ServerImplTest.cpp b/ntcore/src/test/native/cpp/server/ServerImplTest.cpp index 4df6949588..4778425e5d 100644 --- a/ntcore/src/test/native/cpp/server/ServerImplTest.cpp +++ b/ntcore/src/test/native/cpp/server/ServerImplTest.cpp @@ -2,6 +2,8 @@ // 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 "server/ServerImpl.hpp" + #include #include @@ -23,7 +25,6 @@ #include "gmock/gmock.h" #include "net/Message.hpp" #include "net/WireEncoder.hpp" -#include "server/ServerImpl.hpp" #include "wpi/nt/ntcore_c.h" #include "wpi/nt/ntcore_cpp.hpp" #include "wpi/util/SpanMatcher.hpp" diff --git a/ntcoreffi/.styleguide b/ntcoreffi/.styleguide index 9615445369..04cb5665e5 100644 --- a/ntcoreffi/.styleguide +++ b/ntcoreffi/.styleguide @@ -15,12 +15,6 @@ repoRootNameOverride { ntcoreffi } -includeOtherLibs { - ^fmt/ - ^gmock/ - ^gtest/ -} - includeGuardRoots { ntcoreffi/src/main/native/include/ } diff --git a/romiVendordep/.styleguide b/romiVendordep/.styleguide index 1813a0972c..c45f70c9a3 100644 --- a/romiVendordep/.styleguide +++ b/romiVendordep/.styleguide @@ -16,12 +16,3 @@ generatedFileExclude { repoRootNameOverride { wpilib } - -includeOtherLibs { - ^fmt/ - ^gtest/ - ^imgui - ^mockdata/ - ^opencv2/ - ^support/ -} diff --git a/simulation/halsim_ds_socket/src/test/native/cpp/DSCommPacketTest.cpp b/simulation/halsim_ds_socket/src/test/native/cpp/DSCommPacketTest.cpp index 5256201f42..05a94323ef 100644 --- a/simulation/halsim_ds_socket/src/test/native/cpp/DSCommPacketTest.cpp +++ b/simulation/halsim_ds_socket/src/test/native/cpp/DSCommPacketTest.cpp @@ -2,10 +2,10 @@ // 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 - #include "wpi/halsim/ds_socket/DSCommPacket.hpp" +#include + class DSCommPacketTest : public ::testing::Test { public: DSCommPacketTest() = default; diff --git a/simulation/halsim_gui/src/main/native/cpp/main.cpp b/simulation/halsim_gui/src/main/native/cpp/main.cpp index c46828a95c..e6b64a09dd 100644 --- a/simulation/halsim_gui/src/main/native/cpp/main.cpp +++ b/simulation/halsim_gui/src/main/native/cpp/main.cpp @@ -2,6 +2,8 @@ // 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/hal/Main.h" + #include #include #include @@ -26,7 +28,6 @@ #include "wpi/glass/other/Plot.hpp" #include "wpi/gui/wpigui.hpp" #include "wpi/hal/Extensions.h" -#include "wpi/hal/Main.h" #include "wpi/halsim/gui/HALSimGui.hpp" #include "wpi/halsim/gui/HALSimGuiExt.hpp" #include "wpi/halsim/gui/SimDeviceGui.hpp" diff --git a/simulation/halsim_ws_client/src/dev/native/cpp/main.cpp b/simulation/halsim_ws_client/src/dev/native/cpp/main.cpp index f15a149385..7711823811 100644 --- a/simulation/halsim_ws_client/src/dev/native/cpp/main.cpp +++ b/simulation/halsim_ws_client/src/dev/native/cpp/main.cpp @@ -2,11 +2,12 @@ // 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/hal/Main.h" + #include #include "wpi/hal/DriverStation.h" #include "wpi/hal/HALBase.h" -#include "wpi/hal/Main.h" #include "wpi/util/print.hpp" extern "C" int HALSIM_InitExtension(void); diff --git a/simulation/halsim_ws_server/src/dev/native/cpp/main.cpp b/simulation/halsim_ws_server/src/dev/native/cpp/main.cpp index 34a121b065..b16c86231b 100644 --- a/simulation/halsim_ws_server/src/dev/native/cpp/main.cpp +++ b/simulation/halsim_ws_server/src/dev/native/cpp/main.cpp @@ -2,12 +2,13 @@ // 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/hal/Main.h" + #include #include #include "wpi/hal/DriverStation.h" #include "wpi/hal/HALBase.h" -#include "wpi/hal/Main.h" #include "wpi/util/print.hpp" extern "C" int HALSIM_InitExtension(void); diff --git a/simulation/halsim_ws_server/src/main/native/cpp/HALSimHttpConnection.cpp b/simulation/halsim_ws_server/src/main/native/cpp/HALSimHttpConnection.cpp index a58b35b6e9..a77e7119f5 100644 --- a/simulation/halsim_ws_server/src/main/native/cpp/HALSimHttpConnection.cpp +++ b/simulation/halsim_ws_server/src/main/native/cpp/HALSimHttpConnection.cpp @@ -4,12 +4,12 @@ #include "wpi/halsim/ws_server/HALSimHttpConnection.hpp" -#include - #include #include #include +#include + #include "wpi/net/MimeTypes.hpp" #include "wpi/net/UrlParser.hpp" #include "wpi/net/raw_uv_ostream.hpp" diff --git a/simulation/halsim_ws_server/src/test/native/cpp/main.cpp b/simulation/halsim_ws_server/src/test/native/cpp/main.cpp index 585915825f..6135dac186 100644 --- a/simulation/halsim_ws_server/src/test/native/cpp/main.cpp +++ b/simulation/halsim_ws_server/src/test/native/cpp/main.cpp @@ -2,6 +2,8 @@ // 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/hal/Main.h" + #include #include #include @@ -11,7 +13,6 @@ #include "WebServerClientTest.hpp" #include "wpi/hal/DriverStation.h" #include "wpi/hal/HALBase.h" -#include "wpi/hal/Main.h" #include "wpi/hal/simulation/DIOData.h" #include "wpi/halsim/ws_server/HALSimWSServer.hpp" #include "wpi/net/uv/Loop.hpp" diff --git a/tools/datalogtool/.styleguide b/tools/datalogtool/.styleguide index 12c61d6718..b2658d59ed 100644 --- a/tools/datalogtool/.styleguide +++ b/tools/datalogtool/.styleguide @@ -18,10 +18,3 @@ generatedFileExclude { repoRootNameOverride { datalogtool } - -includeOtherLibs { - ^GLFW - ^fmt/ - ^imgui - ^libssh/ -} diff --git a/tools/outlineviewer/.styleguide b/tools/outlineviewer/.styleguide index 691afcb248..89160d2663 100644 --- a/tools/outlineviewer/.styleguide +++ b/tools/outlineviewer/.styleguide @@ -18,11 +18,3 @@ generatedFileExclude { repoRootNameOverride { outlineviewer } - -includeOtherLibs { - ^GLFW - ^fmt/ - ^gtest/ - ^imgui - ^implot\.h$ -} diff --git a/tools/sysid/.styleguide b/tools/sysid/.styleguide index b6eba5b64b..ab51d222cc 100644 --- a/tools/sysid/.styleguide +++ b/tools/sysid/.styleguide @@ -18,11 +18,3 @@ generatedFileExclude { repoRootNameOverride { sysid } - -includeOtherLibs { - ^GLFW - ^fmt/ - ^gtest/ - ^imgui - ^implot\.h$ -} diff --git a/tools/sysid/src/main/native/cpp/App.cpp b/tools/sysid/src/main/native/cpp/App.cpp index f8c516ba07..41cab9d35c 100644 --- a/tools/sysid/src/main/native/cpp/App.cpp +++ b/tools/sysid/src/main/native/cpp/App.cpp @@ -9,8 +9,10 @@ #include #include #include -#include #include +#include + +#include #include "wpi/glass/Context.hpp" #include "wpi/glass/MainMenuBar.hpp" @@ -18,16 +20,14 @@ #include "wpi/glass/Window.hpp" #include "wpi/glass/WindowManager.hpp" #include "wpi/glass/other/Log.hpp" -#include -#include "wpi/util/Logger.hpp" -#include "wpi/util/print.hpp" #include "wpi/gui/wpigui.hpp" #include "wpi/gui/wpigui_openurl.hpp" - #include "wpi/sysid/view/Analyzer.hpp" #include "wpi/sysid/view/DataSelector.hpp" #include "wpi/sysid/view/LogLoader.hpp" #include "wpi/sysid/view/UILayout.hpp" +#include "wpi/util/Logger.hpp" +#include "wpi/util/print.hpp" namespace gui = wpi::gui; diff --git a/tools/sysid/src/test/native/cpp/analysis/AnalysisTypeTest.cpp b/tools/sysid/src/test/native/cpp/analysis/AnalysisTypeTest.cpp index eda266db51..5100cd1137 100644 --- a/tools/sysid/src/test/native/cpp/analysis/AnalysisTypeTest.cpp +++ b/tools/sysid/src/test/native/cpp/analysis/AnalysisTypeTest.cpp @@ -2,10 +2,10 @@ // 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 - #include "wpi/sysid/analysis/AnalysisType.hpp" +#include + TEST(AnalysisTypeTest, FromName) { EXPECT_EQ(sysid::analysis::kElevator, sysid::analysis::FromName("Elevator")); EXPECT_EQ(sysid::analysis::kArm, sysid::analysis::FromName("Arm")); diff --git a/tools/sysid/src/test/native/cpp/analysis/FeedbackAnalysisTest.cpp b/tools/sysid/src/test/native/cpp/analysis/FeedbackAnalysisTest.cpp index e2927fca68..d857f949f0 100644 --- a/tools/sysid/src/test/native/cpp/analysis/FeedbackAnalysisTest.cpp +++ b/tools/sysid/src/test/native/cpp/analysis/FeedbackAnalysisTest.cpp @@ -2,9 +2,10 @@ // 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/sysid/analysis/FeedbackAnalysis.hpp" + #include -#include "wpi/sysid/analysis/FeedbackAnalysis.hpp" #include "wpi/sysid/analysis/FeedbackControllerPreset.hpp" TEST(FeedbackAnalysisTest, VelocitySystem1) { diff --git a/tools/sysid/src/test/native/cpp/analysis/FeedforwardAnalysisTest.cpp b/tools/sysid/src/test/native/cpp/analysis/FeedforwardAnalysisTest.cpp index 163ac7aa92..e7d239960e 100644 --- a/tools/sysid/src/test/native/cpp/analysis/FeedforwardAnalysisTest.cpp +++ b/tools/sysid/src/test/native/cpp/analysis/FeedforwardAnalysisTest.cpp @@ -2,6 +2,8 @@ // 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/sysid/analysis/FeedforwardAnalysis.hpp" + #include #include @@ -14,7 +16,6 @@ #include "wpi/sysid/analysis/AnalysisType.hpp" #include "wpi/sysid/analysis/ArmSim.hpp" #include "wpi/sysid/analysis/ElevatorSim.hpp" -#include "wpi/sysid/analysis/FeedforwardAnalysis.hpp" #include "wpi/sysid/analysis/SimpleMotorSim.hpp" #include "wpi/units/time.hpp" #include "wpi/units/voltage.hpp" diff --git a/tools/sysid/src/test/native/cpp/analysis/OLSTest.cpp b/tools/sysid/src/test/native/cpp/analysis/OLSTest.cpp index 09167cf8c9..f4d9e33062 100644 --- a/tools/sysid/src/test/native/cpp/analysis/OLSTest.cpp +++ b/tools/sysid/src/test/native/cpp/analysis/OLSTest.cpp @@ -2,10 +2,10 @@ // 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 - #include "wpi/sysid/analysis/OLS.hpp" +#include + TEST(OLSTest, TwoVariablesTwoPoints) { // (1, 3) and (2, 5). Should produce y = 2x + 1. Eigen::MatrixXd X{{1.0, 1.0}, {1.0, 2.0}}; diff --git a/tools/sysid/src/test/native/cpp/analysis/TrackwidthAnalysisTest.cpp b/tools/sysid/src/test/native/cpp/analysis/TrackwidthAnalysisTest.cpp index fa8b8d7227..77b7e38084 100644 --- a/tools/sysid/src/test/native/cpp/analysis/TrackwidthAnalysisTest.cpp +++ b/tools/sysid/src/test/native/cpp/analysis/TrackwidthAnalysisTest.cpp @@ -2,10 +2,10 @@ // 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 - #include "wpi/sysid/analysis/TrackwidthAnalysis.hpp" +#include + TEST(TrackwidthAnalysisTest, Calculate) { double result = sysid::CalculateTrackwidth(-0.5386, 0.5386, 90_deg); EXPECT_NEAR(result, 0.6858, 1E-4); diff --git a/tools/wpical/.styleguide b/tools/wpical/.styleguide index 6cf8aba880..5ee7c00449 100644 --- a/tools/wpical/.styleguide +++ b/tools/wpical/.styleguide @@ -20,14 +20,3 @@ generatedFileExclude { repoRootNameOverride { wpical } - -includeOtherLibs { - ^GLFW - ^ceres/ - ^fmt/ - ^gtest/ - ^imgui - ^implot\.h$ - ^mrcal_wrapper\.h$ - ^opencv2\.h$ -} diff --git a/wpigui/.styleguide b/wpigui/.styleguide index a29a3c113c..a698bdf064 100644 --- a/wpigui/.styleguide +++ b/wpigui/.styleguide @@ -23,9 +23,3 @@ includeGuardRoots { wpigui/src/main/native/metal/ wpigui/src/main/native/opengl3/ } - -includeOtherLibs { - ^imgui - ^implot - ^stb -} diff --git a/wpigui/src/main/native/cpp/wpigui_openurl.cpp b/wpigui/src/main/native/cpp/wpigui_openurl.cpp index 24b4323ffb..323689e27d 100644 --- a/wpigui/src/main/native/cpp/wpigui_openurl.cpp +++ b/wpigui/src/main/native/cpp/wpigui_openurl.cpp @@ -8,7 +8,7 @@ #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN 1 #endif -#include +#include #include #else #include diff --git a/wpigui/src/main/native/directx11/wpigui_directx11.cpp b/wpigui/src/main/native/directx11/wpigui_directx11.cpp index 4943f69500..56e0652aa1 100644 --- a/wpigui/src/main/native/directx11/wpigui_directx11.cpp +++ b/wpigui/src/main/native/directx11/wpigui_directx11.cpp @@ -8,10 +8,9 @@ #define GLFW_EXPOSE_NATIVE_WIN32 #include #include - #include -#include #include +#include #include "wpi/gui/wpigui.hpp" #include "wpi/gui/wpigui_internal.hpp" diff --git a/wpilibc/src/main/native/cpp/driverstation/DriverStation.cpp b/wpilibc/src/main/native/cpp/driverstation/DriverStation.cpp index e03c97a150..baace39fb8 100644 --- a/wpilibc/src/main/native/cpp/driverstation/DriverStation.cpp +++ b/wpilibc/src/main/native/cpp/driverstation/DriverStation.cpp @@ -3,7 +3,6 @@ // the WPILib BSD license file in the root directory of this project. #include "wpi/driverstation/DriverStation.hpp" -#include "wpi/hal/DriverStation.h" #include @@ -17,6 +16,7 @@ #include #include "wpi/datalog/DataLog.hpp" +#include "wpi/hal/DriverStation.h" #include "wpi/hal/DriverStationTypes.h" #include "wpi/hal/HALBase.h" #include "wpi/hal/Power.h" diff --git a/wpilibc/src/main/native/cpp/hardware/bus/CAN.cpp b/wpilibc/src/main/native/cpp/hardware/bus/CAN.cpp index 0ef8f374cb..7acd84e65c 100644 --- a/wpilibc/src/main/native/cpp/hardware/bus/CAN.cpp +++ b/wpilibc/src/main/native/cpp/hardware/bus/CAN.cpp @@ -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 "wpi/hal/CAN.h" #include "wpi/hardware/bus/CAN.hpp" #include +#include "wpi/hal/CAN.h" #include "wpi/hal/CANAPI.h" #include "wpi/hal/Errors.h" #include "wpi/hal/UsageReporting.h" diff --git a/wpilibc/src/main/native/cpp/hardware/bus/I2C.cpp b/wpilibc/src/main/native/cpp/hardware/bus/I2C.cpp index f616ad5d38..115de93780 100644 --- a/wpilibc/src/main/native/cpp/hardware/bus/I2C.cpp +++ b/wpilibc/src/main/native/cpp/hardware/bus/I2C.cpp @@ -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 "wpi/hal/I2C.h" #include "wpi/hardware/bus/I2C.hpp" #include +#include "wpi/hal/I2C.h" #include "wpi/hal/UsageReporting.h" #include "wpi/system/Errors.hpp" diff --git a/wpilibc/src/main/native/cpp/hardware/bus/SerialPort.cpp b/wpilibc/src/main/native/cpp/hardware/bus/SerialPort.cpp index 50f5e23fd8..0229d71bf2 100644 --- a/wpilibc/src/main/native/cpp/hardware/bus/SerialPort.cpp +++ b/wpilibc/src/main/native/cpp/hardware/bus/SerialPort.cpp @@ -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 "wpi/hal/SerialPort.h" #include "wpi/hardware/bus/SerialPort.hpp" #include +#include "wpi/hal/SerialPort.h" #include "wpi/hal/UsageReporting.h" #include "wpi/system/Errors.hpp" diff --git a/wpilibc/src/main/native/cpp/hardware/discrete/AnalogInput.cpp b/wpilibc/src/main/native/cpp/hardware/discrete/AnalogInput.cpp index 96433efd32..2d86526a4b 100644 --- a/wpilibc/src/main/native/cpp/hardware/discrete/AnalogInput.cpp +++ b/wpilibc/src/main/native/cpp/hardware/discrete/AnalogInput.cpp @@ -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 "wpi/hal/AnalogInput.h" #include "wpi/hardware/discrete/AnalogInput.hpp" #include +#include "wpi/hal/AnalogInput.h" #include "wpi/hal/HALBase.h" #include "wpi/hal/Ports.h" #include "wpi/hal/UsageReporting.h" diff --git a/wpilibc/src/main/native/cpp/hardware/discrete/PWM.cpp b/wpilibc/src/main/native/cpp/hardware/discrete/PWM.cpp index 3f36791860..a756504b47 100644 --- a/wpilibc/src/main/native/cpp/hardware/discrete/PWM.cpp +++ b/wpilibc/src/main/native/cpp/hardware/discrete/PWM.cpp @@ -2,12 +2,12 @@ // 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/hal/PWM.h" #include "wpi/hardware/discrete/PWM.hpp" #include #include "wpi/hal/HALBase.h" +#include "wpi/hal/PWM.h" #include "wpi/hal/Ports.h" #include "wpi/hal/UsageReporting.h" #include "wpi/system/Errors.hpp" diff --git a/wpilibc/src/main/native/cpp/hardware/led/AddressableLED.cpp b/wpilibc/src/main/native/cpp/hardware/led/AddressableLED.cpp index 46a898c5d1..5db686f67e 100644 --- a/wpilibc/src/main/native/cpp/hardware/led/AddressableLED.cpp +++ b/wpilibc/src/main/native/cpp/hardware/led/AddressableLED.cpp @@ -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 "wpi/hal/AddressableLED.h" #include "wpi/hardware/led/AddressableLED.hpp" #include +#include "wpi/hal/AddressableLED.h" #include "wpi/hal/HALBase.h" #include "wpi/hal/PWM.h" #include "wpi/hal/Ports.h" diff --git a/wpilibc/src/main/native/cpp/hardware/power/PowerDistribution.cpp b/wpilibc/src/main/native/cpp/hardware/power/PowerDistribution.cpp index fcdc176f3f..4f32f216cc 100644 --- a/wpilibc/src/main/native/cpp/hardware/power/PowerDistribution.cpp +++ b/wpilibc/src/main/native/cpp/hardware/power/PowerDistribution.cpp @@ -2,7 +2,6 @@ // 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/hal/PowerDistribution.h" #include "wpi/hardware/power/PowerDistribution.hpp" #include @@ -10,6 +9,7 @@ #include #include "wpi/hal/Ports.h" +#include "wpi/hal/PowerDistribution.h" #include "wpi/hal/UsageReporting.h" #include "wpi/system/Errors.hpp" #include "wpi/util/StackTrace.hpp" diff --git a/wpilibc/src/main/native/cpp/hardware/rotation/DutyCycle.cpp b/wpilibc/src/main/native/cpp/hardware/rotation/DutyCycle.cpp index d58e29ac13..b1cad04020 100644 --- a/wpilibc/src/main/native/cpp/hardware/rotation/DutyCycle.cpp +++ b/wpilibc/src/main/native/cpp/hardware/rotation/DutyCycle.cpp @@ -2,12 +2,12 @@ // 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/hal/DutyCycle.h" #include "wpi/hardware/rotation/DutyCycle.hpp" #include #include +#include "wpi/hal/DutyCycle.h" #include "wpi/hal/HALBase.h" #include "wpi/hal/UsageReporting.h" #include "wpi/system/Errors.hpp" diff --git a/wpilibc/src/main/native/cpp/hardware/rotation/Encoder.cpp b/wpilibc/src/main/native/cpp/hardware/rotation/Encoder.cpp index d87e1e2e4f..e2e182327c 100644 --- a/wpilibc/src/main/native/cpp/hardware/rotation/Encoder.cpp +++ b/wpilibc/src/main/native/cpp/hardware/rotation/Encoder.cpp @@ -2,12 +2,12 @@ // 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/hal/Encoder.h" #include "wpi/hardware/rotation/Encoder.hpp" #include #include +#include "wpi/hal/Encoder.h" #include "wpi/hal/UsageReporting.h" #include "wpi/hardware/discrete/DigitalInput.hpp" #include "wpi/system/Errors.hpp" diff --git a/wpilibc/src/main/native/cpp/system/Notifier.cpp b/wpilibc/src/main/native/cpp/system/Notifier.cpp index deb8f9774f..08aa2e066d 100644 --- a/wpilibc/src/main/native/cpp/system/Notifier.cpp +++ b/wpilibc/src/main/native/cpp/system/Notifier.cpp @@ -2,7 +2,6 @@ // 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/hal/Notifier.h" #include "wpi/system/Notifier.hpp" #include @@ -10,6 +9,7 @@ #include #include "wpi/hal/DriverStation.h" +#include "wpi/hal/Notifier.h" #include "wpi/hal/Threads.h" #include "wpi/system/Errors.hpp" #include "wpi/system/Timer.hpp" diff --git a/wpilibc/src/main/native/cpp/system/SystemServer.cpp b/wpilibc/src/main/native/cpp/system/SystemServer.cpp index 6edf9ff865..bf5b4b065d 100644 --- a/wpilibc/src/main/native/cpp/system/SystemServer.cpp +++ b/wpilibc/src/main/native/cpp/system/SystemServer.cpp @@ -2,9 +2,10 @@ // 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/hal/SystemServer.h" #include "wpi/system/SystemServer.hpp" +#include "wpi/hal/SystemServer.h" + namespace wpi { wpi::nt::NetworkTableInstance SystemServer::GetSystemServer() { diff --git a/wpilibc/src/main/native/cpp/system/Threads.cpp b/wpilibc/src/main/native/cpp/system/Threads.cpp index 8c5309a88a..9f90af0459 100644 --- a/wpilibc/src/main/native/cpp/system/Threads.cpp +++ b/wpilibc/src/main/native/cpp/system/Threads.cpp @@ -2,9 +2,9 @@ // 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/hal/Threads.h" #include "wpi/system/Threads.hpp" +#include "wpi/hal/Threads.h" #include "wpi/system/Errors.hpp" namespace wpi { diff --git a/wpilibc/src/test/native/cpp/AlertTest.cpp b/wpilibc/src/test/native/cpp/AlertTest.cpp index f3bec9227c..4d9f5c7348 100644 --- a/wpilibc/src/test/native/cpp/AlertTest.cpp +++ b/wpilibc/src/test/native/cpp/AlertTest.cpp @@ -2,6 +2,8 @@ // 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/util/Alert.hpp" + #include #include #include @@ -16,7 +18,6 @@ #include "wpi/nt/StringArrayTopic.hpp" #include "wpi/simulation/SimHooks.hpp" #include "wpi/smartdashboard/SmartDashboard.hpp" -#include "wpi/util/Alert.hpp" using namespace wpi; using enum Alert::AlertType; diff --git a/wpilibc/src/test/native/cpp/AnalogPotentiometerTest.cpp b/wpilibc/src/test/native/cpp/AnalogPotentiometerTest.cpp index 9d02abeae0..a6468697a5 100644 --- a/wpilibc/src/test/native/cpp/AnalogPotentiometerTest.cpp +++ b/wpilibc/src/test/native/cpp/AnalogPotentiometerTest.cpp @@ -2,10 +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 "wpi/hardware/rotation/AnalogPotentiometer.hpp" + #include #include "wpi/hal/HAL.h" -#include "wpi/hardware/rotation/AnalogPotentiometer.hpp" #include "wpi/simulation/AnalogInputSim.hpp" #include "wpi/simulation/RoboRioSim.hpp" diff --git a/wpilibc/src/test/native/cpp/DriverStationTest.cpp b/wpilibc/src/test/native/cpp/DriverStationTest.cpp index 92742bebae..d4a7691c9c 100644 --- a/wpilibc/src/test/native/cpp/DriverStationTest.cpp +++ b/wpilibc/src/test/native/cpp/DriverStationTest.cpp @@ -2,12 +2,13 @@ // 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/driverstation/DriverStation.hpp" + #include #include #include -#include "wpi/driverstation/DriverStation.hpp" #include "wpi/driverstation/Joystick.hpp" #include "wpi/simulation/DriverStationSim.hpp" #include "wpi/simulation/SimHooks.hpp" diff --git a/wpilibc/src/test/native/cpp/GenericHIDTest.cpp b/wpilibc/src/test/native/cpp/GenericHIDTest.cpp index a7a7cb2e3f..56d8089e92 100644 --- a/wpilibc/src/test/native/cpp/GenericHIDTest.cpp +++ b/wpilibc/src/test/native/cpp/GenericHIDTest.cpp @@ -2,9 +2,10 @@ // 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/driverstation/GenericHID.hpp" + #include -#include "wpi/driverstation/GenericHID.hpp" #include "wpi/simulation/GenericHIDSim.hpp" using namespace wpi; diff --git a/wpilibc/src/test/native/cpp/JoystickTest.cpp b/wpilibc/src/test/native/cpp/JoystickTest.cpp index d4fc628cb1..d53209975a 100644 --- a/wpilibc/src/test/native/cpp/JoystickTest.cpp +++ b/wpilibc/src/test/native/cpp/JoystickTest.cpp @@ -2,7 +2,7 @@ // 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/driverstation/Joystick.hpp" // NOLINT(build/include_order) +#include "wpi/driverstation/Joystick.hpp" #include diff --git a/wpilibc/src/test/native/cpp/LEDPatternTest.cpp b/wpilibc/src/test/native/cpp/LEDPatternTest.cpp index 42f0a88194..cc9219e4ec 100644 --- a/wpilibc/src/test/native/cpp/LEDPatternTest.cpp +++ b/wpilibc/src/test/native/cpp/LEDPatternTest.cpp @@ -2,9 +2,10 @@ // 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/hardware/led/LEDPattern.hpp" + #include -#include "wpi/hardware/led/LEDPattern.hpp" #include "wpi/math/util/MathUtil.hpp" #include "wpi/util/MathExtras.hpp" #include "wpi/util/timestamp.h" diff --git a/wpilibc/src/test/native/cpp/NotifierTest.cpp b/wpilibc/src/test/native/cpp/NotifierTest.cpp index 64fe065c91..cf307a7a0f 100644 --- a/wpilibc/src/test/native/cpp/NotifierTest.cpp +++ b/wpilibc/src/test/native/cpp/NotifierTest.cpp @@ -2,12 +2,13 @@ // 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/system/Notifier.hpp" + #include #include #include "wpi/simulation/SimHooks.hpp" -#include "wpi/system/Notifier.hpp" using namespace wpi; diff --git a/wpilibc/src/test/native/cpp/PS4ControllerTest.cpp b/wpilibc/src/test/native/cpp/PS4ControllerTest.cpp index 6e7bae8b89..bdf51acdc9 100644 --- a/wpilibc/src/test/native/cpp/PS4ControllerTest.cpp +++ b/wpilibc/src/test/native/cpp/PS4ControllerTest.cpp @@ -2,7 +2,7 @@ // 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/driverstation/PS4Controller.hpp" // NOLINT(build/include_order) +#include "wpi/driverstation/PS4Controller.hpp" #include diff --git a/wpilibc/src/test/native/cpp/PS5ControllerTest.cpp b/wpilibc/src/test/native/cpp/PS5ControllerTest.cpp index 1a6a5b905b..8185942eaf 100644 --- a/wpilibc/src/test/native/cpp/PS5ControllerTest.cpp +++ b/wpilibc/src/test/native/cpp/PS5ControllerTest.cpp @@ -2,7 +2,7 @@ // 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/driverstation/PS5Controller.hpp" // NOLINT(build/include_order) +#include "wpi/driverstation/PS5Controller.hpp" #include diff --git a/wpilibc/src/test/native/cpp/ScopedTracerTest.cpp b/wpilibc/src/test/native/cpp/ScopedTracerTest.cpp index 49f391a8f7..013f32247e 100644 --- a/wpilibc/src/test/native/cpp/ScopedTracerTest.cpp +++ b/wpilibc/src/test/native/cpp/ScopedTracerTest.cpp @@ -2,12 +2,13 @@ // 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/system/ScopedTracer.hpp" + #include #include #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" diff --git a/wpilibc/src/test/native/cpp/SharpIRTest.cpp b/wpilibc/src/test/native/cpp/SharpIRTest.cpp index 6ebc8046ea..3eca1946aa 100644 --- a/wpilibc/src/test/native/cpp/SharpIRTest.cpp +++ b/wpilibc/src/test/native/cpp/SharpIRTest.cpp @@ -2,9 +2,10 @@ // 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/hardware/range/SharpIR.hpp" + #include -#include "wpi/hardware/range/SharpIR.hpp" #include "wpi/simulation/SharpIRSim.hpp" using namespace wpi; diff --git a/wpilibc/src/test/native/cpp/TimedRobotTest.cpp b/wpilibc/src/test/native/cpp/TimedRobotTest.cpp index 1ccabfc1d3..d21adf1692 100644 --- a/wpilibc/src/test/native/cpp/TimedRobotTest.cpp +++ b/wpilibc/src/test/native/cpp/TimedRobotTest.cpp @@ -2,7 +2,7 @@ // 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/framework/TimedRobot.hpp" // NOLINT(build/include_order) +#include "wpi/framework/TimedRobot.hpp" #include diff --git a/wpilibc/src/test/native/cpp/TimerTest.cpp b/wpilibc/src/test/native/cpp/TimerTest.cpp index c3a9b13b55..9523d881b7 100644 --- a/wpilibc/src/test/native/cpp/TimerTest.cpp +++ b/wpilibc/src/test/native/cpp/TimerTest.cpp @@ -2,7 +2,7 @@ // 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/system/Timer.hpp" // NOLINT(build/include_order) +#include "wpi/system/Timer.hpp" #include diff --git a/wpilibc/src/test/native/cpp/TimesliceRobotTest.cpp b/wpilibc/src/test/native/cpp/TimesliceRobotTest.cpp index cb398044b8..a8c6b43590 100644 --- a/wpilibc/src/test/native/cpp/TimesliceRobotTest.cpp +++ b/wpilibc/src/test/native/cpp/TimesliceRobotTest.cpp @@ -2,7 +2,7 @@ // 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/framework/TimesliceRobot.hpp" // NOLINT(build/include_order) +#include "wpi/framework/TimesliceRobot.hpp" #include diff --git a/wpilibc/src/test/native/cpp/WatchdogTest.cpp b/wpilibc/src/test/native/cpp/WatchdogTest.cpp index 4db08d836c..616df81609 100644 --- a/wpilibc/src/test/native/cpp/WatchdogTest.cpp +++ b/wpilibc/src/test/native/cpp/WatchdogTest.cpp @@ -2,7 +2,7 @@ // 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/system/Watchdog.hpp" // NOLINT(build/include_order) +#include "wpi/system/Watchdog.hpp" #include diff --git a/wpilibc/src/test/native/cpp/XboxControllerTest.cpp b/wpilibc/src/test/native/cpp/XboxControllerTest.cpp index 1308e5ba4d..545b4b8361 100644 --- a/wpilibc/src/test/native/cpp/XboxControllerTest.cpp +++ b/wpilibc/src/test/native/cpp/XboxControllerTest.cpp @@ -2,7 +2,7 @@ // 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/driverstation/XboxController.hpp" // NOLINT(build/include_order) +#include "wpi/driverstation/XboxController.hpp" #include diff --git a/wpilibc/src/test/native/cpp/drive/DifferentialDriveTest.cpp b/wpilibc/src/test/native/cpp/drive/DifferentialDriveTest.cpp index b43fe505aa..f6d444a21e 100644 --- a/wpilibc/src/test/native/cpp/drive/DifferentialDriveTest.cpp +++ b/wpilibc/src/test/native/cpp/drive/DifferentialDriveTest.cpp @@ -2,10 +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 "wpi/drive/DifferentialDrive.hpp" + #include #include "motorcontrol/MockPWMMotorController.hpp" -#include "wpi/drive/DifferentialDrive.hpp" TEST(DifferentialDriveTest, ArcadeDriveIK) { // Forward diff --git a/wpilibc/src/test/native/cpp/drive/MecanumDriveTest.cpp b/wpilibc/src/test/native/cpp/drive/MecanumDriveTest.cpp index 55baf33288..8abc2b1acc 100644 --- a/wpilibc/src/test/native/cpp/drive/MecanumDriveTest.cpp +++ b/wpilibc/src/test/native/cpp/drive/MecanumDriveTest.cpp @@ -2,10 +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 "wpi/drive/MecanumDrive.hpp" + #include #include "motorcontrol/MockPWMMotorController.hpp" -#include "wpi/drive/MecanumDrive.hpp" TEST(MecanumDriveTest, CartesianIK) { // Forward diff --git a/wpilibc/src/test/native/cpp/event/BooleanEventTest.cpp b/wpilibc/src/test/native/cpp/event/BooleanEventTest.cpp index ae048a6d0a..f10659443c 100644 --- a/wpilibc/src/test/native/cpp/event/BooleanEventTest.cpp +++ b/wpilibc/src/test/native/cpp/event/BooleanEventTest.cpp @@ -2,11 +2,12 @@ // 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/event/BooleanEvent.hpp" + #include #include -#include "wpi/event/BooleanEvent.hpp" #include "wpi/event/EventLoop.hpp" using namespace wpi; diff --git a/wpilibc/src/test/native/cpp/event/EventLoopTest.cpp b/wpilibc/src/test/native/cpp/event/EventLoopTest.cpp index 895e483986..a3ffe0d78f 100644 --- a/wpilibc/src/test/native/cpp/event/EventLoopTest.cpp +++ b/wpilibc/src/test/native/cpp/event/EventLoopTest.cpp @@ -2,9 +2,10 @@ // 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/event/EventLoop.hpp" + #include -#include "wpi/event/EventLoop.hpp" #include "wpi/system/Errors.hpp" using namespace wpi; diff --git a/wpilibc/src/test/native/cpp/event/NetworkBooleanEventTest.cpp b/wpilibc/src/test/native/cpp/event/NetworkBooleanEventTest.cpp index 091282014e..641f998af1 100644 --- a/wpilibc/src/test/native/cpp/event/NetworkBooleanEventTest.cpp +++ b/wpilibc/src/test/native/cpp/event/NetworkBooleanEventTest.cpp @@ -2,10 +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 "wpi/event/NetworkBooleanEvent.hpp" + #include #include "wpi/event/EventLoop.hpp" -#include "wpi/event/NetworkBooleanEvent.hpp" #include "wpi/nt/BooleanTopic.hpp" #include "wpi/nt/NetworkTableInstance.hpp" diff --git a/wpilibc/src/test/native/cpp/simulation/AddressableLEDSimTest.cpp b/wpilibc/src/test/native/cpp/simulation/AddressableLEDSimTest.cpp index e84a8e3601..87c4a3f53e 100644 --- a/wpilibc/src/test/native/cpp/simulation/AddressableLEDSimTest.cpp +++ b/wpilibc/src/test/native/cpp/simulation/AddressableLEDSimTest.cpp @@ -2,7 +2,7 @@ // 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/AddressableLEDSim.hpp" // NOLINT(build/include_order) +#include "wpi/simulation/AddressableLEDSim.hpp" #include diff --git a/wpilibc/src/test/native/cpp/simulation/AnalogEncoderSimTest.cpp b/wpilibc/src/test/native/cpp/simulation/AnalogEncoderSimTest.cpp index 7756dc787c..63f14bb1ab 100644 --- a/wpilibc/src/test/native/cpp/simulation/AnalogEncoderSimTest.cpp +++ b/wpilibc/src/test/native/cpp/simulation/AnalogEncoderSimTest.cpp @@ -2,6 +2,8 @@ // 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/AnalogEncoderSim.hpp" + #include #include @@ -9,7 +11,6 @@ #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) \ diff --git a/wpilibc/src/test/native/cpp/simulation/AnalogInputSimTest.cpp b/wpilibc/src/test/native/cpp/simulation/AnalogInputSimTest.cpp index 3fc8005108..3395cbcda7 100644 --- a/wpilibc/src/test/native/cpp/simulation/AnalogInputSimTest.cpp +++ b/wpilibc/src/test/native/cpp/simulation/AnalogInputSimTest.cpp @@ -2,7 +2,7 @@ // 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/AnalogInputSim.hpp" // NOLINT(build/include_order) +#include "wpi/simulation/AnalogInputSim.hpp" #include diff --git a/wpilibc/src/test/native/cpp/simulation/CTREPCMSimTest.cpp b/wpilibc/src/test/native/cpp/simulation/CTREPCMSimTest.cpp index 301ff1885c..8e4d13cf32 100644 --- a/wpilibc/src/test/native/cpp/simulation/CTREPCMSimTest.cpp +++ b/wpilibc/src/test/native/cpp/simulation/CTREPCMSimTest.cpp @@ -2,7 +2,7 @@ // 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/CTREPCMSim.hpp" // NOLINT(build/include_order) +#include "wpi/simulation/CTREPCMSim.hpp" #include diff --git a/wpilibc/src/test/native/cpp/simulation/DCMotorSimTest.cpp b/wpilibc/src/test/native/cpp/simulation/DCMotorSimTest.cpp index 1ce8052fae..cfbab6f8c3 100644 --- a/wpilibc/src/test/native/cpp/simulation/DCMotorSimTest.cpp +++ b/wpilibc/src/test/native/cpp/simulation/DCMotorSimTest.cpp @@ -2,6 +2,8 @@ // 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/DCMotorSim.hpp" + #include #include "wpi/hardware/motor/PWMVictorSPX.hpp" @@ -9,7 +11,6 @@ #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/system/RobotController.hpp" diff --git a/wpilibc/src/test/native/cpp/simulation/DIOSimTest.cpp b/wpilibc/src/test/native/cpp/simulation/DIOSimTest.cpp index 2df96dad0a..4af8e2ede9 100644 --- a/wpilibc/src/test/native/cpp/simulation/DIOSimTest.cpp +++ b/wpilibc/src/test/native/cpp/simulation/DIOSimTest.cpp @@ -2,7 +2,7 @@ // 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/DIOSim.hpp" // NOLINT(build/include_order) +#include "wpi/simulation/DIOSim.hpp" #include diff --git a/wpilibc/src/test/native/cpp/simulation/DifferentialDrivetrainSimTest.cpp b/wpilibc/src/test/native/cpp/simulation/DifferentialDrivetrainSimTest.cpp index fde18bfaa2..3c89bdf705 100644 --- a/wpilibc/src/test/native/cpp/simulation/DifferentialDrivetrainSimTest.cpp +++ b/wpilibc/src/test/native/cpp/simulation/DifferentialDrivetrainSimTest.cpp @@ -2,6 +2,8 @@ // 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/DifferentialDrivetrainSim.hpp" + #include #include "wpi/math/controller/LTVUnicycleController.hpp" @@ -12,7 +14,6 @@ #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" diff --git a/wpilibc/src/test/native/cpp/simulation/DigitalPWMSimTest.cpp b/wpilibc/src/test/native/cpp/simulation/DigitalPWMSimTest.cpp index 2e32d1ba0f..5804d9774a 100644 --- a/wpilibc/src/test/native/cpp/simulation/DigitalPWMSimTest.cpp +++ b/wpilibc/src/test/native/cpp/simulation/DigitalPWMSimTest.cpp @@ -2,7 +2,7 @@ // 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/DigitalPWMSim.hpp" // NOLINT(build/include_order) +#include "wpi/simulation/DigitalPWMSim.hpp" #include diff --git a/wpilibc/src/test/native/cpp/simulation/DriverStationSimTest.cpp b/wpilibc/src/test/native/cpp/simulation/DriverStationSimTest.cpp index b49eb86650..9351f8d8e3 100644 --- a/wpilibc/src/test/native/cpp/simulation/DriverStationSimTest.cpp +++ b/wpilibc/src/test/native/cpp/simulation/DriverStationSimTest.cpp @@ -2,6 +2,8 @@ // 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/DriverStationSim.hpp" + #include #include @@ -11,7 +13,6 @@ #include "wpi/driverstation/DriverStation.hpp" #include "wpi/driverstation/Joystick.hpp" #include "wpi/framework/RobotState.hpp" -#include "wpi/simulation/DriverStationSim.hpp" #include "wpi/simulation/SimHooks.hpp" using namespace wpi; diff --git a/wpilibc/src/test/native/cpp/simulation/DutyCycleEncoderSimTest.cpp b/wpilibc/src/test/native/cpp/simulation/DutyCycleEncoderSimTest.cpp index f08497c22f..8a21eb08cd 100644 --- a/wpilibc/src/test/native/cpp/simulation/DutyCycleEncoderSimTest.cpp +++ b/wpilibc/src/test/native/cpp/simulation/DutyCycleEncoderSimTest.cpp @@ -2,7 +2,7 @@ // 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/DutyCycleEncoderSim.hpp" // NOLINT(build/include_order) +#include "wpi/simulation/DutyCycleEncoderSim.hpp" #include diff --git a/wpilibc/src/test/native/cpp/simulation/DutyCycleSimTest.cpp b/wpilibc/src/test/native/cpp/simulation/DutyCycleSimTest.cpp index eadfc8fd3a..516d45ea7a 100644 --- a/wpilibc/src/test/native/cpp/simulation/DutyCycleSimTest.cpp +++ b/wpilibc/src/test/native/cpp/simulation/DutyCycleSimTest.cpp @@ -2,7 +2,7 @@ // 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/DutyCycleSim.hpp" // NOLINT(build/include_order) +#include "wpi/simulation/DutyCycleSim.hpp" #include diff --git a/wpilibc/src/test/native/cpp/simulation/ElevatorSimTest.cpp b/wpilibc/src/test/native/cpp/simulation/ElevatorSimTest.cpp index bfc64766d9..cdf24cfad2 100644 --- a/wpilibc/src/test/native/cpp/simulation/ElevatorSimTest.cpp +++ b/wpilibc/src/test/native/cpp/simulation/ElevatorSimTest.cpp @@ -2,6 +2,8 @@ // 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/ElevatorSim.hpp" + #include #include "wpi/hardware/motor/PWMVictorSPX.hpp" @@ -10,7 +12,6 @@ #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" diff --git a/wpilibc/src/test/native/cpp/simulation/EncoderSimTest.cpp b/wpilibc/src/test/native/cpp/simulation/EncoderSimTest.cpp index 97a578a229..5eb6ad17b7 100644 --- a/wpilibc/src/test/native/cpp/simulation/EncoderSimTest.cpp +++ b/wpilibc/src/test/native/cpp/simulation/EncoderSimTest.cpp @@ -2,7 +2,7 @@ // 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/EncoderSim.hpp" // NOLINT(build/include_order) +#include "wpi/simulation/EncoderSim.hpp" #include diff --git a/wpilibc/src/test/native/cpp/simulation/PWMMotorControlllerSimTest.cpp b/wpilibc/src/test/native/cpp/simulation/PWMMotorControlllerSimTest.cpp index 310b54e212..0dc9318ce0 100644 --- a/wpilibc/src/test/native/cpp/simulation/PWMMotorControlllerSimTest.cpp +++ b/wpilibc/src/test/native/cpp/simulation/PWMMotorControlllerSimTest.cpp @@ -2,7 +2,9 @@ // 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/PWMMotorControllerSim.hpp" // NOLINT(build/include_order) +// clang-format off +#include "wpi/simulation/PWMMotorControllerSim.hpp" +// clang-format on #include diff --git a/wpilibc/src/test/native/cpp/simulation/PWMSimTest.cpp b/wpilibc/src/test/native/cpp/simulation/PWMSimTest.cpp index e9986541f0..5994be7b60 100644 --- a/wpilibc/src/test/native/cpp/simulation/PWMSimTest.cpp +++ b/wpilibc/src/test/native/cpp/simulation/PWMSimTest.cpp @@ -2,7 +2,7 @@ // 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/PWMSim.hpp" // NOLINT(build/include_order) +#include "wpi/simulation/PWMSim.hpp" #include diff --git a/wpilibc/src/test/native/cpp/simulation/PDPSimTest.cpp b/wpilibc/src/test/native/cpp/simulation/PowerDistributionSimTest.cpp similarity index 97% rename from wpilibc/src/test/native/cpp/simulation/PDPSimTest.cpp rename to wpilibc/src/test/native/cpp/simulation/PowerDistributionSimTest.cpp index 3c329fcaf4..65d8c9a81c 100644 --- a/wpilibc/src/test/native/cpp/simulation/PDPSimTest.cpp +++ b/wpilibc/src/test/native/cpp/simulation/PowerDistributionSimTest.cpp @@ -2,7 +2,7 @@ // 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/PowerDistributionSim.hpp" // NOLINT(build/include_order) +#include "wpi/simulation/PowerDistributionSim.hpp" #include diff --git a/wpilibc/src/test/native/cpp/simulation/REVPHSimTest.cpp b/wpilibc/src/test/native/cpp/simulation/REVPHSimTest.cpp index 0016d17c8e..50b5969b48 100644 --- a/wpilibc/src/test/native/cpp/simulation/REVPHSimTest.cpp +++ b/wpilibc/src/test/native/cpp/simulation/REVPHSimTest.cpp @@ -2,7 +2,7 @@ // 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/REVPHSim.hpp" // NOLINT(build/include_order) +#include "wpi/simulation/REVPHSim.hpp" #include diff --git a/wpilibc/src/test/native/cpp/simulation/RoboRioSimTest.cpp b/wpilibc/src/test/native/cpp/simulation/RoboRioSimTest.cpp index 3dd4ba7c7d..23175bf43c 100644 --- a/wpilibc/src/test/native/cpp/simulation/RoboRioSimTest.cpp +++ b/wpilibc/src/test/native/cpp/simulation/RoboRioSimTest.cpp @@ -2,7 +2,7 @@ // 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/RoboRioSim.hpp" // NOLINT(build/include_order) +#include "wpi/simulation/RoboRioSim.hpp" #include diff --git a/wpilibc/src/test/native/cpp/simulation/SimDeviceSimTest.cpp b/wpilibc/src/test/native/cpp/simulation/SimDeviceSimTest.cpp index 832d46c35b..1690c3868e 100644 --- a/wpilibc/src/test/native/cpp/simulation/SimDeviceSimTest.cpp +++ b/wpilibc/src/test/native/cpp/simulation/SimDeviceSimTest.cpp @@ -2,12 +2,13 @@ // 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/SimDeviceSim.hpp" + #include #include #include "wpi/hal/SimDevice.h" -#include "wpi/simulation/SimDeviceSim.hpp" using namespace wpi::sim; diff --git a/wpilibc/src/test/native/cpp/simulation/SingleJointedArmSimTest.cpp b/wpilibc/src/test/native/cpp/simulation/SingleJointedArmSimTest.cpp index 25e6a3af65..caf7d64967 100644 --- a/wpilibc/src/test/native/cpp/simulation/SingleJointedArmSimTest.cpp +++ b/wpilibc/src/test/native/cpp/simulation/SingleJointedArmSimTest.cpp @@ -2,12 +2,12 @@ // 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/SingleJointedArmSim.hpp" + #include #include -#include "wpi/simulation/SingleJointedArmSim.hpp" - TEST(SingleJointedArmTest, Disabled) { wpi::sim::SingleJointedArmSim sim(wpi::math::DCMotor::Vex775Pro(2), 300, 3_kg_sq_m, 30_in, -180_deg, 0_deg, true, diff --git a/wpilibc/src/test/native/cpp/smartdashboard/Mechanism2dTest.cpp b/wpilibc/src/test/native/cpp/smartdashboard/Mechanism2dTest.cpp index 3d2713d2dd..6c8f00612c 100644 --- a/wpilibc/src/test/native/cpp/smartdashboard/Mechanism2dTest.cpp +++ b/wpilibc/src/test/native/cpp/smartdashboard/Mechanism2dTest.cpp @@ -2,10 +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 "wpi/smartdashboard/Mechanism2d.hpp" + #include #include "wpi/nt/NetworkTableInstance.hpp" -#include "wpi/smartdashboard/Mechanism2d.hpp" #include "wpi/smartdashboard/MechanismLigament2d.hpp" #include "wpi/smartdashboard/SmartDashboard.hpp" #include "wpi/units/angle.hpp" diff --git a/wpilibc/src/test/native/cpp/smartdashboard/SendableChooserTest.cpp b/wpilibc/src/test/native/cpp/smartdashboard/SendableChooserTest.cpp index 3cc09862d5..38d7949075 100644 --- a/wpilibc/src/test/native/cpp/smartdashboard/SendableChooserTest.cpp +++ b/wpilibc/src/test/native/cpp/smartdashboard/SendableChooserTest.cpp @@ -2,6 +2,8 @@ // 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/smartdashboard/SendableChooser.hpp" + #include #include @@ -10,7 +12,6 @@ #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 {}; diff --git a/wpilibc/src/test/native/cpp/util/Color8BitTest.cpp b/wpilibc/src/test/native/cpp/util/Color8BitTest.cpp index 08b834a6d2..a836e31dc8 100644 --- a/wpilibc/src/test/native/cpp/util/Color8BitTest.cpp +++ b/wpilibc/src/test/native/cpp/util/Color8BitTest.cpp @@ -2,12 +2,12 @@ // 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/util/Color8Bit.hpp" + #include #include -#include "wpi/util/Color8Bit.hpp" - TEST(Color8BitTest, ConstructDefault) { constexpr wpi::Color8Bit color; diff --git a/wpilibc/src/test/native/cpp/util/ColorTest.cpp b/wpilibc/src/test/native/cpp/util/ColorTest.cpp index 2d06cc8e1b..1c47e158eb 100644 --- a/wpilibc/src/test/native/cpp/util/ColorTest.cpp +++ b/wpilibc/src/test/native/cpp/util/ColorTest.cpp @@ -2,12 +2,12 @@ // 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/util/Color.hpp" + #include #include -#include "wpi/util/Color.hpp" - TEST(ColorTest, ConstructDefault) { constexpr wpi::Color color; diff --git a/wpilibcExamples/.styleguide b/wpilibcExamples/.styleguide index ccd3f561bb..de11fead83 100644 --- a/wpilibcExamples/.styleguide +++ b/wpilibcExamples/.styleguide @@ -7,9 +7,3 @@ cppHeaderFileInclude { cppSrcFileInclude { \.cpp$ } - -includeOtherLibs { - ^fmt/ - ^gtest/ - ^opencv2/ -} diff --git a/wpilibcExamples/src/test/cpp/examples/UnitTest/cpp/subsystems/IntakeTest.cpp b/wpilibcExamples/src/test/cpp/examples/UnitTest/cpp/subsystems/IntakeTest.cpp index cb92d5ecfa..928ca954d1 100644 --- a/wpilibcExamples/src/test/cpp/examples/UnitTest/cpp/subsystems/IntakeTest.cpp +++ b/wpilibcExamples/src/test/cpp/examples/UnitTest/cpp/subsystems/IntakeTest.cpp @@ -2,10 +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 "subsystems/Intake.hpp" + #include #include "Constants.hpp" -#include "subsystems/Intake.hpp" #include "wpi/hardware/pneumatic/DoubleSolenoid.hpp" #include "wpi/simulation/DoubleSolenoidSim.hpp" #include "wpi/simulation/PWMMotorControllerSim.hpp" diff --git a/wpimath/.styleguide b/wpimath/.styleguide index 54f810c398..cfab55fb50 100644 --- a/wpimath/.styleguide +++ b/wpimath/.styleguide @@ -34,16 +34,3 @@ includeGuardRoots { wpimath/src/main/native/include/ wpimath/src/test/native/cpp/ } - -includeOtherLibs { - ^Eigen/ - ^fmt/ - ^gcem/ - ^gtest/ - ^sleipnir/ - ^unsupported/ -} - -includeProject { - wpi/util/expected -} diff --git a/wpimath/src/main/native/include/wpi/math/geometry/Pose2d.hpp b/wpimath/src/main/native/include/wpi/math/geometry/Pose2d.hpp index 2e607d98ec..a52bd83d8b 100644 --- a/wpimath/src/main/native/include/wpi/math/geometry/Pose2d.hpp +++ b/wpimath/src/main/native/include/wpi/math/geometry/Pose2d.hpp @@ -273,11 +273,10 @@ void from_json(const wpi::util::json& json, Pose2d& pose); } // namespace wpi::math +#include "wpi/math/geometry/Transform2d.hpp" #include "wpi/math/geometry/proto/Pose2dProto.hpp" #include "wpi/math/geometry/struct/Pose2dStruct.hpp" -#include "wpi/math/geometry/Transform2d.hpp" - namespace wpi::math { constexpr Transform2d Pose2d::operator-(const Pose2d& other) const { diff --git a/wpimath/src/test/native/cpp/ComputerVisionUtilTest.cpp b/wpimath/src/test/native/cpp/ComputerVisionUtilTest.cpp index dc152ba3d7..6ae3416a98 100644 --- a/wpimath/src/test/native/cpp/ComputerVisionUtilTest.cpp +++ b/wpimath/src/test/native/cpp/ComputerVisionUtilTest.cpp @@ -2,10 +2,10 @@ // 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 - #include "wpi/math/util/ComputerVisionUtil.hpp" +#include + TEST(ComputerVisionUtilTest, ObjectToRobotPose) { wpi::math::Pose3d robot{1_m, 2_m, 0_m, wpi::math::Rotation3d{0_deg, 0_deg, 30_deg}}; diff --git a/wpimath/src/test/native/cpp/DARETest.cpp b/wpimath/src/test/native/cpp/DARETest.cpp index 90a807d36d..9ed2af0de9 100644 --- a/wpimath/src/test/native/cpp/DARETest.cpp +++ b/wpimath/src/test/native/cpp/DARETest.cpp @@ -2,6 +2,8 @@ // 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/math/linalg/DARE.hpp" + #include #include @@ -9,7 +11,6 @@ #include #include "wpi/math/fmt/Eigen.hpp" -#include "wpi/math/linalg/DARE.hpp" #include "wpi/math/linalg/EigenCore.hpp" #include "wpi/util/expected" #include "wpi/util/print.hpp" diff --git a/wpimath/src/test/native/cpp/MathUtilTest.cpp b/wpimath/src/test/native/cpp/MathUtilTest.cpp index fe76c155ca..cb598a18bc 100644 --- a/wpimath/src/test/native/cpp/MathUtilTest.cpp +++ b/wpimath/src/test/native/cpp/MathUtilTest.cpp @@ -2,6 +2,8 @@ // 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/math/util/MathUtil.hpp" + #include #include @@ -9,7 +11,6 @@ #include "wpi/math/geometry/Translation2d.hpp" #include "wpi/math/geometry/Translation3d.hpp" -#include "wpi/math/util/MathUtil.hpp" #include "wpi/units/angle.hpp" #include "wpi/units/length.hpp" #include "wpi/units/time.hpp" diff --git a/wpimath/src/test/native/cpp/StateSpaceUtilTest.cpp b/wpimath/src/test/native/cpp/StateSpaceUtilTest.cpp index 1db8693332..bc564d6520 100644 --- a/wpimath/src/test/native/cpp/StateSpaceUtilTest.cpp +++ b/wpimath/src/test/native/cpp/StateSpaceUtilTest.cpp @@ -2,10 +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 "wpi/math/util/StateSpaceUtil.hpp" + #include #include "wpi/math/linalg/EigenCore.hpp" -#include "wpi/math/util/StateSpaceUtil.hpp" TEST(StateSpaceUtilTest, CostParameterPack) { constexpr wpi::math::Matrixd<3, 3> mat = diff --git a/wpimath/src/test/native/cpp/controller/ArmFeedforwardTest.cpp b/wpimath/src/test/native/cpp/controller/ArmFeedforwardTest.cpp index b0fd8f09c8..c4f75d2ef6 100644 --- a/wpimath/src/test/native/cpp/controller/ArmFeedforwardTest.cpp +++ b/wpimath/src/test/native/cpp/controller/ArmFeedforwardTest.cpp @@ -2,12 +2,13 @@ // 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/math/controller/ArmFeedforward.hpp" + #include #include #include -#include "wpi/math/controller/ArmFeedforward.hpp" #include "wpi/math/linalg/EigenCore.hpp" #include "wpi/math/system/NumericalIntegration.hpp" #include "wpi/units/angular_acceleration.hpp" diff --git a/wpimath/src/test/native/cpp/controller/ControlAffinePlantInversionFeedforwardTest.cpp b/wpimath/src/test/native/cpp/controller/ControlAffinePlantInversionFeedforwardTest.cpp index 93227a758f..f4f8d92e18 100644 --- a/wpimath/src/test/native/cpp/controller/ControlAffinePlantInversionFeedforwardTest.cpp +++ b/wpimath/src/test/native/cpp/controller/ControlAffinePlantInversionFeedforwardTest.cpp @@ -2,9 +2,10 @@ // 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/math/controller/ControlAffinePlantInversionFeedforward.hpp" + #include -#include "wpi/math/controller/ControlAffinePlantInversionFeedforward.hpp" #include "wpi/math/linalg/EigenCore.hpp" #include "wpi/units/time.hpp" diff --git a/wpimath/src/test/native/cpp/controller/DifferentialDriveAccelerationLimiterTest.cpp b/wpimath/src/test/native/cpp/controller/DifferentialDriveAccelerationLimiterTest.cpp index 17ed3a4f09..f30ababa58 100644 --- a/wpimath/src/test/native/cpp/controller/DifferentialDriveAccelerationLimiterTest.cpp +++ b/wpimath/src/test/native/cpp/controller/DifferentialDriveAccelerationLimiterTest.cpp @@ -2,9 +2,10 @@ // 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/math/controller/DifferentialDriveAccelerationLimiter.hpp" + #include -#include "wpi/math/controller/DifferentialDriveAccelerationLimiter.hpp" #include "wpi/math/system/plant/LinearSystemId.hpp" #include "wpi/units/math.hpp" diff --git a/wpimath/src/test/native/cpp/controller/DifferentialDriveFeedforwardTest.cpp b/wpimath/src/test/native/cpp/controller/DifferentialDriveFeedforwardTest.cpp index fd838efb5e..ef481e1f97 100644 --- a/wpimath/src/test/native/cpp/controller/DifferentialDriveFeedforwardTest.cpp +++ b/wpimath/src/test/native/cpp/controller/DifferentialDriveFeedforwardTest.cpp @@ -2,12 +2,13 @@ // 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/math/controller/DifferentialDriveFeedforward.hpp" + #include #include #include -#include "wpi/math/controller/DifferentialDriveFeedforward.hpp" #include "wpi/math/controller/LinearPlantInversionFeedforward.hpp" #include "wpi/math/system/plant/LinearSystemId.hpp" #include "wpi/units/acceleration.hpp" diff --git a/wpimath/src/test/native/cpp/controller/ElevatorFeedforwardTest.cpp b/wpimath/src/test/native/cpp/controller/ElevatorFeedforwardTest.cpp index 3ef46491aa..09e187c707 100644 --- a/wpimath/src/test/native/cpp/controller/ElevatorFeedforwardTest.cpp +++ b/wpimath/src/test/native/cpp/controller/ElevatorFeedforwardTest.cpp @@ -2,11 +2,12 @@ // 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/math/controller/ElevatorFeedforward.hpp" + #include #include -#include "wpi/math/controller/ElevatorFeedforward.hpp" #include "wpi/math/controller/LinearPlantInversionFeedforward.hpp" #include "wpi/math/linalg/EigenCore.hpp" #include "wpi/units/acceleration.hpp" diff --git a/wpimath/src/test/native/cpp/controller/ImplicitModelFollowerTest.cpp b/wpimath/src/test/native/cpp/controller/ImplicitModelFollowerTest.cpp index 97472a9494..d87dbbbbe9 100644 --- a/wpimath/src/test/native/cpp/controller/ImplicitModelFollowerTest.cpp +++ b/wpimath/src/test/native/cpp/controller/ImplicitModelFollowerTest.cpp @@ -2,9 +2,10 @@ // 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/math/controller/ImplicitModelFollower.hpp" + #include -#include "wpi/math/controller/ImplicitModelFollower.hpp" #include "wpi/math/system/plant/LinearSystemId.hpp" namespace wpi::math { diff --git a/wpimath/src/test/native/cpp/controller/LTVDifferentialDriveControllerTest.cpp b/wpimath/src/test/native/cpp/controller/LTVDifferentialDriveControllerTest.cpp index 7a4eaf723a..a9161790c1 100644 --- a/wpimath/src/test/native/cpp/controller/LTVDifferentialDriveControllerTest.cpp +++ b/wpimath/src/test/native/cpp/controller/LTVDifferentialDriveControllerTest.cpp @@ -2,11 +2,12 @@ // 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/math/controller/LTVDifferentialDriveController.hpp" + #include #include -#include "wpi/math/controller/LTVDifferentialDriveController.hpp" #include "wpi/math/system/NumericalIntegration.hpp" #include "wpi/math/system/plant/LinearSystemId.hpp" #include "wpi/math/trajectory/TrajectoryGenerator.hpp" diff --git a/wpimath/src/test/native/cpp/controller/LTVUnicycleControllerTest.cpp b/wpimath/src/test/native/cpp/controller/LTVUnicycleControllerTest.cpp index a20b9a02f7..51f8a9a977 100644 --- a/wpimath/src/test/native/cpp/controller/LTVUnicycleControllerTest.cpp +++ b/wpimath/src/test/native/cpp/controller/LTVUnicycleControllerTest.cpp @@ -2,9 +2,10 @@ // 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/math/controller/LTVUnicycleController.hpp" + #include -#include "wpi/math/controller/LTVUnicycleController.hpp" #include "wpi/math/trajectory/TrajectoryGenerator.hpp" #include "wpi/math/util/MathUtil.hpp" #include "wpi/units/math.hpp" diff --git a/wpimath/src/test/native/cpp/controller/LinearPlantInversionFeedforwardTest.cpp b/wpimath/src/test/native/cpp/controller/LinearPlantInversionFeedforwardTest.cpp index e5f877e974..da2a0a3494 100644 --- a/wpimath/src/test/native/cpp/controller/LinearPlantInversionFeedforwardTest.cpp +++ b/wpimath/src/test/native/cpp/controller/LinearPlantInversionFeedforwardTest.cpp @@ -2,11 +2,12 @@ // 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/math/controller/LinearPlantInversionFeedforward.hpp" + #include #include -#include "wpi/math/controller/LinearPlantInversionFeedforward.hpp" #include "wpi/math/linalg/EigenCore.hpp" #include "wpi/units/time.hpp" diff --git a/wpimath/src/test/native/cpp/controller/LinearQuadraticRegulatorTest.cpp b/wpimath/src/test/native/cpp/controller/LinearQuadraticRegulatorTest.cpp index 5f9630f5cb..5f5f3c6266 100644 --- a/wpimath/src/test/native/cpp/controller/LinearQuadraticRegulatorTest.cpp +++ b/wpimath/src/test/native/cpp/controller/LinearQuadraticRegulatorTest.cpp @@ -2,11 +2,12 @@ // 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/math/controller/LinearQuadraticRegulator.hpp" + #include #include -#include "wpi/math/controller/LinearQuadraticRegulator.hpp" #include "wpi/math/linalg/EigenCore.hpp" #include "wpi/math/system/LinearSystem.hpp" #include "wpi/math/system/plant/DCMotor.hpp" diff --git a/wpimath/src/test/native/cpp/controller/SimpleMotorFeedforwardTest.cpp b/wpimath/src/test/native/cpp/controller/SimpleMotorFeedforwardTest.cpp index fe2d6a5cd9..1e6da06d99 100644 --- a/wpimath/src/test/native/cpp/controller/SimpleMotorFeedforwardTest.cpp +++ b/wpimath/src/test/native/cpp/controller/SimpleMotorFeedforwardTest.cpp @@ -2,12 +2,13 @@ // 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/math/controller/SimpleMotorFeedforward.hpp" + #include #include #include "wpi/math/controller/LinearPlantInversionFeedforward.hpp" -#include "wpi/math/controller/SimpleMotorFeedforward.hpp" #include "wpi/math/linalg/EigenCore.hpp" #include "wpi/units/acceleration.hpp" #include "wpi/units/length.hpp" diff --git a/wpimath/src/test/native/cpp/controller/proto/SimpleMotorFeedforwardProtoTest.cpp b/wpimath/src/test/native/cpp/controller/proto/SimpleMotorFeedforwardProtoTest.cpp index 3c4d88b08c..86254c57f2 100644 --- a/wpimath/src/test/native/cpp/controller/proto/SimpleMotorFeedforwardProtoTest.cpp +++ b/wpimath/src/test/native/cpp/controller/proto/SimpleMotorFeedforwardProtoTest.cpp @@ -2,11 +2,12 @@ // 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/math/controller/proto/SimpleMotorFeedforwardProto.hpp" + #include #include "../../ProtoTestBase.hpp" #include "wpi/math/controller/SimpleMotorFeedforward.hpp" -#include "wpi/math/controller/proto/SimpleMotorFeedforwardProto.hpp" #include "wpi/units/acceleration.hpp" #include "wpi/units/velocity.hpp" diff --git a/wpimath/src/test/native/cpp/controller/struct/SimpleMotorFeedforwardStructTest.cpp b/wpimath/src/test/native/cpp/controller/struct/SimpleMotorFeedforwardStructTest.cpp index 4af8e6e1aa..41395d0c6e 100644 --- a/wpimath/src/test/native/cpp/controller/struct/SimpleMotorFeedforwardStructTest.cpp +++ b/wpimath/src/test/native/cpp/controller/struct/SimpleMotorFeedforwardStructTest.cpp @@ -2,11 +2,12 @@ // 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/math/controller/struct/SimpleMotorFeedforwardStruct.hpp" + #include #include "../../StructTestBase.hpp" #include "wpi/math/controller/SimpleMotorFeedforward.hpp" -#include "wpi/math/controller/struct/SimpleMotorFeedforwardStruct.hpp" #include "wpi/units/acceleration.hpp" #include "wpi/units/velocity.hpp" diff --git a/wpimath/src/test/native/cpp/estimator/AngleStatisticsTest.cpp b/wpimath/src/test/native/cpp/estimator/AngleStatisticsTest.cpp index 7a38ae44ad..ee2eae13d7 100644 --- a/wpimath/src/test/native/cpp/estimator/AngleStatisticsTest.cpp +++ b/wpimath/src/test/native/cpp/estimator/AngleStatisticsTest.cpp @@ -2,11 +2,12 @@ // 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/math/estimator/AngleStatistics.hpp" + #include #include -#include "wpi/math/estimator/AngleStatistics.hpp" #include "wpi/math/linalg/EigenCore.hpp" TEST(AngleStatisticsTest, Mean) { diff --git a/wpimath/src/test/native/cpp/estimator/DifferentialDrivePoseEstimator3dTest.cpp b/wpimath/src/test/native/cpp/estimator/DifferentialDrivePoseEstimator3dTest.cpp index 490be7dff7..24d366e7af 100644 --- a/wpimath/src/test/native/cpp/estimator/DifferentialDrivePoseEstimator3dTest.cpp +++ b/wpimath/src/test/native/cpp/estimator/DifferentialDrivePoseEstimator3dTest.cpp @@ -2,6 +2,8 @@ // 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/math/estimator/DifferentialDrivePoseEstimator3d.hpp" + #include #include #include @@ -10,7 +12,6 @@ #include -#include "wpi/math/estimator/DifferentialDrivePoseEstimator3d.hpp" #include "wpi/math/geometry/Pose2d.hpp" #include "wpi/math/geometry/Rotation2d.hpp" #include "wpi/math/kinematics/DifferentialDriveKinematics.hpp" diff --git a/wpimath/src/test/native/cpp/estimator/DifferentialDrivePoseEstimatorTest.cpp b/wpimath/src/test/native/cpp/estimator/DifferentialDrivePoseEstimatorTest.cpp index 591fa59d57..0bfb579c0e 100644 --- a/wpimath/src/test/native/cpp/estimator/DifferentialDrivePoseEstimatorTest.cpp +++ b/wpimath/src/test/native/cpp/estimator/DifferentialDrivePoseEstimatorTest.cpp @@ -2,6 +2,8 @@ // 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/math/estimator/DifferentialDrivePoseEstimator.hpp" + #include #include #include @@ -11,7 +13,6 @@ #include -#include "wpi/math/estimator/DifferentialDrivePoseEstimator.hpp" #include "wpi/math/geometry/Pose2d.hpp" #include "wpi/math/geometry/Rotation2d.hpp" #include "wpi/math/kinematics/DifferentialDriveKinematics.hpp" diff --git a/wpimath/src/test/native/cpp/estimator/ExtendedKalmanFilterTest.cpp b/wpimath/src/test/native/cpp/estimator/ExtendedKalmanFilterTest.cpp index 83c2ad3875..85b2e20ccb 100644 --- a/wpimath/src/test/native/cpp/estimator/ExtendedKalmanFilterTest.cpp +++ b/wpimath/src/test/native/cpp/estimator/ExtendedKalmanFilterTest.cpp @@ -2,13 +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 "wpi/math/estimator/ExtendedKalmanFilter.hpp" + #include #include #include #include -#include "wpi/math/estimator/ExtendedKalmanFilter.hpp" #include "wpi/math/linalg/EigenCore.hpp" #include "wpi/math/system/NumericalJacobian.hpp" #include "wpi/math/system/plant/DCMotor.hpp" diff --git a/wpimath/src/test/native/cpp/estimator/KalmanFilterTest.cpp b/wpimath/src/test/native/cpp/estimator/KalmanFilterTest.cpp index 21366f928a..a2fef6ebe8 100644 --- a/wpimath/src/test/native/cpp/estimator/KalmanFilterTest.cpp +++ b/wpimath/src/test/native/cpp/estimator/KalmanFilterTest.cpp @@ -2,13 +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 "wpi/math/estimator/KalmanFilter.hpp" + #include #include #include #include -#include "wpi/math/estimator/KalmanFilter.hpp" #include "wpi/math/system/plant/DCMotor.hpp" #include "wpi/math/system/plant/LinearSystemId.hpp" #include "wpi/units/moment_of_inertia.hpp" diff --git a/wpimath/src/test/native/cpp/estimator/MecanumDrivePoseEstimator3dTest.cpp b/wpimath/src/test/native/cpp/estimator/MecanumDrivePoseEstimator3dTest.cpp index 52c19139c2..e35cf9f685 100644 --- a/wpimath/src/test/native/cpp/estimator/MecanumDrivePoseEstimator3dTest.cpp +++ b/wpimath/src/test/native/cpp/estimator/MecanumDrivePoseEstimator3dTest.cpp @@ -2,6 +2,8 @@ // 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/math/estimator/MecanumDrivePoseEstimator3d.hpp" + #include #include #include @@ -9,7 +11,6 @@ #include -#include "wpi/math/estimator/MecanumDrivePoseEstimator3d.hpp" #include "wpi/math/geometry/Pose2d.hpp" #include "wpi/math/kinematics/MecanumDriveKinematics.hpp" #include "wpi/math/trajectory/TrajectoryGenerator.hpp" diff --git a/wpimath/src/test/native/cpp/estimator/MecanumDrivePoseEstimatorTest.cpp b/wpimath/src/test/native/cpp/estimator/MecanumDrivePoseEstimatorTest.cpp index aea20babc3..e97e467584 100644 --- a/wpimath/src/test/native/cpp/estimator/MecanumDrivePoseEstimatorTest.cpp +++ b/wpimath/src/test/native/cpp/estimator/MecanumDrivePoseEstimatorTest.cpp @@ -2,6 +2,8 @@ // 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/math/estimator/MecanumDrivePoseEstimator.hpp" + #include #include #include @@ -10,7 +12,6 @@ #include -#include "wpi/math/estimator/MecanumDrivePoseEstimator.hpp" #include "wpi/math/geometry/Pose2d.hpp" #include "wpi/math/kinematics/MecanumDriveKinematics.hpp" #include "wpi/math/trajectory/TrajectoryGenerator.hpp" diff --git a/wpimath/src/test/native/cpp/estimator/MerweScaledSigmaPointsTest.cpp b/wpimath/src/test/native/cpp/estimator/MerweScaledSigmaPointsTest.cpp index 698974d46a..40bd14c422 100644 --- a/wpimath/src/test/native/cpp/estimator/MerweScaledSigmaPointsTest.cpp +++ b/wpimath/src/test/native/cpp/estimator/MerweScaledSigmaPointsTest.cpp @@ -2,10 +2,10 @@ // 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 - #include "wpi/math/estimator/MerweScaledSigmaPoints.hpp" +#include + TEST(MerweScaledSigmaPointsTest, ZeroMean) { wpi::math::MerweScaledSigmaPoints<2> sigmaPoints; auto points = sigmaPoints.SquareRootSigmaPoints( diff --git a/wpimath/src/test/native/cpp/estimator/MerweUKFTest.cpp b/wpimath/src/test/native/cpp/estimator/MerweUKFTest.cpp index 06725c78bb..b61c147aa2 100644 --- a/wpimath/src/test/native/cpp/estimator/MerweUKFTest.cpp +++ b/wpimath/src/test/native/cpp/estimator/MerweUKFTest.cpp @@ -2,6 +2,8 @@ // 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/math/estimator/MerweUKF.hpp" + #include #include #include @@ -11,7 +13,6 @@ #include #include "wpi/math/estimator/AngleStatistics.hpp" -#include "wpi/math/estimator/MerweUKF.hpp" #include "wpi/math/linalg/EigenCore.hpp" #include "wpi/math/system/Discretization.hpp" #include "wpi/math/system/NumericalIntegration.hpp" diff --git a/wpimath/src/test/native/cpp/estimator/S3SigmaPointsTest.cpp b/wpimath/src/test/native/cpp/estimator/S3SigmaPointsTest.cpp index 5d3e47d348..b270fda83f 100644 --- a/wpimath/src/test/native/cpp/estimator/S3SigmaPointsTest.cpp +++ b/wpimath/src/test/native/cpp/estimator/S3SigmaPointsTest.cpp @@ -2,10 +2,10 @@ // 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 - #include "wpi/math/estimator/S3SigmaPoints.hpp" +#include + TEST(S3SigmaPointsTest, Simplex) { constexpr double alpha = 1e-3; constexpr double beta = 2; diff --git a/wpimath/src/test/native/cpp/estimator/S3UKFTest.cpp b/wpimath/src/test/native/cpp/estimator/S3UKFTest.cpp index 7d4c4df576..c03fb1007f 100644 --- a/wpimath/src/test/native/cpp/estimator/S3UKFTest.cpp +++ b/wpimath/src/test/native/cpp/estimator/S3UKFTest.cpp @@ -2,6 +2,8 @@ // 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/math/estimator/S3UKF.hpp" + #include #include #include @@ -11,7 +13,6 @@ #include #include "wpi/math/estimator/AngleStatistics.hpp" -#include "wpi/math/estimator/S3UKF.hpp" #include "wpi/math/linalg/EigenCore.hpp" #include "wpi/math/system/Discretization.hpp" #include "wpi/math/system/NumericalIntegration.hpp" diff --git a/wpimath/src/test/native/cpp/estimator/SwerveDrivePoseEstimator3dTest.cpp b/wpimath/src/test/native/cpp/estimator/SwerveDrivePoseEstimator3dTest.cpp index 7130b70afc..94c9678670 100644 --- a/wpimath/src/test/native/cpp/estimator/SwerveDrivePoseEstimator3dTest.cpp +++ b/wpimath/src/test/native/cpp/estimator/SwerveDrivePoseEstimator3dTest.cpp @@ -2,6 +2,8 @@ // 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/math/estimator/SwerveDrivePoseEstimator3d.hpp" + #include #include #include @@ -10,7 +12,6 @@ #include #include -#include "wpi/math/estimator/SwerveDrivePoseEstimator3d.hpp" #include "wpi/math/geometry/Pose2d.hpp" #include "wpi/math/kinematics/SwerveDriveKinematics.hpp" #include "wpi/math/trajectory/TrajectoryGenerator.hpp" diff --git a/wpimath/src/test/native/cpp/estimator/SwerveDrivePoseEstimatorTest.cpp b/wpimath/src/test/native/cpp/estimator/SwerveDrivePoseEstimatorTest.cpp index e15b72bede..1af5fe0936 100644 --- a/wpimath/src/test/native/cpp/estimator/SwerveDrivePoseEstimatorTest.cpp +++ b/wpimath/src/test/native/cpp/estimator/SwerveDrivePoseEstimatorTest.cpp @@ -2,6 +2,8 @@ // 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/math/estimator/SwerveDrivePoseEstimator.hpp" + #include #include #include @@ -11,7 +13,6 @@ #include #include -#include "wpi/math/estimator/SwerveDrivePoseEstimator.hpp" #include "wpi/math/geometry/Pose2d.hpp" #include "wpi/math/kinematics/SwerveDriveKinematics.hpp" #include "wpi/math/trajectory/TrajectoryGenerator.hpp" diff --git a/wpimath/src/test/native/cpp/filter/DebouncerTest.cpp b/wpimath/src/test/native/cpp/filter/DebouncerTest.cpp index 4fb211bca9..5921f5bd71 100644 --- a/wpimath/src/test/native/cpp/filter/DebouncerTest.cpp +++ b/wpimath/src/test/native/cpp/filter/DebouncerTest.cpp @@ -2,9 +2,10 @@ // 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/math/filter/Debouncer.hpp" + #include -#include "wpi/math/filter/Debouncer.hpp" #include "wpi/units/time.hpp" #include "wpi/util/timestamp.h" diff --git a/wpimath/src/test/native/cpp/filter/LinearFilterNoiseTest.cpp b/wpimath/src/test/native/cpp/filter/LinearFilterNoiseTest.cpp index 192d62f01d..94844f4bc1 100644 --- a/wpimath/src/test/native/cpp/filter/LinearFilterNoiseTest.cpp +++ b/wpimath/src/test/native/cpp/filter/LinearFilterNoiseTest.cpp @@ -2,7 +2,9 @@ // 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/math/filter/LinearFilter.hpp" // NOLINT(build/include_order) +// clang-format off +#include "wpi/math/filter/LinearFilter.hpp" +// clang-format on #include #include diff --git a/wpimath/src/test/native/cpp/filter/LinearFilterOutputTest.cpp b/wpimath/src/test/native/cpp/filter/LinearFilterOutputTest.cpp index 3f30838c67..1577cdae45 100644 --- a/wpimath/src/test/native/cpp/filter/LinearFilterOutputTest.cpp +++ b/wpimath/src/test/native/cpp/filter/LinearFilterOutputTest.cpp @@ -2,7 +2,9 @@ // 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/math/filter/LinearFilter.hpp" // NOLINT(build/include_order) +// clang-format off +#include "wpi/math/filter/LinearFilter.hpp" +// clang-format on #include #include diff --git a/wpimath/src/test/native/cpp/filter/MedianFilterTest.cpp b/wpimath/src/test/native/cpp/filter/MedianFilterTest.cpp index 6718e76429..d6ff8dac52 100644 --- a/wpimath/src/test/native/cpp/filter/MedianFilterTest.cpp +++ b/wpimath/src/test/native/cpp/filter/MedianFilterTest.cpp @@ -2,10 +2,10 @@ // 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 - #include "wpi/math/filter/MedianFilter.hpp" +#include + TEST(MedianFilterTest, MedianFilterNotFullTestEven) { wpi::math::MedianFilter filter{10}; diff --git a/wpimath/src/test/native/cpp/filter/SlewRateLimiterTest.cpp b/wpimath/src/test/native/cpp/filter/SlewRateLimiterTest.cpp index d531b0987d..ee4254fb80 100644 --- a/wpimath/src/test/native/cpp/filter/SlewRateLimiterTest.cpp +++ b/wpimath/src/test/native/cpp/filter/SlewRateLimiterTest.cpp @@ -2,9 +2,10 @@ // 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/math/filter/SlewRateLimiter.hpp" + #include -#include "wpi/math/filter/SlewRateLimiter.hpp" #include "wpi/units/length.hpp" #include "wpi/units/time.hpp" #include "wpi/units/velocity.hpp" diff --git a/wpimath/src/test/native/cpp/geometry/CoordinateSystemTest.cpp b/wpimath/src/test/native/cpp/geometry/CoordinateSystemTest.cpp index 13aaf8a4e2..bb6f96483b 100644 --- a/wpimath/src/test/native/cpp/geometry/CoordinateSystemTest.cpp +++ b/wpimath/src/test/native/cpp/geometry/CoordinateSystemTest.cpp @@ -2,9 +2,10 @@ // 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/math/geometry/CoordinateSystem.hpp" + #include -#include "wpi/math/geometry/CoordinateSystem.hpp" #include "wpi/math/geometry/Pose3d.hpp" #include "wpi/math/geometry/Transform3d.hpp" diff --git a/wpimath/src/test/native/cpp/geometry/Ellipse2dTest.cpp b/wpimath/src/test/native/cpp/geometry/Ellipse2dTest.cpp index 57db84452f..554d530588 100644 --- a/wpimath/src/test/native/cpp/geometry/Ellipse2dTest.cpp +++ b/wpimath/src/test/native/cpp/geometry/Ellipse2dTest.cpp @@ -2,10 +2,10 @@ // 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 - #include "wpi/math/geometry/Ellipse2d.hpp" +#include + TEST(Ellipse2dTest, FocalPoints) { constexpr wpi::math::Pose2d center{1_m, 2_m, 0_deg}; constexpr wpi::math::Ellipse2d ellipse{center, 5_m, 4_m}; diff --git a/wpimath/src/test/native/cpp/geometry/Pose2dTest.cpp b/wpimath/src/test/native/cpp/geometry/Pose2dTest.cpp index da60baa3b0..c09eef775d 100644 --- a/wpimath/src/test/native/cpp/geometry/Pose2dTest.cpp +++ b/wpimath/src/test/native/cpp/geometry/Pose2dTest.cpp @@ -2,13 +2,13 @@ // 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/math/geometry/Pose2d.hpp" + #include #include #include -#include "wpi/math/geometry/Pose2d.hpp" - using namespace wpi::math; TEST(Pose2dTest, RotateBy) { diff --git a/wpimath/src/test/native/cpp/geometry/Pose3dTest.cpp b/wpimath/src/test/native/cpp/geometry/Pose3dTest.cpp index b4de673983..8df93d7463 100644 --- a/wpimath/src/test/native/cpp/geometry/Pose3dTest.cpp +++ b/wpimath/src/test/native/cpp/geometry/Pose3dTest.cpp @@ -2,11 +2,12 @@ // 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/math/geometry/Pose3d.hpp" + #include #include -#include "wpi/math/geometry/Pose3d.hpp" #include "wpi/util/array.hpp" using namespace wpi::math; diff --git a/wpimath/src/test/native/cpp/geometry/QuaternionTest.cpp b/wpimath/src/test/native/cpp/geometry/QuaternionTest.cpp index 491b61758c..ccde8705e7 100644 --- a/wpimath/src/test/native/cpp/geometry/QuaternionTest.cpp +++ b/wpimath/src/test/native/cpp/geometry/QuaternionTest.cpp @@ -2,11 +2,12 @@ // 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/math/geometry/Quaternion.hpp" + #include #include -#include "wpi/math/geometry/Quaternion.hpp" #include "wpi/units/angle.hpp" #include "wpi/units/math.hpp" diff --git a/wpimath/src/test/native/cpp/geometry/Rectangle2dTest.cpp b/wpimath/src/test/native/cpp/geometry/Rectangle2dTest.cpp index e74ce4fa48..6cc55b5371 100644 --- a/wpimath/src/test/native/cpp/geometry/Rectangle2dTest.cpp +++ b/wpimath/src/test/native/cpp/geometry/Rectangle2dTest.cpp @@ -2,10 +2,10 @@ // 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 - #include "wpi/math/geometry/Rectangle2d.hpp" +#include + TEST(Rectangle2dTest, NewWithCorners) { constexpr wpi::math::Translation2d cornerA{1_m, 2_m}; constexpr wpi::math::Translation2d cornerB{4_m, 6_m}; diff --git a/wpimath/src/test/native/cpp/geometry/Rotation2dTest.cpp b/wpimath/src/test/native/cpp/geometry/Rotation2dTest.cpp index 133f76ea41..adff2f9850 100644 --- a/wpimath/src/test/native/cpp/geometry/Rotation2dTest.cpp +++ b/wpimath/src/test/native/cpp/geometry/Rotation2dTest.cpp @@ -2,13 +2,13 @@ // 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/math/geometry/Rotation2d.hpp" + #include #include #include -#include "wpi/math/geometry/Rotation2d.hpp" - using namespace wpi::math; TEST(Rotation2dTest, RadiansToDegrees) { diff --git a/wpimath/src/test/native/cpp/geometry/Rotation3dTest.cpp b/wpimath/src/test/native/cpp/geometry/Rotation3dTest.cpp index 81279d5824..f8bc7f4c4d 100644 --- a/wpimath/src/test/native/cpp/geometry/Rotation3dTest.cpp +++ b/wpimath/src/test/native/cpp/geometry/Rotation3dTest.cpp @@ -2,13 +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 "wpi/math/geometry/Rotation3d.hpp" + #include #include #include #include -#include "wpi/math/geometry/Rotation3d.hpp" #include "wpi/util/MathExtras.hpp" using namespace wpi::math; diff --git a/wpimath/src/test/native/cpp/geometry/Transform2dTest.cpp b/wpimath/src/test/native/cpp/geometry/Transform2dTest.cpp index 2c2e79a311..dd76a93a14 100644 --- a/wpimath/src/test/native/cpp/geometry/Transform2dTest.cpp +++ b/wpimath/src/test/native/cpp/geometry/Transform2dTest.cpp @@ -2,13 +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 "wpi/math/geometry/Transform2d.hpp" + #include #include #include "wpi/math/geometry/Pose2d.hpp" #include "wpi/math/geometry/Rotation2d.hpp" -#include "wpi/math/geometry/Transform2d.hpp" #include "wpi/math/geometry/Translation2d.hpp" using namespace wpi::math; diff --git a/wpimath/src/test/native/cpp/geometry/Transform3dTest.cpp b/wpimath/src/test/native/cpp/geometry/Transform3dTest.cpp index ce6e0d66c4..000d089fb3 100644 --- a/wpimath/src/test/native/cpp/geometry/Transform3dTest.cpp +++ b/wpimath/src/test/native/cpp/geometry/Transform3dTest.cpp @@ -2,13 +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 "wpi/math/geometry/Transform3d.hpp" + #include #include #include "wpi/math/geometry/Pose3d.hpp" #include "wpi/math/geometry/Rotation3d.hpp" -#include "wpi/math/geometry/Transform3d.hpp" #include "wpi/math/geometry/Translation3d.hpp" using namespace wpi::math; diff --git a/wpimath/src/test/native/cpp/geometry/Translation2dTest.cpp b/wpimath/src/test/native/cpp/geometry/Translation2dTest.cpp index 60814600c6..5c51a09a5a 100644 --- a/wpimath/src/test/native/cpp/geometry/Translation2dTest.cpp +++ b/wpimath/src/test/native/cpp/geometry/Translation2dTest.cpp @@ -2,12 +2,12 @@ // 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/math/geometry/Translation2d.hpp" + #include #include -#include "wpi/math/geometry/Translation2d.hpp" - using namespace wpi::math; TEST(Translation2dTest, Sum) { diff --git a/wpimath/src/test/native/cpp/geometry/Translation3dTest.cpp b/wpimath/src/test/native/cpp/geometry/Translation3dTest.cpp index 76913ac2a1..7870cbb111 100644 --- a/wpimath/src/test/native/cpp/geometry/Translation3dTest.cpp +++ b/wpimath/src/test/native/cpp/geometry/Translation3dTest.cpp @@ -2,12 +2,12 @@ // 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/math/geometry/Translation3d.hpp" + #include #include -#include "wpi/math/geometry/Translation3d.hpp" - using namespace wpi::math; static constexpr double kEpsilon = 1E-9; diff --git a/wpimath/src/test/native/cpp/interpolation/TimeInterpolatableBufferTest.cpp b/wpimath/src/test/native/cpp/interpolation/TimeInterpolatableBufferTest.cpp index 0419229c9e..340379f1ba 100644 --- a/wpimath/src/test/native/cpp/interpolation/TimeInterpolatableBufferTest.cpp +++ b/wpimath/src/test/native/cpp/interpolation/TimeInterpolatableBufferTest.cpp @@ -2,13 +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 "wpi/math/interpolation/TimeInterpolatableBuffer.hpp" + #include #include #include "wpi/math/geometry/Pose2d.hpp" #include "wpi/math/geometry/Rotation2d.hpp" -#include "wpi/math/interpolation/TimeInterpolatableBuffer.hpp" #include "wpi/units/time.hpp" TEST(TimeInterpolatableBufferTest, AddSample) { diff --git a/wpimath/src/test/native/cpp/kinematics/ChassisSpeedsTest.cpp b/wpimath/src/test/native/cpp/kinematics/ChassisSpeedsTest.cpp index e7669e7823..210b19f1b6 100644 --- a/wpimath/src/test/native/cpp/kinematics/ChassisSpeedsTest.cpp +++ b/wpimath/src/test/native/cpp/kinematics/ChassisSpeedsTest.cpp @@ -2,12 +2,12 @@ // 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/math/kinematics/ChassisSpeeds.hpp" + #include #include -#include "wpi/math/kinematics/ChassisSpeeds.hpp" - static constexpr double kEpsilon = 1E-9; TEST(ChassisSpeedsTest, Discretize) { diff --git a/wpimath/src/test/native/cpp/kinematics/DifferentialDriveKinematicsTest.cpp b/wpimath/src/test/native/cpp/kinematics/DifferentialDriveKinematicsTest.cpp index a945fefe99..cb6cd51db4 100644 --- a/wpimath/src/test/native/cpp/kinematics/DifferentialDriveKinematicsTest.cpp +++ b/wpimath/src/test/native/cpp/kinematics/DifferentialDriveKinematicsTest.cpp @@ -2,12 +2,13 @@ // 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/math/kinematics/DifferentialDriveKinematics.hpp" + #include #include #include "wpi/math/kinematics/ChassisSpeeds.hpp" -#include "wpi/math/kinematics/DifferentialDriveKinematics.hpp" #include "wpi/units/angular_velocity.hpp" #include "wpi/units/length.hpp" #include "wpi/units/velocity.hpp" diff --git a/wpimath/src/test/native/cpp/kinematics/DifferentialDriveOdometry3dTest.cpp b/wpimath/src/test/native/cpp/kinematics/DifferentialDriveOdometry3dTest.cpp index 48626f6a91..a8e8488603 100644 --- a/wpimath/src/test/native/cpp/kinematics/DifferentialDriveOdometry3dTest.cpp +++ b/wpimath/src/test/native/cpp/kinematics/DifferentialDriveOdometry3dTest.cpp @@ -2,12 +2,13 @@ // 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/math/kinematics/DifferentialDriveOdometry3d.hpp" + #include #include #include "wpi/math/kinematics/DifferentialDriveKinematics.hpp" -#include "wpi/math/kinematics/DifferentialDriveOdometry3d.hpp" static constexpr double kEpsilon = 1E-9; diff --git a/wpimath/src/test/native/cpp/kinematics/DifferentialDriveOdometryTest.cpp b/wpimath/src/test/native/cpp/kinematics/DifferentialDriveOdometryTest.cpp index cb9f3cd434..d993f51fb0 100644 --- a/wpimath/src/test/native/cpp/kinematics/DifferentialDriveOdometryTest.cpp +++ b/wpimath/src/test/native/cpp/kinematics/DifferentialDriveOdometryTest.cpp @@ -2,12 +2,13 @@ // 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/math/kinematics/DifferentialDriveOdometry.hpp" + #include #include #include "wpi/math/kinematics/DifferentialDriveKinematics.hpp" -#include "wpi/math/kinematics/DifferentialDriveOdometry.hpp" static constexpr double kEpsilon = 1E-9; diff --git a/wpimath/src/test/native/cpp/kinematics/DifferentialDriveWheelSpeedsTest.cpp b/wpimath/src/test/native/cpp/kinematics/DifferentialDriveWheelSpeedsTest.cpp index 76aaaf70ed..3cb80916fe 100644 --- a/wpimath/src/test/native/cpp/kinematics/DifferentialDriveWheelSpeedsTest.cpp +++ b/wpimath/src/test/native/cpp/kinematics/DifferentialDriveWheelSpeedsTest.cpp @@ -2,10 +2,10 @@ // 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 - #include "wpi/math/kinematics/DifferentialDriveWheelSpeeds.hpp" +#include + TEST(DifferentialDriveWheelSpeedsTest, Plus) { const wpi::math::DifferentialDriveWheelSpeeds left{1.0_mps, 0.5_mps}; const wpi::math::DifferentialDriveWheelSpeeds right{2.0_mps, 1.5_mps}; diff --git a/wpimath/src/test/native/cpp/kinematics/MecanumDriveKinematicsTest.cpp b/wpimath/src/test/native/cpp/kinematics/MecanumDriveKinematicsTest.cpp index 93fd2d2925..0b7f60fe49 100644 --- a/wpimath/src/test/native/cpp/kinematics/MecanumDriveKinematicsTest.cpp +++ b/wpimath/src/test/native/cpp/kinematics/MecanumDriveKinematicsTest.cpp @@ -2,12 +2,13 @@ // 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/math/kinematics/MecanumDriveKinematics.hpp" + #include #include #include "wpi/math/geometry/Translation2d.hpp" -#include "wpi/math/kinematics/MecanumDriveKinematics.hpp" #include "wpi/units/angular_velocity.hpp" using namespace wpi::math; diff --git a/wpimath/src/test/native/cpp/kinematics/MecanumDriveOdometry3dTest.cpp b/wpimath/src/test/native/cpp/kinematics/MecanumDriveOdometry3dTest.cpp index 304de5eb26..173a6d84df 100644 --- a/wpimath/src/test/native/cpp/kinematics/MecanumDriveOdometry3dTest.cpp +++ b/wpimath/src/test/native/cpp/kinematics/MecanumDriveOdometry3dTest.cpp @@ -2,12 +2,13 @@ // 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/math/kinematics/MecanumDriveOdometry3d.hpp" + #include #include #include -#include "wpi/math/kinematics/MecanumDriveOdometry3d.hpp" #include "wpi/math/trajectory/TrajectoryGenerator.hpp" using namespace wpi::math; diff --git a/wpimath/src/test/native/cpp/kinematics/MecanumDriveOdometryTest.cpp b/wpimath/src/test/native/cpp/kinematics/MecanumDriveOdometryTest.cpp index 3536985454..5371fee7d4 100644 --- a/wpimath/src/test/native/cpp/kinematics/MecanumDriveOdometryTest.cpp +++ b/wpimath/src/test/native/cpp/kinematics/MecanumDriveOdometryTest.cpp @@ -2,12 +2,13 @@ // 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/math/kinematics/MecanumDriveOdometry.hpp" + #include #include #include -#include "wpi/math/kinematics/MecanumDriveOdometry.hpp" #include "wpi/math/trajectory/TrajectoryGenerator.hpp" using namespace wpi::math; diff --git a/wpimath/src/test/native/cpp/kinematics/MecanumDriveWheelSpeedsTest.cpp b/wpimath/src/test/native/cpp/kinematics/MecanumDriveWheelSpeedsTest.cpp index 6e5c4f9504..25c7e62fbc 100644 --- a/wpimath/src/test/native/cpp/kinematics/MecanumDriveWheelSpeedsTest.cpp +++ b/wpimath/src/test/native/cpp/kinematics/MecanumDriveWheelSpeedsTest.cpp @@ -2,10 +2,10 @@ // 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 - #include "wpi/math/kinematics/MecanumDriveWheelSpeeds.hpp" +#include + TEST(MecanumDriveWheelSpeedsTest, Plus) { const wpi::math::MecanumDriveWheelSpeeds left{1.0_mps, 0.5_mps, 2.0_mps, 1.5_mps}; diff --git a/wpimath/src/test/native/cpp/kinematics/SwerveDriveKinematicsTest.cpp b/wpimath/src/test/native/cpp/kinematics/SwerveDriveKinematicsTest.cpp index 713fbdb855..f6a8983cf6 100644 --- a/wpimath/src/test/native/cpp/kinematics/SwerveDriveKinematicsTest.cpp +++ b/wpimath/src/test/native/cpp/kinematics/SwerveDriveKinematicsTest.cpp @@ -2,12 +2,13 @@ // 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/math/kinematics/SwerveDriveKinematics.hpp" + #include #include #include "wpi/math/geometry/Translation2d.hpp" -#include "wpi/math/kinematics/SwerveDriveKinematics.hpp" #include "wpi/units/angular_velocity.hpp" using namespace wpi::math; diff --git a/wpimath/src/test/native/cpp/kinematics/SwerveDriveOdometry3dTest.cpp b/wpimath/src/test/native/cpp/kinematics/SwerveDriveOdometry3dTest.cpp index bc791ad524..e9c473305e 100644 --- a/wpimath/src/test/native/cpp/kinematics/SwerveDriveOdometry3dTest.cpp +++ b/wpimath/src/test/native/cpp/kinematics/SwerveDriveOdometry3dTest.cpp @@ -2,13 +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 "wpi/math/kinematics/SwerveDriveOdometry3d.hpp" + #include #include #include #include "wpi/math/kinematics/SwerveDriveKinematics.hpp" -#include "wpi/math/kinematics/SwerveDriveOdometry3d.hpp" #include "wpi/math/trajectory/Trajectory.hpp" #include "wpi/math/trajectory/TrajectoryConfig.hpp" #include "wpi/math/trajectory/TrajectoryGenerator.hpp" diff --git a/wpimath/src/test/native/cpp/kinematics/SwerveDriveOdometryTest.cpp b/wpimath/src/test/native/cpp/kinematics/SwerveDriveOdometryTest.cpp index a9d96c72ae..2a3330c634 100644 --- a/wpimath/src/test/native/cpp/kinematics/SwerveDriveOdometryTest.cpp +++ b/wpimath/src/test/native/cpp/kinematics/SwerveDriveOdometryTest.cpp @@ -2,13 +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 "wpi/math/kinematics/SwerveDriveOdometry.hpp" + #include #include #include #include "wpi/math/kinematics/SwerveDriveKinematics.hpp" -#include "wpi/math/kinematics/SwerveDriveOdometry.hpp" #include "wpi/math/trajectory/Trajectory.hpp" #include "wpi/math/trajectory/TrajectoryConfig.hpp" #include "wpi/math/trajectory/TrajectoryGenerator.hpp" diff --git a/wpimath/src/test/native/cpp/kinematics/SwerveModulePositionTest.cpp b/wpimath/src/test/native/cpp/kinematics/SwerveModulePositionTest.cpp index 58c5783c35..ce9ca34b82 100644 --- a/wpimath/src/test/native/cpp/kinematics/SwerveModulePositionTest.cpp +++ b/wpimath/src/test/native/cpp/kinematics/SwerveModulePositionTest.cpp @@ -2,10 +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 "wpi/math/kinematics/SwerveModulePosition.hpp" + #include #include "wpi/math/geometry/Rotation2d.hpp" -#include "wpi/math/kinematics/SwerveModulePosition.hpp" TEST(SwerveModulePositionTest, Equality) { wpi::math::SwerveModulePosition position1{2_m, 90_deg}; diff --git a/wpimath/src/test/native/cpp/kinematics/SwerveModuleStateTest.cpp b/wpimath/src/test/native/cpp/kinematics/SwerveModuleStateTest.cpp index c1ebe1dd47..6ce1f2b4f7 100644 --- a/wpimath/src/test/native/cpp/kinematics/SwerveModuleStateTest.cpp +++ b/wpimath/src/test/native/cpp/kinematics/SwerveModuleStateTest.cpp @@ -2,10 +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 "wpi/math/kinematics/SwerveModuleState.hpp" + #include #include "wpi/math/geometry/Rotation2d.hpp" -#include "wpi/math/kinematics/SwerveModuleState.hpp" static constexpr double kEpsilon = 1E-9; diff --git a/wpimath/src/test/native/cpp/kinematics/proto/SwerveDriveKinematicsProtoTest.cpp b/wpimath/src/test/native/cpp/kinematics/proto/SwerveDriveKinematicsProtoTest.cpp index 6d52e8c9d4..9ec81e5801 100644 --- a/wpimath/src/test/native/cpp/kinematics/proto/SwerveDriveKinematicsProtoTest.cpp +++ b/wpimath/src/test/native/cpp/kinematics/proto/SwerveDriveKinematicsProtoTest.cpp @@ -2,11 +2,12 @@ // 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/math/kinematics/proto/SwerveDriveKinematicsProto.hpp" + #include #include "../../ProtoTestBase.hpp" #include "wpi/math/kinematics/SwerveDriveKinematics.hpp" -#include "wpi/math/kinematics/proto/SwerveDriveKinematicsProto.hpp" using namespace wpi::math; diff --git a/wpimath/src/test/native/cpp/kinematics/struct/SwerveDriveKinematicsStructTest.cpp b/wpimath/src/test/native/cpp/kinematics/struct/SwerveDriveKinematicsStructTest.cpp index 6ef89d05fe..70956a6575 100644 --- a/wpimath/src/test/native/cpp/kinematics/struct/SwerveDriveKinematicsStructTest.cpp +++ b/wpimath/src/test/native/cpp/kinematics/struct/SwerveDriveKinematicsStructTest.cpp @@ -2,11 +2,12 @@ // 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/math/kinematics/struct/SwerveDriveKinematicsStruct.hpp" + #include #include "../../StructTestBase.hpp" #include "wpi/math/kinematics/SwerveDriveKinematics.hpp" -#include "wpi/math/kinematics/struct/SwerveDriveKinematicsStruct.hpp" using namespace wpi::math; diff --git a/wpimath/src/test/native/cpp/optimization/SimulatedAnnealingTest.cpp b/wpimath/src/test/native/cpp/optimization/SimulatedAnnealingTest.cpp index b59fe8725e..5826521719 100644 --- a/wpimath/src/test/native/cpp/optimization/SimulatedAnnealingTest.cpp +++ b/wpimath/src/test/native/cpp/optimization/SimulatedAnnealingTest.cpp @@ -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 "wpi/math/optimization/SimulatedAnnealing.hpp" + #include #include #include #include -#include "wpi/math/optimization/SimulatedAnnealing.hpp" - TEST(SimulatedAnnealingTest, DoubleFunctionOptimizationHeartBeat) { auto function = [](double x) { return -(x + std::sin(x)) * std::exp(-x * x) + 1; diff --git a/wpimath/src/test/native/cpp/path/TravelingSalesmanTest.cpp b/wpimath/src/test/native/cpp/path/TravelingSalesmanTest.cpp index 7121af9f5c..3ea0a5eab6 100644 --- a/wpimath/src/test/native/cpp/path/TravelingSalesmanTest.cpp +++ b/wpimath/src/test/native/cpp/path/TravelingSalesmanTest.cpp @@ -2,6 +2,8 @@ // 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/math/path/TravelingSalesman.hpp" + #include #include #include @@ -11,7 +13,6 @@ #include "wpi/math/geometry/Pose2d.hpp" #include "wpi/math/geometry/Rotation2d.hpp" #include "wpi/math/linalg/EigenCore.hpp" -#include "wpi/math/path/TravelingSalesman.hpp" #include "wpi/util/array.hpp" #include "wpi/util/circular_buffer.hpp" diff --git a/wpimath/src/test/native/cpp/proto/MatrixProtoTest.cpp b/wpimath/src/test/native/cpp/proto/MatrixProtoTest.cpp index 3112b0e411..557612dcf6 100644 --- a/wpimath/src/test/native/cpp/proto/MatrixProtoTest.cpp +++ b/wpimath/src/test/native/cpp/proto/MatrixProtoTest.cpp @@ -2,11 +2,12 @@ // 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/math/linalg/proto/MatrixProto.hpp" + #include #include "../ProtoTestBase.hpp" #include "wpi/math/linalg/EigenCore.hpp" -#include "wpi/math/linalg/proto/MatrixProto.hpp" using namespace wpi::math; diff --git a/wpimath/src/test/native/cpp/proto/VectorProtoTest.cpp b/wpimath/src/test/native/cpp/proto/VectorProtoTest.cpp index ecd25273d0..41d2749e7c 100644 --- a/wpimath/src/test/native/cpp/proto/VectorProtoTest.cpp +++ b/wpimath/src/test/native/cpp/proto/VectorProtoTest.cpp @@ -2,11 +2,12 @@ // 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/math/linalg/proto/VectorProto.hpp" + #include #include "../ProtoTestBase.hpp" #include "wpi/math/linalg/EigenCore.hpp" -#include "wpi/math/linalg/proto/VectorProto.hpp" using namespace wpi::math; diff --git a/wpimath/src/test/native/cpp/spline/QuinticHermiteSplineTest.cpp b/wpimath/src/test/native/cpp/spline/QuinticHermiteSplineTest.cpp index 9fb801b2e0..92ae37f616 100644 --- a/wpimath/src/test/native/cpp/spline/QuinticHermiteSplineTest.cpp +++ b/wpimath/src/test/native/cpp/spline/QuinticHermiteSplineTest.cpp @@ -2,13 +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 "wpi/math/spline/QuinticHermiteSpline.hpp" + #include #include #include "wpi/math/geometry/Pose2d.hpp" #include "wpi/math/geometry/Rotation2d.hpp" -#include "wpi/math/spline/QuinticHermiteSpline.hpp" #include "wpi/math/spline/SplineHelper.hpp" #include "wpi/math/spline/SplineParameterizer.hpp" #include "wpi/units/angle.hpp" diff --git a/wpimath/src/test/native/cpp/struct/VectorStructTest.cpp b/wpimath/src/test/native/cpp/struct/VectorStructTest.cpp index b6bb87f118..0fb3c31cc3 100644 --- a/wpimath/src/test/native/cpp/struct/VectorStructTest.cpp +++ b/wpimath/src/test/native/cpp/struct/VectorStructTest.cpp @@ -2,11 +2,12 @@ // 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/math/linalg/struct/VectorStruct.hpp" + #include #include "../StructTestBase.hpp" #include "wpi/math/linalg/EigenCore.hpp" -#include "wpi/math/linalg/struct/VectorStruct.hpp" using namespace wpi::math; diff --git a/wpimath/src/test/native/cpp/system/DiscretizationTest.cpp b/wpimath/src/test/native/cpp/system/DiscretizationTest.cpp index e30fcfb49d..bf8dce2de9 100644 --- a/wpimath/src/test/native/cpp/system/DiscretizationTest.cpp +++ b/wpimath/src/test/native/cpp/system/DiscretizationTest.cpp @@ -2,13 +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 "wpi/math/system/Discretization.hpp" + #include #include #include #include "wpi/math/linalg/EigenCore.hpp" -#include "wpi/math/system/Discretization.hpp" #include "wpi/math/system/NumericalIntegration.hpp" // Check that for a simple second-order system that we can easily analyze diff --git a/wpimath/src/test/native/cpp/system/LinearSystemIDTest.cpp b/wpimath/src/test/native/cpp/system/LinearSystemIdTest.cpp similarity index 99% rename from wpimath/src/test/native/cpp/system/LinearSystemIDTest.cpp rename to wpimath/src/test/native/cpp/system/LinearSystemIdTest.cpp index 8a1d7bcc0d..402c8d7005 100644 --- a/wpimath/src/test/native/cpp/system/LinearSystemIDTest.cpp +++ b/wpimath/src/test/native/cpp/system/LinearSystemIdTest.cpp @@ -2,11 +2,12 @@ // 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/math/system/plant/LinearSystemId.hpp" + #include #include "wpi/math/system/LinearSystem.hpp" #include "wpi/math/system/plant/DCMotor.hpp" -#include "wpi/math/system/plant/LinearSystemId.hpp" #include "wpi/units/length.hpp" #include "wpi/units/mass.hpp" diff --git a/wpimath/src/test/native/cpp/system/NumericalIntegrationTest.cpp b/wpimath/src/test/native/cpp/system/NumericalIntegrationTest.cpp index 9fc0053489..a899dc8e4a 100644 --- a/wpimath/src/test/native/cpp/system/NumericalIntegrationTest.cpp +++ b/wpimath/src/test/native/cpp/system/NumericalIntegrationTest.cpp @@ -2,12 +2,13 @@ // 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/math/system/NumericalIntegration.hpp" + #include #include #include "wpi/math/linalg/EigenCore.hpp" -#include "wpi/math/system/NumericalIntegration.hpp" // Test that integrating dx/dt = eˣ works TEST(NumericalIntegrationTest, Exponential) { diff --git a/wpimath/src/test/native/cpp/system/NumericalJacobianTest.cpp b/wpimath/src/test/native/cpp/system/NumericalJacobianTest.cpp index a0a5f43853..e549d5c43f 100644 --- a/wpimath/src/test/native/cpp/system/NumericalJacobianTest.cpp +++ b/wpimath/src/test/native/cpp/system/NumericalJacobianTest.cpp @@ -2,10 +2,10 @@ // 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 - #include "wpi/math/system/NumericalJacobian.hpp" +#include + wpi::math::Matrixd<4, 4> A{ {1, 2, 4, 1}, {5, 2, 3, 4}, {5, 1, 3, 2}, {1, 1, 3, 7}}; wpi::math::Matrixd<4, 2> B{{1, 1}, {2, 1}, {3, 2}, {3, 7}}; diff --git a/wpimath/src/test/native/cpp/system/proto/LinearSystemProtoTest.cpp b/wpimath/src/test/native/cpp/system/proto/LinearSystemProtoTest.cpp index f9c98982aa..af47dd4f77 100644 --- a/wpimath/src/test/native/cpp/system/proto/LinearSystemProtoTest.cpp +++ b/wpimath/src/test/native/cpp/system/proto/LinearSystemProtoTest.cpp @@ -2,11 +2,12 @@ // 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/math/system/proto/LinearSystemProto.hpp" + #include #include "../../ProtoTestBase.hpp" #include "wpi/math/system/LinearSystem.hpp" -#include "wpi/math/system/proto/LinearSystemProto.hpp" using namespace wpi::math; diff --git a/wpimath/src/test/native/cpp/system/struct/LinearSystemStructTest.cpp b/wpimath/src/test/native/cpp/system/struct/LinearSystemStructTest.cpp index 21590e8ccf..2ad5e86996 100644 --- a/wpimath/src/test/native/cpp/system/struct/LinearSystemStructTest.cpp +++ b/wpimath/src/test/native/cpp/system/struct/LinearSystemStructTest.cpp @@ -2,11 +2,12 @@ // 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/math/system/struct/LinearSystemStruct.hpp" + #include #include "../../StructTestBase.hpp" #include "wpi/math/system/LinearSystem.hpp" -#include "wpi/math/system/struct/LinearSystemStruct.hpp" using namespace wpi::math; diff --git a/wpimath/src/test/native/cpp/trajectory/CentripetalAccelerationConstraintTest.cpp b/wpimath/src/test/native/cpp/trajectory/CentripetalAccelerationConstraintTest.cpp index c6934911d3..12c4263a6a 100644 --- a/wpimath/src/test/native/cpp/trajectory/CentripetalAccelerationConstraintTest.cpp +++ b/wpimath/src/test/native/cpp/trajectory/CentripetalAccelerationConstraintTest.cpp @@ -2,13 +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 "wpi/math/trajectory/constraint/CentripetalAccelerationConstraint.hpp" + #include #include #include #include "wpi/math/trajectory/TestTrajectory.hpp" -#include "wpi/math/trajectory/constraint/CentripetalAccelerationConstraint.hpp" #include "wpi/math/trajectory/constraint/TrajectoryConstraint.hpp" #include "wpi/units/acceleration.hpp" #include "wpi/units/angle.hpp" diff --git a/wpimath/src/test/native/cpp/trajectory/DifferentialDriveKinematicsTest.cpp b/wpimath/src/test/native/cpp/trajectory/DifferentialDriveKinematicsTest.cpp index 9c5e4d52fa..07b9b510f4 100644 --- a/wpimath/src/test/native/cpp/trajectory/DifferentialDriveKinematicsTest.cpp +++ b/wpimath/src/test/native/cpp/trajectory/DifferentialDriveKinematicsTest.cpp @@ -2,12 +2,13 @@ // 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/math/kinematics/DifferentialDriveKinematics.hpp" + #include #include #include -#include "wpi/math/kinematics/DifferentialDriveKinematics.hpp" #include "wpi/math/trajectory/TestTrajectory.hpp" #include "wpi/math/trajectory/constraint/DifferentialDriveKinematicsConstraint.hpp" #include "wpi/units/time.hpp" diff --git a/wpimath/src/test/native/cpp/trajectory/EllipticalRegionConstraintTest.cpp b/wpimath/src/test/native/cpp/trajectory/EllipticalRegionConstraintTest.cpp index 8737ea9ac6..5352e2611b 100644 --- a/wpimath/src/test/native/cpp/trajectory/EllipticalRegionConstraintTest.cpp +++ b/wpimath/src/test/native/cpp/trajectory/EllipticalRegionConstraintTest.cpp @@ -2,10 +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 "wpi/math/trajectory/constraint/EllipticalRegionConstraint.hpp" + #include #include "wpi/math/trajectory/TestTrajectory.hpp" -#include "wpi/math/trajectory/constraint/EllipticalRegionConstraint.hpp" #include "wpi/math/trajectory/constraint/MaxVelocityConstraint.hpp" #include "wpi/units/acceleration.hpp" #include "wpi/units/angle.hpp" diff --git a/wpimath/src/test/native/cpp/trajectory/ExponentialProfileTest.cpp b/wpimath/src/test/native/cpp/trajectory/ExponentialProfileTest.cpp index 6abc3bfc79..101967f532 100644 --- a/wpimath/src/test/native/cpp/trajectory/ExponentialProfileTest.cpp +++ b/wpimath/src/test/native/cpp/trajectory/ExponentialProfileTest.cpp @@ -2,7 +2,7 @@ // 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/math/trajectory/ExponentialProfile.hpp" // NOLINT(build/include_order) +#include "wpi/math/trajectory/ExponentialProfile.hpp" #include #include diff --git a/wpimath/src/test/native/cpp/trajectory/RectangularRegionConstraintTest.cpp b/wpimath/src/test/native/cpp/trajectory/RectangularRegionConstraintTest.cpp index 9bfb90f146..4c365e6091 100644 --- a/wpimath/src/test/native/cpp/trajectory/RectangularRegionConstraintTest.cpp +++ b/wpimath/src/test/native/cpp/trajectory/RectangularRegionConstraintTest.cpp @@ -2,11 +2,12 @@ // 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/math/trajectory/constraint/RectangularRegionConstraint.hpp" + #include #include "wpi/math/trajectory/TestTrajectory.hpp" #include "wpi/math/trajectory/constraint/MaxVelocityConstraint.hpp" -#include "wpi/math/trajectory/constraint/RectangularRegionConstraint.hpp" #include "wpi/units/acceleration.hpp" #include "wpi/units/length.hpp" #include "wpi/units/math.hpp" diff --git a/wpimath/src/test/native/cpp/trajectory/TrajectoryGeneratorTest.cpp b/wpimath/src/test/native/cpp/trajectory/TrajectoryGeneratorTest.cpp index c82941ed25..1f6cf1cf62 100644 --- a/wpimath/src/test/native/cpp/trajectory/TrajectoryGeneratorTest.cpp +++ b/wpimath/src/test/native/cpp/trajectory/TrajectoryGeneratorTest.cpp @@ -2,13 +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 "wpi/math/trajectory/TrajectoryGenerator.hpp" + #include #include #include "wpi/math/trajectory/TestTrajectory.hpp" #include "wpi/math/trajectory/Trajectory.hpp" -#include "wpi/math/trajectory/TrajectoryGenerator.hpp" #include "wpi/math/trajectory/constraint/CentripetalAccelerationConstraint.hpp" #include "wpi/math/trajectory/constraint/TrajectoryConstraint.hpp" #include "wpi/units/math.hpp" diff --git a/wpimath/src/test/native/cpp/trajectory/TrapezoidProfileTest.cpp b/wpimath/src/test/native/cpp/trajectory/TrapezoidProfileTest.cpp index 43b5a7afb7..e040d0aa02 100644 --- a/wpimath/src/test/native/cpp/trajectory/TrapezoidProfileTest.cpp +++ b/wpimath/src/test/native/cpp/trajectory/TrapezoidProfileTest.cpp @@ -2,7 +2,7 @@ // 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/math/trajectory/TrapezoidProfile.hpp" // NOLINT(build/include_order) +#include "wpi/math/trajectory/TrapezoidProfile.hpp" #include #include diff --git a/wpinet/.styleguide b/wpinet/.styleguide index b6c3200ffb..7e12b152f6 100644 --- a/wpinet/.styleguide +++ b/wpinet/.styleguide @@ -33,9 +33,3 @@ includeGuardRoots { wpinet/src/main/native/include/wpinet/ wpinet/src/test/native/cpp/ } - -includeOtherLibs { - ^fmt/ - ^gmock/ - ^gtest/ -} diff --git a/wpinet/examples/dsclient/dsclient.cpp b/wpinet/examples/dsclient/dsclient.cpp index 713cc13452..660cdaf139 100644 --- a/wpinet/examples/dsclient/dsclient.cpp +++ b/wpinet/examples/dsclient/dsclient.cpp @@ -2,10 +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 "wpi/net/DsClient.hpp" + #include #include -#include "wpi/net/DsClient.hpp" #include "wpi/net/EventLoopRunner.hpp" #include "wpi/util/Logger.hpp" #include "wpi/util/print.hpp" diff --git a/wpinet/src/main/native/cpp/MulticastHandleManager.hpp b/wpinet/src/main/native/cpp/MulticastHandleManager.hpp index 67551f9ef8..98ec17b2ea 100644 --- a/wpinet/src/main/native/cpp/MulticastHandleManager.hpp +++ b/wpinet/src/main/native/cpp/MulticastHandleManager.hpp @@ -12,6 +12,7 @@ #include "wpi/util/UidVector.hpp" namespace wpi::net { + struct MulticastHandleManager { wpi::util::mutex mutex; wpi::util::UidVector handleIds; @@ -27,4 +28,5 @@ struct MulticastHandleManager { }; MulticastHandleManager& GetMulticastManager(); + } // namespace wpi::net diff --git a/wpinet/src/main/native/cpp/MulticastServiceAnnouncer.cpp b/wpinet/src/main/native/cpp/MulticastServiceAnnouncer.cpp index e5aba552de..61f1063266 100644 --- a/wpinet/src/main/native/cpp/MulticastServiceAnnouncer.cpp +++ b/wpinet/src/main/native/cpp/MulticastServiceAnnouncer.cpp @@ -11,6 +11,7 @@ #include "wpi/util/SmallVector.hpp" extern "C" { + WPI_MulticastServiceAnnouncerHandle WPI_CreateMulticastServiceAnnouncer( const char* serviceName, const char* serviceType, int32_t port, int32_t txtCount, const char** keys, const char** values) @@ -66,4 +67,5 @@ int32_t WPI_GetMulticastServiceAnnouncerHasImplementation( auto& announcer = manager.announcers[handle]; return announcer->HasImplementation(); } + } // extern "C" diff --git a/wpinet/src/main/native/cpp/MulticastServiceResolver.cpp b/wpinet/src/main/native/cpp/MulticastServiceResolver.cpp index da18014790..7f72160a9b 100644 --- a/wpinet/src/main/native/cpp/MulticastServiceResolver.cpp +++ b/wpinet/src/main/native/cpp/MulticastServiceResolver.cpp @@ -12,6 +12,7 @@ #include "wpi/util/MemAlloc.hpp" extern "C" { + WPI_MulticastServiceResolverHandle WPI_CreateMulticastServiceResolver( const char* serviceType) @@ -151,4 +152,5 @@ WPI_ServiceData* WPI_GetMulticastServiceResolverData( void WPI_FreeServiceData(WPI_ServiceData* serviceData, int32_t length) { std::free(serviceData); } + } // extern "C" diff --git a/wpinet/src/main/native/cpp/UDPClient.cpp b/wpinet/src/main/native/cpp/UDPClient.cpp index dd1086f60d..1dcd3c0b7f 100644 --- a/wpinet/src/main/native/cpp/UDPClient.cpp +++ b/wpinet/src/main/native/cpp/UDPClient.cpp @@ -5,8 +5,8 @@ #include "wpi/net/UDPClient.hpp" #ifdef _WIN32 -#include -#include +#include +#include #pragma comment(lib, "Ws2_32.lib") #else #include diff --git a/wpinet/src/main/native/cpp/WebServer.cpp b/wpinet/src/main/native/cpp/WebServer.cpp index ce5d5d8766..0a0df5bf10 100644 --- a/wpinet/src/main/native/cpp/WebServer.cpp +++ b/wpinet/src/main/native/cpp/WebServer.cpp @@ -13,15 +13,6 @@ #include #include -#include "wpi/util/DenseMap.hpp" -#include "wpi/util/MemoryBuffer.hpp" -#include "wpi/util/SmallString.hpp" -#include "wpi/util/Signal.h" -#include "wpi/util/StringMap.hpp" -#include "wpi/util/fs.hpp" -#include "wpi/util/json.hpp" -#include "wpi/util/print.hpp" -#include "wpi/util/raw_ostream.hpp" #include "wpi/net/EventLoopRunner.hpp" #include "wpi/net/HttpServerConnection.hpp" @@ -32,6 +23,15 @@ #include "wpi/net/uv/Stream.hpp" #include "wpi/net/uv/Tcp.hpp" #include "wpi/net/uv/Timer.hpp" +#include "wpi/util/DenseMap.hpp" +#include "wpi/util/MemoryBuffer.hpp" +#include "wpi/util/Signal.h" +#include "wpi/util/SmallString.hpp" +#include "wpi/util/StringMap.hpp" +#include "wpi/util/fs.hpp" +#include "wpi/util/json.hpp" +#include "wpi/util/print.hpp" +#include "wpi/util/raw_ostream.hpp" using namespace wpi::net; diff --git a/wpinet/src/main/native/cpp/uv/NameToAddr.cpp b/wpinet/src/main/native/cpp/uv/NameToAddr.cpp index faa0eee2f3..a5fa676f20 100644 --- a/wpinet/src/main/native/cpp/uv/NameToAddr.cpp +++ b/wpinet/src/main/native/cpp/uv/NameToAddr.cpp @@ -2,10 +2,9 @@ // 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/net/uv/util.hpp" // NOLINT(build/include_order) - #include +#include "wpi/net/uv/util.hpp" #include "wpi/util/SmallString.hpp" namespace wpi::net::uv { diff --git a/wpinet/src/main/native/include/wpi/net/MulticastServiceAnnouncer.h b/wpinet/src/main/native/include/wpi/net/MulticastServiceAnnouncer.h index 3b2c56a7b9..af5496e7e3 100644 --- a/wpinet/src/main/native/include/wpi/net/MulticastServiceAnnouncer.h +++ b/wpinet/src/main/native/include/wpi/net/MulticastServiceAnnouncer.h @@ -7,12 +7,15 @@ #include #ifdef __cplusplus + #include #include #include #include #include + namespace wpi::net { + class MulticastServiceAnnouncer { public: /** @@ -26,6 +29,7 @@ class MulticastServiceAnnouncer { MulticastServiceAnnouncer( std::string_view serviceName, std::string_view serviceType, int port, std::span> txt); + /** * Creates a MulticastServiceAnnouncer. * @@ -37,6 +41,7 @@ class MulticastServiceAnnouncer { MulticastServiceAnnouncer( std::string_view serviceName, std::string_view serviceType, int port, std::span> txt); + /** * Creates a MulticastServiceAnnouncer. * @@ -46,28 +51,36 @@ class MulticastServiceAnnouncer { */ MulticastServiceAnnouncer(std::string_view serviceName, std::string_view serviceType, int port); + ~MulticastServiceAnnouncer() noexcept; + /** * Starts multicast service announcer. */ void Start(); + /** * Stops multicast service announcer. */ void Stop(); + /** * Returns true if there's a multicast service announcer implementation. * * @return True if there's a multicast service announcer implementation. */ bool HasImplementation() const; + struct Impl; private: std::unique_ptr pImpl; }; + } // namespace wpi::net + extern "C" { + #endif typedef unsigned int WPI_MulticastServiceAnnouncerHandle; // NOLINT diff --git a/wpinet/src/main/native/include/wpi/net/MulticastServiceResolver.h b/wpinet/src/main/native/include/wpi/net/MulticastServiceResolver.h index 883b107bf1..6faf4a7ce9 100644 --- a/wpinet/src/main/native/include/wpi/net/MulticastServiceResolver.h +++ b/wpinet/src/main/native/include/wpi/net/MulticastServiceResolver.h @@ -7,6 +7,7 @@ #include "wpi/util/Synchronization.h" #ifdef __cplusplus + #include #include #include @@ -15,11 +16,15 @@ #include #include "wpi/util/mutex.hpp" + namespace wpi::net { + class MulticastServiceResolver { public: explicit MulticastServiceResolver(std::string_view serviceType); + ~MulticastServiceResolver() noexcept; + struct ServiceData { /// IPv4 address in host order. unsigned int ipv4Address; @@ -32,31 +37,37 @@ class MulticastServiceResolver { /// Service data payload. std::vector> txt; }; + /** * Set a copy callback to be called when a service is resolved. * Takes presidence over the move callback. Return true to * not send the data to the event queue. */ bool SetCopyCallback(std::function callback); + /** * Set a move callback to be called when a service is resolved. * Data is moved into the function and cannot be added to the event queue. */ bool SetMoveCallback(std::function callback); + /** * Starts multicast service resolver. */ void Start(); + /** * Stops multicast service resolver. */ void Stop(); + /** * Returns event handle. * * @return Event handle. */ WPI_EventHandle GetEventHandle() const { return event.GetHandle(); } + /** * Returns multicast service resolver data. * @@ -64,25 +75,30 @@ class MulticastServiceResolver { */ std::vector GetData() { std::scoped_lock lock{mutex}; + event.Reset(); if (queue.empty()) { return {}; } + std::vector ret; queue.swap(ret); return ret; } + /** * Returns true if there's a multicast service resolver implementation. * * @return True if there's a multicast service resolver implementation. */ bool HasImplementation() const; + struct Impl; private: void PushData(ServiceData&& data) { std::scoped_lock lock{mutex}; + if (copyCallback) { if (!copyCallback(data)) { queue.emplace_back(std::forward(data)); @@ -95,6 +111,7 @@ class MulticastServiceResolver { event.Set(); } } + wpi::util::Event event{true}; std::vector queue; wpi::util::mutex mutex; @@ -102,7 +119,9 @@ class MulticastServiceResolver { std::function moveCallback; std::unique_ptr pImpl; }; + } // namespace wpi::net + #endif #ifdef __cplusplus diff --git a/wpinet/src/main/native/include/wpi/net/uv/Async.hpp b/wpinet/src/main/native/include/wpi/net/uv/Async.hpp index ca4130667d..0ab0080d63 100644 --- a/wpinet/src/main/native/include/wpi/net/uv/Async.hpp +++ b/wpinet/src/main/native/include/wpi/net/uv/Async.hpp @@ -5,14 +5,14 @@ #ifndef WPINET_WPINET_SRC_MAIN_NATIVE_INCLUDE_WPI_NET_UV_ASYNC_HPP_ #define WPINET_WPINET_SRC_MAIN_NATIVE_INCLUDE_WPI_NET_UV_ASYNC_HPP_ -#include - #include #include #include #include #include +#include + #include "wpi/net/uv/Handle.hpp" #include "wpi/net/uv/Loop.hpp" #include "wpi/util/Signal.h" diff --git a/wpinet/src/main/native/include/wpi/net/uv/AsyncFunction.hpp b/wpinet/src/main/native/include/wpi/net/uv/AsyncFunction.hpp index 72d4154460..696e95497f 100644 --- a/wpinet/src/main/native/include/wpi/net/uv/AsyncFunction.hpp +++ b/wpinet/src/main/native/include/wpi/net/uv/AsyncFunction.hpp @@ -6,7 +6,6 @@ #define WPINET_WPINET_SRC_MAIN_NATIVE_INCLUDE_WPI_NET_UV_ASYNCFUNCTION_HPP_ #include -#include #include #include @@ -16,6 +15,8 @@ #include #include +#include + #include "wpi/net/uv/Handle.hpp" #include "wpi/net/uv/Loop.hpp" #include "wpi/util/future.hpp" diff --git a/wpinet/src/main/native/include/wpi/net/uv/Buffer.hpp b/wpinet/src/main/native/include/wpi/net/uv/Buffer.hpp index 41437628cd..a9476faca6 100644 --- a/wpinet/src/main/native/include/wpi/net/uv/Buffer.hpp +++ b/wpinet/src/main/native/include/wpi/net/uv/Buffer.hpp @@ -5,14 +5,14 @@ #ifndef WPINET_WPINET_SRC_MAIN_NATIVE_INCLUDE_WPI_NET_UV_BUFFER_HPP_ #define WPINET_WPINET_SRC_MAIN_NATIVE_INCLUDE_WPI_NET_UV_BUFFER_HPP_ -#include - #include #include #include #include #include +#include + #include "wpi/util/SmallVector.hpp" namespace wpi::net::uv { diff --git a/wpinet/src/main/native/include/wpi/net/uv/Check.hpp b/wpinet/src/main/native/include/wpi/net/uv/Check.hpp index 04c247eebd..e88cc0f94e 100644 --- a/wpinet/src/main/native/include/wpi/net/uv/Check.hpp +++ b/wpinet/src/main/native/include/wpi/net/uv/Check.hpp @@ -5,10 +5,10 @@ #ifndef WPINET_WPINET_SRC_MAIN_NATIVE_INCLUDE_WPI_NET_UV_CHECK_HPP_ #define WPINET_WPINET_SRC_MAIN_NATIVE_INCLUDE_WPI_NET_UV_CHECK_HPP_ -#include - #include +#include + #include "wpi/net/uv/Handle.hpp" #include "wpi/util/Signal.h" diff --git a/wpinet/src/main/native/include/wpi/net/uv/FsEvent.hpp b/wpinet/src/main/native/include/wpi/net/uv/FsEvent.hpp index b480c5ba79..5365aea7c1 100644 --- a/wpinet/src/main/native/include/wpi/net/uv/FsEvent.hpp +++ b/wpinet/src/main/native/include/wpi/net/uv/FsEvent.hpp @@ -5,12 +5,12 @@ #ifndef WPINET_WPINET_SRC_MAIN_NATIVE_INCLUDE_WPI_NET_UV_FSEVENT_HPP_ #define WPINET_WPINET_SRC_MAIN_NATIVE_INCLUDE_WPI_NET_UV_FSEVENT_HPP_ -#include - #include #include #include +#include + #include "wpi/net/uv/Handle.hpp" #include "wpi/util/Signal.h" diff --git a/wpinet/src/main/native/include/wpi/net/uv/GetAddrInfo.hpp b/wpinet/src/main/native/include/wpi/net/uv/GetAddrInfo.hpp index 3c8c20496b..ce81047cd5 100644 --- a/wpinet/src/main/native/include/wpi/net/uv/GetAddrInfo.hpp +++ b/wpinet/src/main/native/include/wpi/net/uv/GetAddrInfo.hpp @@ -5,14 +5,14 @@ #ifndef WPINET_WPINET_SRC_MAIN_NATIVE_INCLUDE_WPI_NET_UV_GETADDRINFO_HPP_ #define WPINET_WPINET_SRC_MAIN_NATIVE_INCLUDE_WPI_NET_UV_GETADDRINFO_HPP_ -#include - #include #include #include #include #include +#include + #include "wpi/net/uv/Request.hpp" #include "wpi/util/Signal.h" diff --git a/wpinet/src/main/native/include/wpi/net/uv/GetNameInfo.hpp b/wpinet/src/main/native/include/wpi/net/uv/GetNameInfo.hpp index 56101ca504..d915b32771 100644 --- a/wpinet/src/main/native/include/wpi/net/uv/GetNameInfo.hpp +++ b/wpinet/src/main/native/include/wpi/net/uv/GetNameInfo.hpp @@ -5,13 +5,13 @@ #ifndef WPINET_WPINET_SRC_MAIN_NATIVE_INCLUDE_WPI_NET_UV_GETNAMEINFO_HPP_ #define WPINET_WPINET_SRC_MAIN_NATIVE_INCLUDE_WPI_NET_UV_GETNAMEINFO_HPP_ -#include - #include #include #include #include +#include + #include "wpi/net/uv/Request.hpp" #include "wpi/util/Signal.h" diff --git a/wpinet/src/main/native/include/wpi/net/uv/Handle.hpp b/wpinet/src/main/native/include/wpi/net/uv/Handle.hpp index 59dbb278f2..2add8af18d 100644 --- a/wpinet/src/main/native/include/wpi/net/uv/Handle.hpp +++ b/wpinet/src/main/native/include/wpi/net/uv/Handle.hpp @@ -5,14 +5,14 @@ #ifndef WPINET_WPINET_SRC_MAIN_NATIVE_INCLUDE_WPI_NET_UV_HANDLE_HPP_ #define WPINET_WPINET_SRC_MAIN_NATIVE_INCLUDE_WPI_NET_UV_HANDLE_HPP_ -#include - #include #include #include #include #include +#include + #include "wpi/net/uv/Buffer.hpp" #include "wpi/net/uv/Error.hpp" #include "wpi/net/uv/Loop.hpp" diff --git a/wpinet/src/main/native/include/wpi/net/uv/Idle.hpp b/wpinet/src/main/native/include/wpi/net/uv/Idle.hpp index 2a216d4fe0..edc5c97a36 100644 --- a/wpinet/src/main/native/include/wpi/net/uv/Idle.hpp +++ b/wpinet/src/main/native/include/wpi/net/uv/Idle.hpp @@ -5,10 +5,10 @@ #ifndef WPINET_WPINET_SRC_MAIN_NATIVE_INCLUDE_WPI_NET_UV_IDLE_HPP_ #define WPINET_WPINET_SRC_MAIN_NATIVE_INCLUDE_WPI_NET_UV_IDLE_HPP_ -#include - #include +#include + #include "wpi/net/uv/Handle.hpp" #include "wpi/util/Signal.h" diff --git a/wpinet/src/main/native/include/wpi/net/uv/Loop.hpp b/wpinet/src/main/native/include/wpi/net/uv/Loop.hpp index 66b4645192..db5747a362 100644 --- a/wpinet/src/main/native/include/wpi/net/uv/Loop.hpp +++ b/wpinet/src/main/native/include/wpi/net/uv/Loop.hpp @@ -5,8 +5,6 @@ #ifndef WPINET_WPINET_SRC_MAIN_NATIVE_INCLUDE_WPI_NET_UV_LOOP_HPP_ #define WPINET_WPINET_SRC_MAIN_NATIVE_INCLUDE_WPI_NET_UV_LOOP_HPP_ -#include - #include #include #include @@ -14,6 +12,8 @@ #include #include +#include + #include "wpi/net/uv/Error.hpp" #include "wpi/util/Signal.h" #include "wpi/util/function_ref.hpp" diff --git a/wpinet/src/main/native/include/wpi/net/uv/NetworkStream.hpp b/wpinet/src/main/native/include/wpi/net/uv/NetworkStream.hpp index 790ef5797c..180f4aaebb 100644 --- a/wpinet/src/main/native/include/wpi/net/uv/NetworkStream.hpp +++ b/wpinet/src/main/native/include/wpi/net/uv/NetworkStream.hpp @@ -5,12 +5,12 @@ #ifndef WPINET_WPINET_SRC_MAIN_NATIVE_INCLUDE_WPI_NET_UV_NETWORKSTREAM_HPP_ #define WPINET_WPINET_SRC_MAIN_NATIVE_INCLUDE_WPI_NET_UV_NETWORKSTREAM_HPP_ -#include - #include #include #include +#include + #include "wpi/net/uv/Stream.hpp" #include "wpi/util/Signal.h" diff --git a/wpinet/src/main/native/include/wpi/net/uv/Pipe.hpp b/wpinet/src/main/native/include/wpi/net/uv/Pipe.hpp index dc9590ff02..5d5ac84f94 100644 --- a/wpinet/src/main/native/include/wpi/net/uv/Pipe.hpp +++ b/wpinet/src/main/native/include/wpi/net/uv/Pipe.hpp @@ -5,13 +5,13 @@ #ifndef WPINET_WPINET_SRC_MAIN_NATIVE_INCLUDE_WPI_NET_UV_PIPE_HPP_ #define WPINET_WPINET_SRC_MAIN_NATIVE_INCLUDE_WPI_NET_UV_PIPE_HPP_ -#include - #include #include #include #include +#include + #include "wpi/net/uv/NetworkStream.hpp" namespace wpi::net::uv { diff --git a/wpinet/src/main/native/include/wpi/net/uv/Poll.hpp b/wpinet/src/main/native/include/wpi/net/uv/Poll.hpp index 0c648046ef..4688e86c45 100644 --- a/wpinet/src/main/native/include/wpi/net/uv/Poll.hpp +++ b/wpinet/src/main/native/include/wpi/net/uv/Poll.hpp @@ -5,11 +5,11 @@ #ifndef WPINET_WPINET_SRC_MAIN_NATIVE_INCLUDE_WPI_NET_UV_POLL_HPP_ #define WPINET_WPINET_SRC_MAIN_NATIVE_INCLUDE_WPI_NET_UV_POLL_HPP_ -#include - #include #include +#include + #include "wpi/net/uv/Handle.hpp" #include "wpi/util/Signal.h" diff --git a/wpinet/src/main/native/include/wpi/net/uv/Prepare.hpp b/wpinet/src/main/native/include/wpi/net/uv/Prepare.hpp index c41e47e7c3..415b141d5c 100644 --- a/wpinet/src/main/native/include/wpi/net/uv/Prepare.hpp +++ b/wpinet/src/main/native/include/wpi/net/uv/Prepare.hpp @@ -5,10 +5,10 @@ #ifndef WPINET_WPINET_SRC_MAIN_NATIVE_INCLUDE_WPI_NET_UV_PREPARE_HPP_ #define WPINET_WPINET_SRC_MAIN_NATIVE_INCLUDE_WPI_NET_UV_PREPARE_HPP_ -#include - #include +#include + #include "wpi/net/uv/Handle.hpp" #include "wpi/util/Signal.h" diff --git a/wpinet/src/main/native/include/wpi/net/uv/Process.hpp b/wpinet/src/main/native/include/wpi/net/uv/Process.hpp index 341631076a..01f75bbb45 100644 --- a/wpinet/src/main/native/include/wpi/net/uv/Process.hpp +++ b/wpinet/src/main/native/include/wpi/net/uv/Process.hpp @@ -5,14 +5,14 @@ #ifndef WPINET_WPINET_SRC_MAIN_NATIVE_INCLUDE_WPI_NET_UV_PROCESS_HPP_ #define WPINET_WPINET_SRC_MAIN_NATIVE_INCLUDE_WPI_NET_UV_PROCESS_HPP_ -#include - #include #include #include #include #include +#include + #include "wpi/net/uv/Handle.hpp" #include "wpi/util/Signal.h" #include "wpi/util/SmallVector.hpp" diff --git a/wpinet/src/main/native/include/wpi/net/uv/Request.hpp b/wpinet/src/main/native/include/wpi/net/uv/Request.hpp index 3c720f1d2d..b4f8a582e9 100644 --- a/wpinet/src/main/native/include/wpi/net/uv/Request.hpp +++ b/wpinet/src/main/native/include/wpi/net/uv/Request.hpp @@ -5,12 +5,12 @@ #ifndef WPINET_WPINET_SRC_MAIN_NATIVE_INCLUDE_WPI_NET_UV_REQUEST_HPP_ #define WPINET_WPINET_SRC_MAIN_NATIVE_INCLUDE_WPI_NET_UV_REQUEST_HPP_ -#include - #include #include #include +#include + #include "wpi/net/uv/Error.hpp" namespace wpi::net::uv { diff --git a/wpinet/src/main/native/include/wpi/net/uv/Signal.hpp b/wpinet/src/main/native/include/wpi/net/uv/Signal.hpp index 47981282c3..9f63cfd64b 100644 --- a/wpinet/src/main/native/include/wpi/net/uv/Signal.hpp +++ b/wpinet/src/main/native/include/wpi/net/uv/Signal.hpp @@ -5,10 +5,10 @@ #ifndef WPINET_WPINET_SRC_MAIN_NATIVE_INCLUDE_WPI_NET_UV_SIGNAL_HPP_ #define WPINET_WPINET_SRC_MAIN_NATIVE_INCLUDE_WPI_NET_UV_SIGNAL_HPP_ -#include - #include +#include + #include "wpi/net/uv/Handle.hpp" #include "wpi/util/Signal.h" diff --git a/wpinet/src/main/native/include/wpi/net/uv/Stream.hpp b/wpinet/src/main/native/include/wpi/net/uv/Stream.hpp index 86058aa690..c9145c161b 100644 --- a/wpinet/src/main/native/include/wpi/net/uv/Stream.hpp +++ b/wpinet/src/main/native/include/wpi/net/uv/Stream.hpp @@ -5,8 +5,6 @@ #ifndef WPINET_WPINET_SRC_MAIN_NATIVE_INCLUDE_WPI_NET_UV_STREAM_HPP_ #define WPINET_WPINET_SRC_MAIN_NATIVE_INCLUDE_WPI_NET_UV_STREAM_HPP_ -#include - #include #include #include @@ -14,6 +12,8 @@ #include #include +#include + #include "wpi/net/uv/Buffer.hpp" #include "wpi/net/uv/Handle.hpp" #include "wpi/net/uv/Request.hpp" diff --git a/wpinet/src/main/native/include/wpi/net/uv/Tcp.hpp b/wpinet/src/main/native/include/wpi/net/uv/Tcp.hpp index 459c8b84dc..39a644e23b 100644 --- a/wpinet/src/main/native/include/wpi/net/uv/Tcp.hpp +++ b/wpinet/src/main/native/include/wpi/net/uv/Tcp.hpp @@ -5,14 +5,14 @@ #ifndef WPINET_WPINET_SRC_MAIN_NATIVE_INCLUDE_WPI_NET_UV_TCP_HPP_ #define WPINET_WPINET_SRC_MAIN_NATIVE_INCLUDE_WPI_NET_UV_TCP_HPP_ -#include - #include #include #include #include #include +#include + #include "wpi/net/uv/NetworkStream.hpp" namespace wpi::net::uv { diff --git a/wpinet/src/main/native/include/wpi/net/uv/Timer.hpp b/wpinet/src/main/native/include/wpi/net/uv/Timer.hpp index 5f3b1caa2e..6f6d8f6ca6 100644 --- a/wpinet/src/main/native/include/wpi/net/uv/Timer.hpp +++ b/wpinet/src/main/native/include/wpi/net/uv/Timer.hpp @@ -5,13 +5,13 @@ #ifndef WPINET_WPINET_SRC_MAIN_NATIVE_INCLUDE_WPI_NET_UV_TIMER_HPP_ #define WPINET_WPINET_SRC_MAIN_NATIVE_INCLUDE_WPI_NET_UV_TIMER_HPP_ -#include - #include #include #include #include +#include + #include "wpi/net/uv/Handle.hpp" #include "wpi/util/Signal.h" diff --git a/wpinet/src/main/native/include/wpi/net/uv/Tty.hpp b/wpinet/src/main/native/include/wpi/net/uv/Tty.hpp index 89ebeb68c8..ecdc23a055 100644 --- a/wpinet/src/main/native/include/wpi/net/uv/Tty.hpp +++ b/wpinet/src/main/native/include/wpi/net/uv/Tty.hpp @@ -5,11 +5,11 @@ #ifndef WPINET_WPINET_SRC_MAIN_NATIVE_INCLUDE_WPI_NET_UV_TTY_HPP_ #define WPINET_WPINET_SRC_MAIN_NATIVE_INCLUDE_WPI_NET_UV_TTY_HPP_ -#include - #include #include +#include + #include "wpi/net/uv/Stream.hpp" namespace wpi::net::uv { diff --git a/wpinet/src/main/native/include/wpi/net/uv/Udp.hpp b/wpinet/src/main/native/include/wpi/net/uv/Udp.hpp index 8185ec44dd..404b367593 100644 --- a/wpinet/src/main/native/include/wpi/net/uv/Udp.hpp +++ b/wpinet/src/main/native/include/wpi/net/uv/Udp.hpp @@ -5,14 +5,14 @@ #ifndef WPINET_WPINET_SRC_MAIN_NATIVE_INCLUDE_WPI_NET_UV_UDP_HPP_ #define WPINET_WPINET_SRC_MAIN_NATIVE_INCLUDE_WPI_NET_UV_UDP_HPP_ -#include - #include #include #include #include #include +#include + #include "wpi/net/uv/Handle.hpp" #include "wpi/net/uv/Request.hpp" #include "wpi/util/Signal.h" diff --git a/wpinet/src/main/native/include/wpi/net/uv/Work.hpp b/wpinet/src/main/native/include/wpi/net/uv/Work.hpp index 258cc92f6c..366037cca0 100644 --- a/wpinet/src/main/native/include/wpi/net/uv/Work.hpp +++ b/wpinet/src/main/native/include/wpi/net/uv/Work.hpp @@ -5,12 +5,12 @@ #ifndef WPINET_WPINET_SRC_MAIN_NATIVE_INCLUDE_WPI_NET_UV_WORK_HPP_ #define WPINET_WPINET_SRC_MAIN_NATIVE_INCLUDE_WPI_NET_UV_WORK_HPP_ -#include - #include #include #include +#include + #include "wpi/net/uv/Request.hpp" #include "wpi/util/Signal.h" diff --git a/wpinet/src/main/native/include/wpi/net/uv/util.hpp b/wpinet/src/main/native/include/wpi/net/uv/util.hpp index fa9b86f2f3..fee1d669e5 100644 --- a/wpinet/src/main/native/include/wpi/net/uv/util.hpp +++ b/wpinet/src/main/native/include/wpi/net/uv/util.hpp @@ -5,11 +5,11 @@ #ifndef WPINET_WPINET_SRC_MAIN_NATIVE_INCLUDE_WPI_NET_UV_UTIL_HPP_ #define WPINET_WPINET_SRC_MAIN_NATIVE_INCLUDE_WPI_NET_UV_UTIL_HPP_ -#include - #include #include +#include + #ifdef _WIN32 #pragma comment(lib, "Ws2_32.lib") #endif diff --git a/wpinet/src/main/native/windows/DynamicDns.hpp b/wpinet/src/main/native/windows/DynamicDns.hpp index 0caf328ef3..01f55782cd 100644 --- a/wpinet/src/main/native/windows/DynamicDns.hpp +++ b/wpinet/src/main/native/windows/DynamicDns.hpp @@ -9,8 +9,7 @@ #endif #include - -#include +#include namespace wpi::net { class DynamicDns { diff --git a/wpinet/src/test/native/cpp/HttpParserTest.cpp b/wpinet/src/test/native/cpp/HttpParserTest.cpp index fd83339bf9..d2c608d6ae 100644 --- a/wpinet/src/test/native/cpp/HttpParserTest.cpp +++ b/wpinet/src/test/native/cpp/HttpParserTest.cpp @@ -2,7 +2,7 @@ // 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/net/HttpParser.hpp" // NOLINT(build/include_order) +#include "wpi/net/HttpParser.hpp" #include diff --git a/wpinet/src/test/native/cpp/HttpUtilTest.cpp b/wpinet/src/test/native/cpp/HttpUtilTest.cpp index 28335362d5..cfad7f0e31 100644 --- a/wpinet/src/test/native/cpp/HttpUtilTest.cpp +++ b/wpinet/src/test/native/cpp/HttpUtilTest.cpp @@ -2,7 +2,7 @@ // 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/net/HttpUtil.hpp" // NOLINT(build/include_order) +#include "wpi/net/HttpUtil.hpp" #include diff --git a/wpinet/src/test/native/cpp/HttpWebSocketServerConnectionTest.cpp b/wpinet/src/test/native/cpp/HttpWebSocketServerConnectionTest.cpp index 64f555a142..8038a692cd 100644 --- a/wpinet/src/test/native/cpp/HttpWebSocketServerConnectionTest.cpp +++ b/wpinet/src/test/native/cpp/HttpWebSocketServerConnectionTest.cpp @@ -2,7 +2,7 @@ // 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/net/HttpWebSocketServerConnection.hpp" // NOLINT(build/include_order) +#include "wpi/net/HttpWebSocketServerConnection.hpp" #include diff --git a/wpinet/src/test/native/cpp/WebSocketClientTest.cpp b/wpinet/src/test/native/cpp/WebSocketClientTest.cpp index d47472ccc0..fb66f86a1b 100644 --- a/wpinet/src/test/native/cpp/WebSocketClientTest.cpp +++ b/wpinet/src/test/native/cpp/WebSocketClientTest.cpp @@ -2,7 +2,9 @@ // 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/net/WebSocket.hpp" // NOLINT(build/include_order) +// clang-format off +#include "wpi/net/WebSocket.hpp" +// clang-format on #include #include diff --git a/wpinet/src/test/native/cpp/WebSocketIntegrationTest.cpp b/wpinet/src/test/native/cpp/WebSocketIntegrationTest.cpp index d9bba03905..e34e3f8bb6 100644 --- a/wpinet/src/test/native/cpp/WebSocketIntegrationTest.cpp +++ b/wpinet/src/test/native/cpp/WebSocketIntegrationTest.cpp @@ -2,7 +2,9 @@ // 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/net/WebSocketServer.hpp" // NOLINT(build/include_order) +// clang-format off +#include "wpi/net/WebSocketServer.hpp" +// clang-format on #include diff --git a/wpinet/src/test/native/cpp/WebSocketSerializerTest.cpp b/wpinet/src/test/native/cpp/WebSocketSerializerTest.cpp index 5c38177a4f..62981e3d97 100644 --- a/wpinet/src/test/native/cpp/WebSocketSerializerTest.cpp +++ b/wpinet/src/test/native/cpp/WebSocketSerializerTest.cpp @@ -2,7 +2,7 @@ // 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 "WebSocketSerializer.hpp" // NOLINT(build/include_order) +#include "WebSocketSerializer.hpp" #include #include diff --git a/wpinet/src/test/native/cpp/WebSocketServerTest.cpp b/wpinet/src/test/native/cpp/WebSocketServerTest.cpp index 141f8752e9..60ea8fa9fd 100644 --- a/wpinet/src/test/native/cpp/WebSocketServerTest.cpp +++ b/wpinet/src/test/native/cpp/WebSocketServerTest.cpp @@ -2,7 +2,9 @@ // 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/net/WebSocket.hpp" // NOLINT(build/include_order) +// clang-format off +#include "wpi/net/WebSocket.hpp" +// clang-format on #include #include diff --git a/wpinet/src/test/native/cpp/WebSocketTest.cpp b/wpinet/src/test/native/cpp/WebSocketTest.cpp index 71a709174a..25a1c0b9bf 100644 --- a/wpinet/src/test/native/cpp/WebSocketTest.cpp +++ b/wpinet/src/test/native/cpp/WebSocketTest.cpp @@ -2,13 +2,12 @@ // 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/net/WebSocket.hpp" // NOLINT(build/include_order) - -#include "WebSocketTest.hpp" +#include "wpi/net/WebSocket.hpp" #include #include +#include "WebSocketTest.hpp" #include "wpi/net/HttpParser.hpp" #include "wpi/util/StringExtras.hpp" diff --git a/wpinet/src/test/native/cpp/WorkerThreadTest.cpp b/wpinet/src/test/native/cpp/WorkerThreadTest.cpp index b63f7385d2..061542f0dd 100644 --- a/wpinet/src/test/native/cpp/WorkerThreadTest.cpp +++ b/wpinet/src/test/native/cpp/WorkerThreadTest.cpp @@ -2,7 +2,7 @@ // 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/net/WorkerThread.hpp" // NOLINT(build/include_order) +#include "wpi/net/WorkerThread.hpp" #include diff --git a/wpinet/src/test/native/cpp/raw_uv_stream_test.cpp b/wpinet/src/test/native/cpp/raw_uv_ostream_test.cpp similarity index 87% rename from wpinet/src/test/native/cpp/raw_uv_stream_test.cpp rename to wpinet/src/test/native/cpp/raw_uv_ostream_test.cpp index bdfae8b364..0b0686cad0 100644 --- a/wpinet/src/test/native/cpp/raw_uv_stream_test.cpp +++ b/wpinet/src/test/native/cpp/raw_uv_ostream_test.cpp @@ -2,13 +2,13 @@ // 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/net/raw_uv_ostream.hpp" // NOLINT(build/include_order) +#include "wpi/net/raw_uv_ostream.hpp" #include namespace wpi::net { -TEST(RawUvStreamTest, BasicWrite) { +TEST(RawUvOstreamTest, BasicWrite) { wpi::util::SmallVector bufs; raw_uv_ostream os(bufs, 1024); os << "12"; @@ -25,7 +25,7 @@ TEST(RawUvStreamTest, BasicWrite) { } } -TEST(RawUvStreamTest, BoundaryWrite) { +TEST(RawUvOstreamTest, BoundaryWrite) { wpi::util::SmallVector bufs; raw_uv_ostream os(bufs, 4); ASSERT_EQ(bufs.size(), 0u); @@ -41,7 +41,7 @@ TEST(RawUvStreamTest, BoundaryWrite) { } } -TEST(RawUvStreamTest, LargeWrite) { +TEST(RawUvOstreamTest, LargeWrite) { wpi::util::SmallVector bufs; raw_uv_ostream os(bufs, 4); os << "123456"; @@ -54,7 +54,7 @@ TEST(RawUvStreamTest, LargeWrite) { } } -TEST(RawUvStreamTest, PrevDataWrite) { +TEST(RawUvOstreamTest, PrevDataWrite) { wpi::util::SmallVector bufs; bufs.emplace_back(uv::Buffer::Allocate(1024)); raw_uv_ostream os(bufs, 1024); diff --git a/wpinet/src/test/native/cpp/uv/UvAsyncFunctionTest.cpp b/wpinet/src/test/native/cpp/uv/UvAsyncFunctionTest.cpp index e51387dbc4..ab74f524b8 100644 --- a/wpinet/src/test/native/cpp/uv/UvAsyncFunctionTest.cpp +++ b/wpinet/src/test/native/cpp/uv/UvAsyncFunctionTest.cpp @@ -2,7 +2,9 @@ // 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/net/uv/AsyncFunction.hpp" // NOLINT(build/include_order) +// clang-format off +#include "wpi/net/uv/AsyncFunction.hpp" +// clang-format on #include #include diff --git a/wpinet/src/test/native/cpp/uv/UvAsyncTest.cpp b/wpinet/src/test/native/cpp/uv/UvAsyncTest.cpp index 57a82f7eaa..2aaa1f27c6 100644 --- a/wpinet/src/test/native/cpp/uv/UvAsyncTest.cpp +++ b/wpinet/src/test/native/cpp/uv/UvAsyncTest.cpp @@ -23,7 +23,9 @@ * IN THE SOFTWARE. */ -#include "wpi/net/uv/Async.hpp" // NOLINT(build/include_order) +// clang-format off +#include "wpi/net/uv/Async.hpp" +// clang-format on #include #include diff --git a/wpinet/src/test/native/cpp/uv/UvBufferTest.cpp b/wpinet/src/test/native/cpp/uv/UvBufferTest.cpp index 10860edee5..3a117fd750 100644 --- a/wpinet/src/test/native/cpp/uv/UvBufferTest.cpp +++ b/wpinet/src/test/native/cpp/uv/UvBufferTest.cpp @@ -2,7 +2,9 @@ // 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/net/uv/Buffer.hpp" // NOLINT(build/include_order) +// clang-format off +#include "wpi/net/uv/Buffer.hpp" +// clang-format on #include diff --git a/wpinet/src/test/native/cpp/uv/UvGetAddrInfoTest.cpp b/wpinet/src/test/native/cpp/uv/UvGetAddrInfoTest.cpp index 8553664264..67b0ea2ed5 100644 --- a/wpinet/src/test/native/cpp/uv/UvGetAddrInfoTest.cpp +++ b/wpinet/src/test/native/cpp/uv/UvGetAddrInfoTest.cpp @@ -23,7 +23,9 @@ * IN THE SOFTWARE. */ -#include "wpi/net/uv/GetAddrInfo.hpp" // NOLINT(build/include_order) +// clang-format off +#include "wpi/net/uv/GetAddrInfo.hpp" +// clang-format on #include diff --git a/wpinet/src/test/native/cpp/uv/UvGetNameInfoTest.cpp b/wpinet/src/test/native/cpp/uv/UvGetNameInfoTest.cpp index c9e0d51e11..6a2863f926 100644 --- a/wpinet/src/test/native/cpp/uv/UvGetNameInfoTest.cpp +++ b/wpinet/src/test/native/cpp/uv/UvGetNameInfoTest.cpp @@ -23,7 +23,9 @@ * IN THE SOFTWARE. */ -#include "wpi/net/uv/GetNameInfo.hpp" // NOLINT(build/include_order) +// clang-format off +#include "wpi/net/uv/GetNameInfo.hpp" +// clang-format on #include diff --git a/wpinet/src/test/native/cpp/uv/UvLoopWalkTest.cpp b/wpinet/src/test/native/cpp/uv/UvLoopTest.cpp similarity index 97% rename from wpinet/src/test/native/cpp/uv/UvLoopWalkTest.cpp rename to wpinet/src/test/native/cpp/uv/UvLoopTest.cpp index 98b58c4864..38c1e78b0b 100644 --- a/wpinet/src/test/native/cpp/uv/UvLoopWalkTest.cpp +++ b/wpinet/src/test/native/cpp/uv/UvLoopTest.cpp @@ -23,7 +23,9 @@ * IN THE SOFTWARE. */ -#include "wpi/net/uv/Loop.hpp" // NOLINT(build/include_order) +// clang-format off +#include "wpi/net/uv/Loop.hpp" +// clang-format on #include diff --git a/wpinet/src/test/native/cpp/uv/UvTimerTest.cpp b/wpinet/src/test/native/cpp/uv/UvTimerTest.cpp index be1de6589d..4ea4880ed1 100644 --- a/wpinet/src/test/native/cpp/uv/UvTimerTest.cpp +++ b/wpinet/src/test/native/cpp/uv/UvTimerTest.cpp @@ -2,7 +2,9 @@ // 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/net/uv/Timer.hpp" // NOLINT(build/include_order) +// clang-format off +#include "wpi/net/uv/Timer.hpp" +// clang-format on #include diff --git a/wpiutil/.styleguide b/wpiutil/.styleguide index f908152948..5371065b95 100644 --- a/wpiutil/.styleguide +++ b/wpiutil/.styleguide @@ -44,14 +44,6 @@ repoRootNameOverride { wpiutil } -includeOtherLibs { - ^catch2/ - ^fmt/ - ^gmock/ - ^gtest/ - ^upb/ -} - includeGuardRoots { wpiutil/src/main/native/cpp/ wpiutil/src/main/native/include/ diff --git a/wpiutil/src/main/native/cpp/MappedFileRegion.cpp b/wpiutil/src/main/native/cpp/MappedFileRegion.cpp index e11d5fd01d..e73bfad27c 100644 --- a/wpiutil/src/main/native/cpp/MappedFileRegion.cpp +++ b/wpiutil/src/main/native/cpp/MappedFileRegion.cpp @@ -10,17 +10,12 @@ #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif - -#include // NOLINT(build/include_order) - +#include #include #include - #else // _WIN32 - #include #include - #endif // _WIN32 #ifdef _MSC_VER diff --git a/wpiutil/src/main/native/cpp/RuntimeCheck.cpp b/wpiutil/src/main/native/cpp/RuntimeCheck.cpp index 17626237ca..09c06e3b6e 100644 --- a/wpiutil/src/main/native/cpp/RuntimeCheck.cpp +++ b/wpiutil/src/main/native/cpp/RuntimeCheck.cpp @@ -8,7 +8,7 @@ #include #include #pragma comment(lib, "version.lib") // for VerQueryValueW -#include "Windows.h" +#include extern "C" int32_t WPI_IsRuntimeValid(uint32_t* foundMajor, uint32_t* foundMinor, uint32_t* expectedMajor, diff --git a/wpiutil/src/main/native/cpp/string.cpp b/wpiutil/src/main/native/cpp/string.cpp index d4c766da16..c94fc3d419 100644 --- a/wpiutil/src/main/native/cpp/string.cpp +++ b/wpiutil/src/main/native/cpp/string.cpp @@ -2,9 +2,9 @@ // 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 "string" #include "wpi/util/string.h" +#include #include #include "wpi/util/MemAlloc.hpp" diff --git a/wpiutil/src/main/native/include/wpi/util/Synchronization.h b/wpiutil/src/main/native/include/wpi/util/Synchronization.h index 24086e518e..7759110507 100644 --- a/wpiutil/src/main/native/include/wpi/util/Synchronization.h +++ b/wpiutil/src/main/native/include/wpi/util/Synchronization.h @@ -5,8 +5,7 @@ #pragma once #ifdef __cplusplus -#include // NOLINT - +#include #include #include #endif diff --git a/wpiutil/src/main/native/unix/Demangle.cpp b/wpiutil/src/main/native/unix/Demangle.cpp index 719ff43de0..4d9996afaf 100644 --- a/wpiutil/src/main/native/unix/Demangle.cpp +++ b/wpiutil/src/main/native/unix/Demangle.cpp @@ -4,9 +4,8 @@ #include "wpi/util/Demangle.hpp" -#include - #include +#include #include #include "wpi/util/SmallString.hpp" diff --git a/wpiutil/src/main/native/windows/Demangle.cpp b/wpiutil/src/main/native/windows/Demangle.cpp index e2cb52b9fc..9812aa62c2 100644 --- a/wpiutil/src/main/native/windows/Demangle.cpp +++ b/wpiutil/src/main/native/windows/Demangle.cpp @@ -4,8 +4,7 @@ #include "wpi/util/Demangle.hpp" -#include // NOLINT(build/include_order) - +#include #include #include diff --git a/wpiutil/src/test/native/cpp/ArrayTest.cpp b/wpiutil/src/test/native/cpp/ArrayTest.cpp index 6568b30df8..6ccbc51361 100644 --- a/wpiutil/src/test/native/cpp/ArrayTest.cpp +++ b/wpiutil/src/test/native/cpp/ArrayTest.cpp @@ -2,10 +2,10 @@ // 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 - #include "wpi/util/array.hpp" +#include + namespace { class MoveOnlyType { public: diff --git a/wpiutil/src/test/native/cpp/Base64Test.cpp b/wpiutil/src/test/native/cpp/Base64Test.cpp index e7254a2802..df58897e67 100644 --- a/wpiutil/src/test/native/cpp/Base64Test.cpp +++ b/wpiutil/src/test/native/cpp/Base64Test.cpp @@ -2,11 +2,12 @@ // 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/util/Base64.hpp" + #include #include -#include "wpi/util/Base64.hpp" #include "wpi/util/SmallString.hpp" namespace wpi::util { diff --git a/wpiutil/src/test/native/cpp/FastQueueTest.cpp b/wpiutil/src/test/native/cpp/FastQueueTest.cpp index fdc70c04c5..42ced84479 100644 --- a/wpiutil/src/test/native/cpp/FastQueueTest.cpp +++ b/wpiutil/src/test/native/cpp/FastQueueTest.cpp @@ -2,10 +2,10 @@ // 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 - #include "wpi/util/FastQueue.hpp" +#include + TEST(FastQueueTest, Basic) { wpi::util::FastQueue q; q.enqueue(25); diff --git a/wpiutil/src/test/native/cpp/StringExtrasTest.cpp b/wpiutil/src/test/native/cpp/StringExtrasTest.cpp index 60ce91dc9a..670d2f9509 100644 --- a/wpiutil/src/test/native/cpp/StringExtrasTest.cpp +++ b/wpiutil/src/test/native/cpp/StringExtrasTest.cpp @@ -2,10 +2,10 @@ // 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 - #include "wpi/util/StringExtras.hpp" +#include + TEST(StringExtrasTest, RemovePrefix) { std::string_view original = "wpilib"; auto modified = wpi::util::remove_prefix(original, "wpi"); diff --git a/wpiutil/src/test/native/cpp/StringMapTest.cpp b/wpiutil/src/test/native/cpp/StringMapTest.cpp index 52d16f465f..48679c1ea3 100644 --- a/wpiutil/src/test/native/cpp/StringMapTest.cpp +++ b/wpiutil/src/test/native/cpp/StringMapTest.cpp @@ -10,7 +10,7 @@ // //===----------------------------------------------------------------------===// -#include "wpi/util/StringMap.hpp" // NOLINT(build/include_order) +#include "wpi/util/StringMap.hpp" #include #include diff --git a/wpiutil/src/test/native/cpp/SynchronizationTest.cpp b/wpiutil/src/test/native/cpp/SynchronizationTest.cpp index e9e13731b5..49c3301cce 100644 --- a/wpiutil/src/test/native/cpp/SynchronizationTest.cpp +++ b/wpiutil/src/test/native/cpp/SynchronizationTest.cpp @@ -2,7 +2,7 @@ // 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/util/Synchronization.h" // NOLINT(build/include_order) +#include "wpi/util/Synchronization.h" #include diff --git a/wpiutil/src/test/native/cpp/UidVectorTest.cpp b/wpiutil/src/test/native/cpp/UidVectorTest.cpp index 299d85ff38..c597eae55b 100644 --- a/wpiutil/src/test/native/cpp/UidVectorTest.cpp +++ b/wpiutil/src/test/native/cpp/UidVectorTest.cpp @@ -2,7 +2,7 @@ // 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/util/UidVector.hpp" // NOLINT(build/include_order) +#include "wpi/util/UidVector.hpp" #include diff --git a/wpiutil/src/test/native/cpp/CircularBufferTest.cpp b/wpiutil/src/test/native/cpp/circular_buffer_test.cpp similarity index 98% rename from wpiutil/src/test/native/cpp/CircularBufferTest.cpp rename to wpiutil/src/test/native/cpp/circular_buffer_test.cpp index f42af0e79e..963a906b19 100644 --- a/wpiutil/src/test/native/cpp/CircularBufferTest.cpp +++ b/wpiutil/src/test/native/cpp/circular_buffer_test.cpp @@ -2,7 +2,7 @@ // 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/util/circular_buffer.hpp" // NOLINT(build/include_order) +#include "wpi/util/circular_buffer.hpp" #include diff --git a/wpiutil/src/test/native/cpp/ct_string_test.cpp b/wpiutil/src/test/native/cpp/ct_string_test.cpp index efbe5656f1..5c2eb5fe3f 100644 --- a/wpiutil/src/test/native/cpp/ct_string_test.cpp +++ b/wpiutil/src/test/native/cpp/ct_string_test.cpp @@ -2,7 +2,7 @@ // 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/util/ct_string.hpp" // NOLINT(build/include_order) +#include "wpi/util/ct_string.hpp" #include #include diff --git a/wpiutil/src/test/native/cpp/expected/ExpectedTest.cpp b/wpiutil/src/test/native/cpp/expected/ExpectedTest.cpp index b5d936d332..ef7e2475a5 100644 --- a/wpiutil/src/test/native/cpp/expected/ExpectedTest.cpp +++ b/wpiutil/src/test/native/cpp/expected/ExpectedTest.cpp @@ -2,6 +2,8 @@ // 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/util/expected" + #include #include #include @@ -9,8 +11,6 @@ #include -#include "wpi/util/expected" - namespace { struct TakesInitAndVariadic { std::vector v; diff --git a/wpiutil/src/test/native/cpp/future_test.cpp b/wpiutil/src/test/native/cpp/future_test.cpp index 957654a69f..8c11f6f96e 100644 --- a/wpiutil/src/test/native/cpp/future_test.cpp +++ b/wpiutil/src/test/native/cpp/future_test.cpp @@ -2,7 +2,7 @@ // 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/util/future.hpp" // NOLINT(build/include_order) +#include "wpi/util/future.hpp" #include diff --git a/wpiutil/src/test/native/cpp/InterpolatingMapTest.cpp b/wpiutil/src/test/native/cpp/interpolating_map_test.cpp similarity index 94% rename from wpiutil/src/test/native/cpp/InterpolatingMapTest.cpp rename to wpiutil/src/test/native/cpp/interpolating_map_test.cpp index b7a1b24c35..5e28292edd 100644 --- a/wpiutil/src/test/native/cpp/InterpolatingMapTest.cpp +++ b/wpiutil/src/test/native/cpp/interpolating_map_test.cpp @@ -2,7 +2,7 @@ // 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/util/interpolating_map.hpp" // NOLINT(build/include_order) +#include "wpi/util/interpolating_map.hpp" #include diff --git a/wpiutil/src/test/native/cpp/priority_mutex_test.cpp b/wpiutil/src/test/native/cpp/priority_mutex_test.cpp index f118abdfb5..626a537364 100644 --- a/wpiutil/src/test/native/cpp/priority_mutex_test.cpp +++ b/wpiutil/src/test/native/cpp/priority_mutex_test.cpp @@ -2,7 +2,7 @@ // 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/util/priority_mutex.hpp" // NOLINT(build/include_order) +#include "wpi/util/priority_mutex.hpp" #include #include diff --git a/wpiutil/src/test/native/cpp/rotated_span_test.cpp b/wpiutil/src/test/native/cpp/rotated_span_test.cpp index 330715c801..13b5eca01a 100644 --- a/wpiutil/src/test/native/cpp/rotated_span_test.cpp +++ b/wpiutil/src/test/native/cpp/rotated_span_test.cpp @@ -2,7 +2,7 @@ // 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/util/rotated_span.hpp" // NOLINT(build/include_order) +#include "wpi/util/rotated_span.hpp" #include #include @@ -25,7 +25,7 @@ static std::array sarr_values = {{0, 1, 2, 3, 4, 5, 6, 7, 8, 9}}; static int arr_values[10] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; static std::vector vec_values{0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; -TEST(CircularSpanTest, Constexpr) { +TEST(RotatedSpanTest, Constexpr) { { constexpr wpi::util::rotated_span sp{cesarr_values}; static_assert(sp[5] == cesarr_values[5]); @@ -36,7 +36,7 @@ TEST(CircularSpanTest, Constexpr) { } } -TEST(CircularSpanTest, ConstructConst) { +TEST(RotatedSpanTest, ConstructConst) { { wpi::util::rotated_span sp{csarr_values}; EXPECT_EQ(sp[5], sarr_values[5]); @@ -65,7 +65,7 @@ TEST(CircularSpanTest, ConstructConst) { } } -TEST(CircularSpanTest, ConstructNonConst) { +TEST(RotatedSpanTest, ConstructNonConst) { { wpi::util::rotated_span sp{sarr_values}; EXPECT_EQ(sp[5], sarr_values[5]); @@ -92,7 +92,7 @@ TEST(CircularSpanTest, ConstructNonConst) { } } -TEST(CircularSpanTest, ConstructRotated) { +TEST(RotatedSpanTest, ConstructRotated) { { constexpr wpi::util::rotated_span sp{cesarr_values, 1}; static_assert(sp[5] == cesarr_values[6]); @@ -128,7 +128,7 @@ TEST(CircularSpanTest, ConstructRotated) { } } -TEST(CircularSpanTest, Rotate) { +TEST(RotatedSpanTest, Rotate) { constexpr wpi::util::rotated_span sp{cesarr_values, 1}; static_assert(sp[5] == cesarr_values[6]); static_assert(sp.rotate(2)[5] == cesarr_values[8]); @@ -147,7 +147,7 @@ void const_unsized_func(wpi::util::rotated_span) {} void sized_func(wpi::util::rotated_span) {} void const_sized_func(wpi::util::rotated_span) {} -TEST(CircularSpanTest, Implicit) { +TEST(RotatedSpanTest, Implicit) { // unsized_func(csarr_values); // error const_unsized_func(csarr_values); // sized_func(csarr_values); // error @@ -169,7 +169,7 @@ TEST(CircularSpanTest, Implicit) { const_sized_func(arr_values); } -TEST(CircularSpanTest, IteratorConst) { +TEST(RotatedSpanTest, IteratorConst) { wpi::util::rotated_span sp_sarr{csarr_values}; // iterator @@ -187,7 +187,7 @@ TEST(CircularSpanTest, IteratorConst) { } } -TEST(CircularSpanTest, IteratorNonConst) { +TEST(RotatedSpanTest, IteratorNonConst) { wpi::util::rotated_span sp_sarr{sarr_values}; // iterator diff --git a/wpiutil/src/test/native/cpp/sha1Test.cpp b/wpiutil/src/test/native/cpp/sha1_test.cpp similarity index 100% rename from wpiutil/src/test/native/cpp/sha1Test.cpp rename to wpiutil/src/test/native/cpp/sha1_test.cpp index d2327006d3..a4cf3850ee 100644 --- a/wpiutil/src/test/native/cpp/sha1Test.cpp +++ b/wpiutil/src/test/native/cpp/sha1_test.cpp @@ -19,12 +19,12 @@ -- Volker Grabsch */ +#include "wpi/util/sha1.hpp" + #include #include -#include "wpi/util/sha1.hpp" - namespace wpi::util { /* diff --git a/wpiutil/src/test/native/cpp/sigslot/function-traits.cpp b/wpiutil/src/test/native/cpp/sigslot/function-traits.cpp index 2ebd828960..e3531c5376 100644 --- a/wpiutil/src/test/native/cpp/sigslot/function-traits.cpp +++ b/wpiutil/src/test/native/cpp/sigslot/function-traits.cpp @@ -31,7 +31,9 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include "wpi/util/Signal.h" // NOLINT(build/include_order) +// clang-format off +#include "wpi/util/Signal.h" +// clang-format on #include diff --git a/wpiutil/src/test/native/cpp/sigslot/recursive.cpp b/wpiutil/src/test/native/cpp/sigslot/recursive.cpp index da5a65afd5..42559c57f0 100644 --- a/wpiutil/src/test/native/cpp/sigslot/recursive.cpp +++ b/wpiutil/src/test/native/cpp/sigslot/recursive.cpp @@ -31,7 +31,9 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include "wpi/util/Signal.h" // NOLINT(build/include_order) +// clang-format off +#include "wpi/util/Signal.h" +// clang-format on #include diff --git a/wpiutil/src/test/native/cpp/sigslot/signal-extended.cpp b/wpiutil/src/test/native/cpp/sigslot/signal-extended.cpp index 7666e0758e..b2b4528fc0 100644 --- a/wpiutil/src/test/native/cpp/sigslot/signal-extended.cpp +++ b/wpiutil/src/test/native/cpp/sigslot/signal-extended.cpp @@ -31,7 +31,9 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include "wpi/util/Signal.h" // NOLINT(build/include_order) +// clang-format off +#include "wpi/util/Signal.h" +// clang-format on #include diff --git a/wpiutil/src/test/native/cpp/sigslot/signal-threaded.cpp b/wpiutil/src/test/native/cpp/sigslot/signal-threaded.cpp index 90865de56d..5d970aab44 100644 --- a/wpiutil/src/test/native/cpp/sigslot/signal-threaded.cpp +++ b/wpiutil/src/test/native/cpp/sigslot/signal-threaded.cpp @@ -31,7 +31,9 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include "wpi/util/Signal.h" // NOLINT(build/include_order) +// clang-format off +#include "wpi/util/Signal.h" +// clang-format on #include #include diff --git a/wpiutil/src/test/native/cpp/sigslot/signal-tracking.cpp b/wpiutil/src/test/native/cpp/sigslot/signal-tracking.cpp index b72badc86c..34645b5691 100644 --- a/wpiutil/src/test/native/cpp/sigslot/signal-tracking.cpp +++ b/wpiutil/src/test/native/cpp/sigslot/signal-tracking.cpp @@ -31,7 +31,9 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include "wpi/util/Signal.h" // NOLINT(build/include_order) +// clang-format off +#include "wpi/util/Signal.h" +// clang-format on #include #include diff --git a/wpiutil/src/test/native/cpp/sigslot/signal.cpp b/wpiutil/src/test/native/cpp/sigslot/signal.cpp index c421772fa6..fb87097484 100644 --- a/wpiutil/src/test/native/cpp/sigslot/signal.cpp +++ b/wpiutil/src/test/native/cpp/sigslot/signal.cpp @@ -31,7 +31,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include "wpi/util/Signal.h" // NOLINT(build/include_order) +#include "wpi/util/Signal.h" #include #include diff --git a/wpiutil/src/test/native/cpp/spinlock_bench.cpp b/wpiutil/src/test/native/cpp/spinlock_bench.cpp index 25630ab492..05e94e51f6 100644 --- a/wpiutil/src/test/native/cpp/spinlock_bench.cpp +++ b/wpiutil/src/test/native/cpp/spinlock_bench.cpp @@ -2,7 +2,7 @@ // 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/util/spinlock.hpp" // NOLINT(build/include_order) +#include "wpi/util/spinlock.hpp" #include #include diff --git a/wpiutil/src/test/native/cpp/StaticCircularBufferTest.cpp b/wpiutil/src/test/native/cpp/static_circular_buffer_test.cpp similarity index 97% rename from wpiutil/src/test/native/cpp/StaticCircularBufferTest.cpp rename to wpiutil/src/test/native/cpp/static_circular_buffer_test.cpp index 22644ee704..e344aebf18 100644 --- a/wpiutil/src/test/native/cpp/StaticCircularBufferTest.cpp +++ b/wpiutil/src/test/native/cpp/static_circular_buffer_test.cpp @@ -2,7 +2,7 @@ // 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/util/static_circular_buffer.hpp" // NOLINT(build/include_order) +#include "wpi/util/static_circular_buffer.hpp" #include diff --git a/wpiutil/src/test/native/cpp/struct/DynamicStructTest.cpp b/wpiutil/src/test/native/cpp/struct/DynamicStructTest.cpp index fe380f0d65..cdb934401e 100644 --- a/wpiutil/src/test/native/cpp/struct/DynamicStructTest.cpp +++ b/wpiutil/src/test/native/cpp/struct/DynamicStructTest.cpp @@ -2,7 +2,7 @@ // 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/util/struct/DynamicStruct.hpp" // NOLINT(build/include_order) +#include "wpi/util/struct/DynamicStruct.hpp" #include diff --git a/wpiutil/src/test/native/cpp/struct/SchemaParserTest.cpp b/wpiutil/src/test/native/cpp/struct/SchemaParserTest.cpp index e42986f7b3..52236facba 100644 --- a/wpiutil/src/test/native/cpp/struct/SchemaParserTest.cpp +++ b/wpiutil/src/test/native/cpp/struct/SchemaParserTest.cpp @@ -2,7 +2,7 @@ // 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/util/struct/SchemaParser.hpp" // NOLINT(build/include_order) +#include "wpi/util/struct/SchemaParser.hpp" #include