Skip to content

Commit

Permalink
Ensure spotlessApply runs each build, remove spotlessCppCheck from gr…
Browse files Browse the repository at this point in the history
…adle tasks when run with option fromCI
  • Loading branch information
VyaasBaskar committed Dec 23, 2024
1 parent 71e3082 commit 33f1862
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,4 +188,18 @@ src/frc846/cpp/frc846/math/collection.cc:11:0: warning: The function 'Horizontal
src/frc846/cpp/frc846/math/collection.cc:25:0: warning: The function 'VerticalDeadband' is never used. [unusedFunction]
src/frc846/cpp/frc846/math/collection.cc:39:0: warning: The function 'CoterminalDifference' is never used. [unusedFunction]
src/frc846/cpp/frc846/math/collection.cc:52:0: warning: The function 'CoterminalSum' is never used. [unusedFunction]
```
## CppCheck Warnings
```
srcy2025cppfield.cc:9:16: warning: Variable 'point' can be declared as reference to const [constVariableReference]
srcy2025cppfield.cc:19:14: warning: Variable 'path' can be declared as reference to const [constVariableReference]
srcy2025cppfield.cc:10:32: warning: Consider using std::find_if algorithm instead of a raw loop. [useStlAlgorithm]
srcy2025cppfield.cc:20:29: warning: Consider using std::find_if algorithm instead of a raw loop. [useStlAlgorithm]
srcy2025cppfield.cc:60:26: warning: Consider using std::replace_if algorithm instead of a raw loop. [useStlAlgorithm]
srcy2025cppfield.cc:68:26: warning: Consider using std::replace_if algorithm instead of a raw loop. [useStlAlgorithm]
srcy2025cppfield.cc:55:25: warning: Consider using std::replace_if algorithm instead of a raw loop. [useStlAlgorithm]
srcfrc846cppfrc846mathcollection.cc:11:0: warning: The function 'HorizontalDeadband' is never used. [unusedFunction]
srcfrc846cppfrc846mathcollection.cc:25:0: warning: The function 'VerticalDeadband' is never used. [unusedFunction]
srcfrc846cppfrc846mathcollection.cc:39:0: warning: The function 'CoterminalDifference' is never used. [unusedFunction]
srcfrc846cppfrc846mathcollection.cc:52:0: warning: The function 'CoterminalSum' is never used. [unusedFunction]
```
4 changes: 4 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ spotless {
if (!project.hasProperty('fromCI')) {
check.dependsOn spotlessApply
}
spotlessCppCheck.onlyIf { !project.hasProperty('fromCI') }

task runCppcheck(type: Exec) {
def outputBuffer = new ByteArrayOutputStream()
Expand Down Expand Up @@ -198,6 +199,9 @@ ${reportContent.trim()}
}
}

runCppcheck.onlyIf { !project.hasProperty('fromCI') }

if (!project.hasProperty('fromCI')) {
check.dependsOn runCppcheck
runCppcheck.dependsOn spotlessApply
}
3 changes: 2 additions & 1 deletion src/frc846/include/frc846/control/MotorMonkey.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ class MotorMonkey {
static frc846::control::hardware::IntermediateController*
controller_registry[CONTROLLER_REGISTRY_SIZE];

static frc846::control::base::MotorGains gains_registry[CONTROLLER_REGISTRY_SIZE];
static frc846::control::base::MotorGains
gains_registry[CONTROLLER_REGISTRY_SIZE];
static units::newton_meter_t load_registry[CONTROLLER_REGISTRY_SIZE];

static frc846::control::hardware::ControllerErrorCodes
Expand Down

0 comments on commit 33f1862

Please sign in to comment.