Files
allwpilib/styleguide/spotbugs-exclude.xml
Peter Johnson dacded37e5 [hal, wpilib] Add OpMode support (#7744)
User code:
- OpModeRobot used as the robot base class
- LinearOpMode and PeriodicOpMode are provided opmode base classes
- In Java, annotations can be used to automatically register opmode classes

Additional user code functionality:
- OpMode (string) is available in addition to the overall
auto/teleop/test robot mode
- OpMode does not indicate enable (enable/disable is still separate)
- The HAL API uses integer UIDs; these are exposed at the user API level
as well for faster checks
- User code creates opmodes on startup (these have name, category,
description, etc).

DS:
- DS will present opmode selection lists for auto and teleop for
match/practice. During a match, the DS will automatically activate the
selected opmode in the corresponding match period.
- For testing, an overall mode is selected (e.g. teleop/auto/test) and a
single opmode is selected

Future work:
- Command framework support/integration
- Python annotation support
- Unit tests (needs race-free DS sim updates)
- Porting of examples

Co-authored-by: Joseph Eng <91924258+KangarooKoala@users.noreply.github.com>
2025-12-12 20:25:57 -08:00

177 lines
6.4 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<FindBugsFilter>
<Match>
<Bug pattern="AT_NONATOMIC_64BIT_PRIMITIVE" />
<Class name="org.wpilib.system.Watchdog" />
</Match>
<Match>
<Bug pattern="AT_STALE_THREAD_WRITE_OF_PRIMITIVE" />
<Or>
<Class name="org.wpilib.driverstation.DriverStation" />
<Class name="org.wpilib.driverstation.GenericHID" />
<Class name="org.wpilib.command2.CommandScheduler" />
</Or>
</Match>
<Match>
<Bug pattern="CT_CONSTRUCTOR_THROW" />
</Match>
<Match>
<Bug pattern="DE_MIGHT_IGNORE" />
<Class name="org.wpilib.smartdashboard.SendableBuilderImpl$Property" />
</Match>
<Match>
<Bug pattern="DM_DEFAULT_ENCODING" />
<Or>
<Class name="org.wpilib.epilogue.processor.EpilogueGenerator" />
<Class name="org.wpilib.examples.i2ccommunication.I2CCommunicationTest" />
<Class name="org.wpilib.command2.PrintCommandTest" />
</Or>
</Match>
<Match>
<Bug pattern="DM_EXIT" />
<Class name="org.wpilib.framework.OpModeRobot" />
</Match>
<Match>
<Bug pattern="DMI_HARDCODED_ABSOLUTE_FILENAME" />
<Or>
<Class name="org.wpilib.system.DataLogManager" />
<Class name="org.wpilib.system.Filesystem" />
<Class name="org.wpilib.util.runtime.CombinedRuntimeLoader" />
<Class name="org.wpilib.util.runtime.RuntimeDetector" />
</Or>
</Match>
<Match>
<!--
These are false positives where the Random instance is used multiple times in a loop. Futhermore, high randomness is not a
high priority because these are tests- In fact, the odometry tests seed the Random instance to guarantee repeatability.
-->
<Bug pattern="DMI_RANDOM_USED_ONLY_ONCE" />
<Or>
<Class name="org.wpilib.math.kinematics.SwerveDriveOdometry3dTest" />
<Class name="org.wpilib.math.kinematics.SwerveDriveOdometryTest" />
<Class name="org.wpilib.math.filter.LinearFilterTest" />
</Or>
</Match>
<Match>
<Bug pattern="EI_EXPOSE_REP" />
</Match>
<Match>
<Bug pattern="EI_EXPOSE_REP2" />
</Match>
<!--
Strict reading of Object.equals() contract means that whenever equals() behaviour is defined, all implementations
need to adhere to it. The only reason to override the method (assuming correct API design, of course) is to provide
a more efficient implementation. This rule would be forcing a @SuppressFBWarnings on perfectly compliant classes.
More information at https://github.com/spotbugs/spotbugs/issues/511
-->
<Match>
<Bug pattern="EQ_DOESNT_OVERRIDE_EQUALS" />
</Match>
<Match>
<Bug pattern="FL_FLOATS_AS_LOOP_COUNTERS" />
<Or>
<Class name="org.wpilib.math.controller.DifferentialDriveAccelerationLimiterTest" />
<Class name="org.wpilib.math.controller.ImplicitModelFollowerTest" />
<Class name="org.wpilib.math.controller.LinearSystemLoopTest" />
<Class name="~org\.wpilib\.math\.estimator\.[^.]*PoseEstimator(3d)?Test" />
<Class name="org.wpilib.math.filter.LinearFilterTest" />
<Class name="org.wpilib.math.kinematics.ChassisSpeedsTest" />
<Class name="org.wpilib.hardware.led.LEDPatternTest" />
<Class name="org.wpilib.simulation.AnalogInputSimTest" />
</Or>
</Match>
<Match>
<Bug pattern="IS2_INCONSISTENT_SYNC" />
<Class name="org.wpilib.smartdashboard.MechanismLigament2d" />
</Match>
<Match>
<Bug pattern="MS_EXPOSE_REP" />
</Match>
<Match>
<Bug pattern="MS_MUTABLE_ARRAY" />
</Match>
<Match>
<!--
This seems to be a false positive from the &= used by these command compositions to determine runsWhenDisabled
-->
<Bug pattern="NS_DANGEROUS_NON_SHORT_CIRCUIT" />
<Or>
<Class name="org.wpilib.command2.ParallelCommandGroup" />
<Class name="org.wpilib.command2.ParallelDeadlineGroup" />
<Class name="org.wpilib.command2.ParallelRaceGroup" />
<Class name="org.wpilib.command2.SequentialCommandGroup" />
<Class name="org.wpilib.command2.SelectCommand" />
</Or>
</Match>
<Match>
<Bug pattern="PA_PUBLIC_PRIMITIVE_ATTRIBUTE" />
</Match>
<Match>
<Bug pattern="RV_RETURN_VALUE_IGNORED_BAD_PRACTICE" />
<Class name="org.wpilib.util.runtime.CombinedRuntimeLoader" />
</Match>
<Match>
<Bug pattern="RV_RETURN_VALUE_OF_PUTIFABSENT_IGNORED" />
<Class name="org.wpilib.networktables.NetworkTableInstance" />
</Match>
<Match>
<Bug pattern="SC_START_IN_CTOR" />
<Class name="org.wpilib.hardware.motor.MotorSafety" />
</Match>
<Match>
<Bug pattern="SF_SWITCH_FALLTHROUGH" />
<Class name="org.wpilib.vision.stream.CameraServer$PropertyPublisher" />
</Match>
<Match>
<Bug pattern="SING_SINGLETON_HAS_NONPRIVATE_CONSTRUCTOR" />
<Or>
<Class name="org.wpilib.command2.CommandScheduler" />
<Class name="org.wpilib.math.geometry.CoordinateAxis" />
<Class name="org.wpilib.math.geometry.CoordinateSystem" />
</Or>
</Match>
<Match>
<!--
Many false positives from instance reporting.
-->
<Bug pattern="ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD" />
</Match>
<Match>
<!--
False positives because the users are supposed to fill in the code.
-->
<Bug pattern="UC_USELESS_VOID_METHOD" />
<Or>
<Class name="org.wpilib.templates.romitimed.Robot" />
<Class name="org.wpilib.templates.xrptimed.Robot" />
<Class name="org.wpilib.templates.timed.Robot" />
<Class name="org.wpilib.templates.timeslice.Robot" />
</Or>
</Match>
<Match>
<Bug pattern="URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD" />
</Match>
<Match>
<Bug pattern="UUF_UNUSED_PUBLIC_OR_PROTECTED_FIELD" />
<Class name="org.wpilib.epilogue.EpilogueConfiguration" />
</Match>
<Match>
<!-- PMD will skip variables named `ignore`, but spotbugs isn't as smart -->
<Bug pattern="DLS_DEAD_LOCAL_STORE" />
<Class name="org.wpilib.command3.StagedCommandBuilderTest" />
</Match>
<Match>
<Bug pattern="VA_FORMAT_STRING_USES_NEWLINE" />
<Or>
<Class name="org.wpilib.epilogue.processor.LoggableHandler" />
<Class name="org.wpilib.util.runtime.MsvcRuntimeException" />
<Class name="org.wpilib.util.runtime.RuntimeLoader" />
<Class name="org.wpilib.system.Tracer" />
<Class name="org.wpilib.system.Watchdog" />
<Class name="org.wpilib.math.system.LinearSystem" />
<Class name="org.wpilib.math.trajectory.Trajectory" />
<Class name="org.wpilib.command3.SchedulerTelemetryTests" />
</Or>
</Match>
</FindBugsFilter>