Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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()
Expand Down
19 changes: 19 additions & 0 deletions femaidens2265-pmd-ruleset.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0"?>
<ruleset name="femaidens2265-pmd-ruleset"
xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 https://pmd.sourceforge.io/ruleset_2_0_0.xsd">

<description>
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.
</description>

<rule ref="category/java/design.xml/MutableStaticState" />

<rule ref="category/java/errorprone.xml/AssignmentToNonFinalStatic" />

</ruleset>
18 changes: 9 additions & 9 deletions src/main/java/frc/robot/Ports.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
}
Loading