mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-25 01:41:43 +00:00
Don't force public variables to use Hungarian notation (#8774)
People generally have expressed a dislike for the Hungarian notation used in member variables, especially in examples/templates, and our styleguide shouldn't be forced on downstream consumers, so this removes all Hungarian notation from the examples/templates. There are _some_ benefits to Hungarian for private member variables (like knowing what's a member vs. local in a PR review) so we'll keep private member variables the same for now, but public variables should no longer use Hungarian notation, since it looks much worse. A new PMD XPath rule has been added to accomplish this goal. Some other non-compliant variables were fixed for the new rule.
This commit is contained in:
@@ -19,11 +19,11 @@ void Robot::DisabledPeriodic() {}
|
||||
void Robot::DisabledExit() {}
|
||||
|
||||
void Robot::AutonomousInit() {
|
||||
m_autonomousCommand = m_container.GetAutonomousCommand();
|
||||
autonomousCommand = container.GetAutonomousCommand();
|
||||
|
||||
if (m_autonomousCommand) {
|
||||
if (autonomousCommand) {
|
||||
wpi::cmd::CommandScheduler::GetInstance().Schedule(
|
||||
m_autonomousCommand.value());
|
||||
autonomousCommand.value());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,8 +32,8 @@ void Robot::AutonomousPeriodic() {}
|
||||
void Robot::AutonomousExit() {}
|
||||
|
||||
void Robot::TeleopInit() {
|
||||
if (m_autonomousCommand) {
|
||||
m_autonomousCommand->Cancel();
|
||||
if (autonomousCommand) {
|
||||
autonomousCommand->Cancel();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ class Robot : public wpi::TimedRobot {
|
||||
void UtilityExit() override;
|
||||
|
||||
private:
|
||||
std::optional<wpi::cmd::CommandPtr> m_autonomousCommand;
|
||||
std::optional<wpi::cmd::CommandPtr> autonomousCommand;
|
||||
|
||||
RobotContainer m_container;
|
||||
RobotContainer container;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user