Skip to content
This repository has been archived by the owner on Jan 23, 2024. It is now read-only.

Commit

Permalink
Precommit: Use pyproject.toml and fix cppcheck
Browse files Browse the repository at this point in the history
  • Loading branch information
jaagut committed Aug 3, 2023
1 parent ce6d14f commit f489220
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
7 changes: 3 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,19 @@ repos:
hooks:
- id: ruff
args:
- "--line-length=120"
- "--fix"
- "--exit-non-zero-on-fix"
- "--select=F,E,W,I,N,UP"
- repo: https://github.com/psf/black
rev: 23.3.0
hooks:
- id: black
args:
- "--line-length=120"
- repo: https://github.com/pocc/pre-commit-hooks
rev: v1.3.5
hooks:
- id: clang-format
args:
- "-i"
- id: cppcheck
args:
- "--suppress=missingInclude"
- "--suppress=missingIncludeSystem"
4 changes: 2 additions & 2 deletions bitbots_head_mover/src/move_head.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -348,8 +348,8 @@ class HeadMover {
}

std::pair<double, double> get_head_position() {
double head_pan;
double head_tilt;
double head_pan = 0.0;
double head_tilt = 0.0;
for (size_t i = 0; i < current_joint_state_.name.size(); i++) {
if (current_joint_state_.name[i] == "HeadPan") {
head_pan = current_joint_state_.position[i];
Expand Down
6 changes: 6 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[tool.black]
line-length = 120

[tool.ruff]
line-length = 120
select = ["F", "E", "W", "I", "N", "UP"]

0 comments on commit f489220

Please sign in to comment.