[build] Bring naming checkstyle rules up to date with Google Style guide (#1781)

Also update Checkstyle to 8.38.

Google changed their style guide from the last time we imported it. This PR brings in those naming changes. The change they made is allowing single letter member, parameter, and local variable names. They also added a lambda naming scheme and I thought it would be good to bring that in too.
This commit is contained in:
Austin Shalit
2020-12-29 09:27:48 -08:00
committed by GitHub
parent 8c8ec5e63e
commit 6e1919414e
70 changed files with 224 additions and 285 deletions

View File

@@ -30,7 +30,7 @@ public class Robot extends TimedRobot {
private final DifferentialDrive m_myRobot
= new DifferentialDrive(new PWMVictorSPX(kLeftMotorPort),
new PWMVictorSPX(kRightMotorPort));
new PWMVictorSPX(kRightMotorPort));
private final AnalogGyro m_gyro = new AnalogGyro(kGyroPort);
private final Joystick m_joystick = new Joystick(kJoystickPort);

View File

@@ -41,10 +41,10 @@ public final class Constants {
public static final MecanumDriveKinematics kDriveKinematics =
new MecanumDriveKinematics(
new Translation2d(kWheelBase / 2, kTrackWidth / 2),
new Translation2d(kWheelBase / 2, -kTrackWidth / 2),
new Translation2d(-kWheelBase / 2, kTrackWidth / 2),
new Translation2d(-kWheelBase / 2, -kTrackWidth / 2));
new Translation2d(kWheelBase / 2, kTrackWidth / 2),
new Translation2d(kWheelBase / 2, -kTrackWidth / 2),
new Translation2d(-kWheelBase / 2, kTrackWidth / 2),
new Translation2d(-kWheelBase / 2, -kTrackWidth / 2));
public static final int kEncoderCPR = 1024;
public static final double kWheelDiameterMeters = 0.15;

View File

@@ -65,8 +65,8 @@ public class RobotContainer {
// Example of how to use the onboard IO
Button onboardButtonA = new Button(m_onboardIO::getButtonAPressed);
onboardButtonA
.whenActive(new PrintCommand("Button A Pressed"))
.whenInactive(new PrintCommand("Button A Released"));
.whenActive(new PrintCommand("Button A Pressed"))
.whenInactive(new PrintCommand("Button A Released"));
}

View File

@@ -32,7 +32,8 @@ public class SwerveModule {
private final ProfiledPIDController m_turningPIDController
= new ProfiledPIDController(1, 0, 0,
new TrapezoidProfile.Constraints(kModuleMaxAngularVelocity, kModuleMaxAngularAcceleration));
new TrapezoidProfile.Constraints(kModuleMaxAngularVelocity,
kModuleMaxAngularAcceleration));
// Gains are for example purposes only - must be determined for your own robot!
private final SimpleMotorFeedforward m_driveFeedforward = new SimpleMotorFeedforward(1, 3);

View File

@@ -55,10 +55,10 @@ public final class Constants {
//Distance between front and back wheels on robot
public static final SwerveDriveKinematics kDriveKinematics =
new SwerveDriveKinematics(
new Translation2d(kWheelBase / 2, kTrackWidth / 2),
new Translation2d(kWheelBase / 2, -kTrackWidth / 2),
new Translation2d(-kWheelBase / 2, kTrackWidth / 2),
new Translation2d(-kWheelBase / 2, -kTrackWidth / 2));
new Translation2d(kWheelBase / 2, kTrackWidth / 2),
new Translation2d(kWheelBase / 2, -kTrackWidth / 2),
new Translation2d(-kWheelBase / 2, kTrackWidth / 2),
new Translation2d(-kWheelBase / 2, -kTrackWidth / 2));
public static final boolean kGyroReversed = false;

View File

@@ -32,7 +32,8 @@ public class SwerveModule {
private final ProfiledPIDController m_turningPIDController
= new ProfiledPIDController(1, 0, 0,
new TrapezoidProfile.Constraints(kModuleMaxAngularVelocity, kModuleMaxAngularAcceleration));
new TrapezoidProfile.Constraints(kModuleMaxAngularVelocity,
kModuleMaxAngularAcceleration));
// Gains are for example purposes only - must be determined for your own robot!
private final SimpleMotorFeedforward m_driveFeedforward = new SimpleMotorFeedforward(1, 3);

View File

@@ -35,7 +35,7 @@ public class Robot extends TimedRobot {
private final AnalogInput m_ultrasonic = new AnalogInput(kUltrasonicPort);
private final DifferentialDrive m_robotDrive
= new DifferentialDrive(new PWMVictorSPX(kLeftMotorPort),
new PWMVictorSPX(kRightMotorPort));
new PWMVictorSPX(kRightMotorPort));
/**
* Tells the robot to drive to a set distance (in inches) from an object

View File

@@ -41,7 +41,7 @@ public class Robot extends TimedRobot {
private final AnalogInput m_ultrasonic = new AnalogInput(kUltrasonicPort);
private final DifferentialDrive m_robotDrive
= new DifferentialDrive(new PWMVictorSPX(kLeftMotorPort),
new PWMVictorSPX(kRightMotorPort));
new PWMVictorSPX(kRightMotorPort));
private final PIDController m_pidController = new PIDController(kP, kI, kD);
@Override