diff --git a/build.gradle b/build.gradle index 0ba81b5..550a570 100644 --- a/build.gradle +++ b/build.gradle @@ -3,6 +3,7 @@ import org.gradle.api.tasks.testing.logging.TestExceptionFormat plugins { id "java" id "edu.wpi.first.GradleRIO" version "2026.2.1" + id 'pmd' // PMD for static analysis } java { @@ -94,6 +95,15 @@ test { } } +// Static analysis + +pmd { + toolVersion = "7.20.0" + consoleOutput = true + ruleSetFiles = files("femaidens2265-pmd-ruleset.xml") + ruleSets = [] // Explicitly set so we don't use the default ruleset +} + // Simulation configuration (e.g. environment variables). wpi.sim.addGui().defaultEnabled = true wpi.sim.addDriverstation() diff --git a/femaidens2265-pmd-ruleset.xml b/femaidens2265-pmd-ruleset.xml new file mode 100644 index 0000000..94cfac7 --- /dev/null +++ b/femaidens2265-pmd-ruleset.xml @@ -0,0 +1,19 @@ + + + + + The PMD config for FRC team 2265, the Iron Maidens. + Please ask Jacob the programming mentor or the programming heads before + removing rules. + If we are suppressing many violations of the same rule, we should + probably remove it. + + + + + + + diff --git a/src/main/java/frc/robot/Ports.java b/src/main/java/frc/robot/Ports.java index e0c4780..a6b4b30 100644 --- a/src/main/java/frc/robot/Ports.java +++ b/src/main/java/frc/robot/Ports.java @@ -25,20 +25,20 @@ public class DrivetrainPorts { public class ElevatorPorts { public static final int LEADER_ELEVATOR_MOTOR = 15; public static final int FOLLOWER_ELEVATOR_MOTOR = 3; - public static int MOTOR_PORT = 15; - public static int BOT_SWITCH = 7; + public static final int MOTOR_PORT = 15; + public static final int BOT_SWITCH = 7; } public class IntakePorts { //public static int INTAKE_MOTOR = 3; - public static int BEAM_BREAK = 9; - public static int PIVOT_MOTOR = 29; + public static final int BEAM_BREAK = 9; + public static final int PIVOT_MOTOR = 29; } public class OuttakePorts { - public static int OUTTAKE_MOTOR = 12 ; - public static int FRONT_RECEIVER = 0; // front reciever is the one farthest away from intake - public static int MIDDLE_RECEIVER = 1; + public static final int OUTTAKE_MOTOR = 12 ; + public static final int FRONT_RECEIVER = 0; // front reciever is the one farthest away from intake + public static final int MIDDLE_RECEIVER = 1; } public class LEDPorts{ - public static int LED_PORT = 5; + public static final int LED_PORT = 5; } -} \ No newline at end of file +}