Skip to content

Commit

Permalink
CppCheck Warnings in README modification
Browse files Browse the repository at this point in the history
  • Loading branch information
VyaasBaskar committed Dec 26, 2024
1 parent eb7e7e8 commit b808d55
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 23 deletions.
22 changes: 4 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,22 +176,8 @@ To undo the going back:

## CppCheck Warnings
```
src/y2025/cpp/field.cc:9:16: warning: Variable 'point' can be declared as reference to const [constVariableReference]
src/y2025/cpp/field.cc:19:14: warning: Variable 'path' can be declared as reference to const [constVariableReference]
src/y2025/cpp/field.cc:10:32: warning: Consider using std::find_if algorithm instead of a raw loop. [useStlAlgorithm]
src/y2025/cpp/field.cc:20:29: warning: Consider using std::find_if algorithm instead of a raw loop. [useStlAlgorithm]
src/y2025/cpp/field.cc:60:26: warning: Consider using std::replace_if algorithm instead of a raw loop. [useStlAlgorithm]
src/y2025/cpp/field.cc:68:26: warning: Consider using std::replace_if algorithm instead of a raw loop. [useStlAlgorithm]
src/y2025/cpp/field.cc:55:25: warning: Consider using std::replace_if algorithm instead of a raw loop. [useStlAlgorithm]
src/frc846/cpp/frc846/math/collection.cc:11:0: warning: The function 'HorizontalDeadband' is never used. [unusedFunction]
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
```
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]
src\frc846\cpp\frc846\math\collection.cc:11:0: warning: The function 'HorizontalDeadband' is never used. [unusedFunction]
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]
```
10 changes: 5 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -190,12 +190,12 @@ ${reportContent.trim()}
"""
def readmeFile = file('README.md')
def readmeContent = readmeFile.text
def cppcheckRegex = /## CppCheck Warnings\n```[\s\S]*?```/
if (readmeContent.find(cppcheckRegex)) {
readmeContent = readmeContent.replaceAll(cppcheckRegex, cppcheckSection.trim())
} else {
readmeContent += "\n" + cppcheckSection.trim()

if (readmeContent.contains("## CppCheck Warnings")) {
readmeContent = readmeContent.substring(0, readmeContent.indexOf("## CppCheck Warnings"))
}

readmeContent += "\n" + cppcheckSection.trim()
readmeFile.text = readmeContent
}
}
Expand Down

0 comments on commit b808d55

Please sign in to comment.