Skip to content

Commit d506c2d

Browse files
authored
cxx: remove unused-but-set-parameter (Kinovarobotics#164)
- kortex_math_util.cpp originates from the original ros_kortex - modifies pre-commit-config because cpplint has false readability/casting error This kortex_math_util function comes from the ros_kortex repo and is actually unimplemented leaving it as is and ignoring the warning to keep ros2_kortex and ros_kortex similar
1 parent 6c3cadc commit d506c2d

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

.pre-commit-config.yaml

+3-2
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ repos:
8585
entry: env AMENT_CPPCHECK_ALLOW_SLOW_VERSIONS=1 ament_cppcheck
8686
language: system
8787
files: \.(h\+\+|h|hh|hxx|hpp|cuh|c|cc|cpp|cu|c\+\+|cxx|tpp|txx)$
88-
exclude: kortex_api/
88+
exclude: 'kortex_api/.*'
8989

9090
# Maybe use https://github.com/cpplint/cpplint instead
9191
- repo: local
@@ -98,7 +98,8 @@ repos:
9898
language: system
9999
files: \.(h\+\+|h|hh|hxx|hpp|cuh|c|cc|cpp|cu|c\+\+|cxx|tpp|txx)$
100100
args: ["--linelength=100", "--filter=-whitespace/newline"]
101-
exclude: kortex_api/
101+
# https://github.com/cpplint/cpplint/issues/131 kortex_math_util false positive with unamed func parameter
102+
exclude: 'kortex_api/.*|kortex_driver/src/kortex_math_util.cpp'
102103

103104
# Cmake hooks
104105
- repo: local

kortex_driver/src/kortex_math_util.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,9 @@ double KortexMathUtil::toRad(double degree) { return degree * M_PI / 180.0; }
1010

1111
double KortexMathUtil::toDeg(double rad) { return rad * 180.0 / M_PI; }
1212

13-
int KortexMathUtil::getNumberOfTurns(double rad_not_wrapped)
13+
int KortexMathUtil::getNumberOfTurns(double /*rad_not_wrapped*/)
1414
{
1515
// it is between
16-
rad_not_wrapped = 0;
1716
return 0;
1817
}
1918

0 commit comments

Comments
 (0)