Files
allwpilib/styleguide/spotbugs-exclude.xml
Gold856 35e8abedeb Don't force public variables to use Hungarian notation (#8774)
People generally have expressed a dislike for the Hungarian notation
used in member variables, especially in examples/templates, and our
styleguide shouldn't be forced on downstream consumers, so this removes
all Hungarian notation from the examples/templates.

There are _some_ benefits to Hungarian for private member variables
(like knowing what's a member vs. local in a PR review) so we'll keep
private member variables the same for now, but public variables should
no longer use Hungarian notation, since it looks much worse. A new PMD
XPath rule has been added to accomplish this goal. Some other
non-compliant variables were fixed for the new rule.
2026-04-25 11:32:08 -07:00

176 lines
6.3 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.internal.DriverStationBackend" />
<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.RuntimeLoader" />
</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.ChassisVelocitiesTest" />
<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_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>
<Bug pattern="URF_UNREAD_FIELD" />
<Class name="org.wpilib.driverstation.internal.DriverStationBackend$HALJoystickAxesRaw" />
</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>