mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
Disable frivolous PMD warnings and enable PMD in ntcore (#3419)
Some valid warnings like throwing NullPointerException or using a for loop instead of System.arraycopy() were fixed. Abstract classes marked with PMD.AbstractClassWithoutAbstractMethod were made concrete because they already had protected constructors. Fixes #1697.
This commit is contained in:
@@ -8,7 +8,7 @@ import edu.wpi.first.wpilibj.DutyCycleEncoder;
|
||||
import edu.wpi.first.wpilibj.TimedRobot;
|
||||
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
|
||||
|
||||
@SuppressWarnings({"PMD.SingularField"})
|
||||
@SuppressWarnings("PMD.SingularField")
|
||||
public class Robot extends TimedRobot {
|
||||
private DutyCycleEncoder m_dutyCycleEncoder;
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ import edu.wpi.first.wpilibj.DutyCycle;
|
||||
import edu.wpi.first.wpilibj.TimedRobot;
|
||||
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
|
||||
|
||||
@SuppressWarnings({"PMD.SingularField"})
|
||||
@SuppressWarnings("PMD.SingularField")
|
||||
public class Robot extends TimedRobot {
|
||||
private DigitalInput m_input;
|
||||
private DutyCycle m_dutyCycle;
|
||||
|
||||
@@ -17,7 +17,6 @@ import edu.wpi.first.wpilibj.motorcontrol.MotorController;
|
||||
import edu.wpi.first.wpilibj.motorcontrol.PWMSparkMax;
|
||||
|
||||
/** Represents a mecanum drive style drivetrain. */
|
||||
@SuppressWarnings("PMD.TooManyFields")
|
||||
public class Drivetrain {
|
||||
public static final double kMaxSpeed = 3.0; // 3 meters per second
|
||||
public static final double kMaxAngularSpeed = Math.PI; // 1/2 rotation per second
|
||||
|
||||
@@ -31,7 +31,6 @@ import java.util.List;
|
||||
* periodic methods (other than the scheduler calls). Instead, the structure of the robot
|
||||
* (including subsystems, commands, and button mappings) should be declared here.
|
||||
*/
|
||||
@SuppressWarnings("PMD.ExcessiveImports")
|
||||
public class RobotContainer {
|
||||
// The robot's subsystems
|
||||
private final DriveSubsystem m_robotDrive = new DriveSubsystem();
|
||||
|
||||
@@ -21,7 +21,6 @@ import edu.wpi.first.wpilibj.motorcontrol.MotorController;
|
||||
import edu.wpi.first.wpilibj.motorcontrol.PWMSparkMax;
|
||||
|
||||
/** Represents a mecanum drive style drivetrain. */
|
||||
@SuppressWarnings("PMD.TooManyFields")
|
||||
public class Drivetrain {
|
||||
public static final double kMaxSpeed = 3.0; // 3 meters per second
|
||||
public static final double kMaxAngularSpeed = Math.PI; // 1/2 rotation per second
|
||||
|
||||
@@ -26,7 +26,6 @@ import edu.wpi.first.wpilibj.simulation.EncoderSim;
|
||||
import edu.wpi.first.wpilibj.smartdashboard.Field2d;
|
||||
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
|
||||
|
||||
@SuppressWarnings("PMD.TooManyFields")
|
||||
public class Drivetrain {
|
||||
// 3 meters per second.
|
||||
public static final double kMaxSpeed = 3.0;
|
||||
|
||||
@@ -14,7 +14,6 @@ import edu.wpi.first.wpilibj.examples.swervecontrollercommand.Constants.DriveCon
|
||||
import edu.wpi.first.wpilibj.interfaces.Gyro;
|
||||
import edu.wpi.first.wpilibj2.command.SubsystemBase;
|
||||
|
||||
@SuppressWarnings("PMD.ExcessiveImports")
|
||||
public class DriveSubsystem extends SubsystemBase {
|
||||
// Robot swerve modules
|
||||
private final SwerveModule m_frontLeft =
|
||||
|
||||
@@ -29,7 +29,6 @@ public class EducationalRobot extends RobotBase {
|
||||
|
||||
private volatile boolean m_exit;
|
||||
|
||||
@SuppressWarnings("PMD.CyclomaticComplexity")
|
||||
@Override
|
||||
public void startCompetition() {
|
||||
robotInit();
|
||||
|
||||
@@ -26,7 +26,6 @@ public class Robot extends RobotBase {
|
||||
|
||||
private volatile boolean m_exit;
|
||||
|
||||
@SuppressWarnings("PMD.CyclomaticComplexity")
|
||||
@Override
|
||||
public void startCompetition() {
|
||||
robotInit();
|
||||
|
||||
Reference in New Issue
Block a user