From 2cbad4e4b196877c4cb9865951843e8d38d0e415 Mon Sep 17 00:00:00 2001 From: Dean Brettle Date: Tue, 23 Apr 2024 10:50:52 -0700 Subject: [PATCH 1/2] Remove all indentation from Robot.java as a test. --- src/main/java/org/carlmontrobotics/Robot.java | 160 +++++++++--------- 1 file changed, 80 insertions(+), 80 deletions(-) diff --git a/src/main/java/org/carlmontrobotics/Robot.java b/src/main/java/org/carlmontrobotics/Robot.java index 09b83ebf..f5996bf6 100644 --- a/src/main/java/org/carlmontrobotics/Robot.java +++ b/src/main/java/org/carlmontrobotics/Robot.java @@ -16,84 +16,84 @@ public class Robot extends TimedRobot { - private Command m_autonomousCommand; - public static Robot robot; - - private RobotContainer m_robotContainer; - - @Override - - public void robotInit() { - robot = this; - m_robotContainer = new RobotContainer(); - // SignalLogger.start(); - - // Record both DS control and joystick data - DataLogManager.start(); - DriverStation.startDataLog(DataLogManager.getLog()); - FollowPathCommand.warmupCommand().schedule(); - } - - @Override - public void robotPeriodic() { - CommandScheduler.getInstance().run(); - } - - @Override - public void disabledInit() { - // SignalLogger.stop(); - } - - @Override - public void disabledPeriodic() { - } - - @Override - public void disabledExit() { - } - - @Override - public void autonomousInit() { - m_autonomousCommand = m_robotContainer.getAutonomousCommand(); - - if (m_autonomousCommand != null) { - m_autonomousCommand.schedule(); - } - } - - @Override - public void autonomousPeriodic() { - } - - @Override - public void autonomousExit() { - } - - @Override - public void teleopInit() { - if (m_autonomousCommand != null) { - m_autonomousCommand.cancel(); - } - } - - @Override - public void teleopPeriodic() { - } - - @Override - public void teleopExit() { - } - - @Override - public void testInit() { - CommandScheduler.getInstance().cancelAll(); - } - - @Override - public void testPeriodic() { - } - - @Override - public void testExit() { - } +private Command m_autonomousCommand; +public static Robot robot; + +private RobotContainer m_robotContainer; + +@Override + +public void robotInit() { +robot = this; +m_robotContainer = new RobotContainer(); +// SignalLogger.start(); + +// Record both DS control and joystick data +DataLogManager.start(); +DriverStation.startDataLog(DataLogManager.getLog()); +FollowPathCommand.warmupCommand().schedule(); +} + +@Override +public void robotPeriodic() { +CommandScheduler.getInstance().run(); +} + +@Override +public void disabledInit() { +// SignalLogger.stop(); +} + +@Override +public void disabledPeriodic() { +} + +@Override +public void disabledExit() { +} + +@Override +public void autonomousInit() { +m_autonomousCommand = m_robotContainer.getAutonomousCommand(); + +if (m_autonomousCommand != null) { +m_autonomousCommand.schedule(); +} +} + +@Override +public void autonomousPeriodic() { +} + +@Override +public void autonomousExit() { +} + +@Override +public void teleopInit() { +if (m_autonomousCommand != null) { +m_autonomousCommand.cancel(); +} +} + +@Override +public void teleopPeriodic() { +} + +@Override +public void teleopExit() { +} + +@Override +public void testInit() { +CommandScheduler.getInstance().cancelAll(); +} + +@Override +public void testPeriodic() { +} + +@Override +public void testExit() { +} } From 91980f885b2509ca020a8f1d5249b159441b1000 Mon Sep 17 00:00:00 2001 From: Dean Brettle Date: Tue, 23 Apr 2024 11:56:08 -0700 Subject: [PATCH 2/2] Auto-format modified lines when saving in vscode. Also mostly revert immediately prior commit that was made to test this functionality. --- .vscode/settings.json | 12 +- src/main/java/org/carlmontrobotics/Robot.java | 162 +++++++++--------- 2 files changed, 88 insertions(+), 86 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 6004b201..56e1a4ae 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -18,14 +18,18 @@ { "name": "WPIlibUnitTests", "workingDirectory": "${workspaceFolder}/build/jni/release", - "vmargs": [ "-Djava.library.path=${workspaceFolder}/build/jni/release" ], + "vmargs": [ + "-Djava.library.path=${workspaceFolder}/build/jni/release" + ], "env": { - "LD_LIBRARY_PATH": "${workspaceFolder}/build/jni/release" , + "LD_LIBRARY_PATH": "${workspaceFolder}/build/jni/release", "DYLD_LIBRARY_PATH": "${workspaceFolder}/build/jni/release" } }, ], "java.test.defaultConfig": "WPIlibUnitTests", "wpilib.skipTests": true, - "java.debug.settings.onBuildFailureProceed": true -} + "java.debug.settings.onBuildFailureProceed": true, + "editor.formatOnSave": true, + "editor.formatOnSaveMode": "modificationsIfAvailable" +} \ No newline at end of file diff --git a/src/main/java/org/carlmontrobotics/Robot.java b/src/main/java/org/carlmontrobotics/Robot.java index f5996bf6..75313fad 100644 --- a/src/main/java/org/carlmontrobotics/Robot.java +++ b/src/main/java/org/carlmontrobotics/Robot.java @@ -12,88 +12,86 @@ import edu.wpi.first.wpilibj2.command.Command; import edu.wpi.first.wpilibj2.command.CommandScheduler; - - public class Robot extends TimedRobot { -private Command m_autonomousCommand; -public static Robot robot; - -private RobotContainer m_robotContainer; - -@Override - -public void robotInit() { -robot = this; -m_robotContainer = new RobotContainer(); -// SignalLogger.start(); - -// Record both DS control and joystick data -DataLogManager.start(); -DriverStation.startDataLog(DataLogManager.getLog()); -FollowPathCommand.warmupCommand().schedule(); -} - -@Override -public void robotPeriodic() { -CommandScheduler.getInstance().run(); -} - -@Override -public void disabledInit() { -// SignalLogger.stop(); -} - -@Override -public void disabledPeriodic() { -} - -@Override -public void disabledExit() { -} - -@Override -public void autonomousInit() { -m_autonomousCommand = m_robotContainer.getAutonomousCommand(); - -if (m_autonomousCommand != null) { -m_autonomousCommand.schedule(); -} -} - -@Override -public void autonomousPeriodic() { -} - -@Override -public void autonomousExit() { -} - -@Override -public void teleopInit() { -if (m_autonomousCommand != null) { -m_autonomousCommand.cancel(); -} -} - -@Override -public void teleopPeriodic() { -} - -@Override -public void teleopExit() { -} - -@Override -public void testInit() { -CommandScheduler.getInstance().cancelAll(); -} - -@Override -public void testPeriodic() { -} - -@Override -public void testExit() { -} + private Command m_autonomousCommand; + public static Robot robot; + + private RobotContainer m_robotContainer; + + @Override + + public void robotInit() { + robot = this; + m_robotContainer = new RobotContainer(); + // SignalLogger.start(); + + // Record both DS control and joystick data + DataLogManager.start(); + DriverStation.startDataLog(DataLogManager.getLog()); + FollowPathCommand.warmupCommand().schedule(); + } + + @Override + public void robotPeriodic() { + CommandScheduler.getInstance().run(); + } + + @Override + public void disabledInit() { + // SignalLogger.stop(); + } + + @Override + public void disabledPeriodic() { + } + + @Override + public void disabledExit() { + } + + @Override + public void autonomousInit() { + m_autonomousCommand = m_robotContainer.getAutonomousCommand(); + + if (m_autonomousCommand != null) { + m_autonomousCommand.schedule(); + } + } + + @Override + public void autonomousPeriodic() { + } + + @Override + public void autonomousExit() { + } + + @Override + public void teleopInit() { + if (m_autonomousCommand != null) { + m_autonomousCommand.cancel(); + } + } + + @Override + public void teleopPeriodic() { + } + + @Override + public void teleopExit() { + } + + @Override + public void testInit() { + CommandScheduler.getInstance().cancelAll(); + } + + @Override + public void testPeriodic() { + } + + @Override + public void testExit() { + } }