Skip to content

Commit

Permalink
use precommit checks (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
skpawar1305 authored Feb 27, 2024
1 parent cdfe6eb commit 13de866
Show file tree
Hide file tree
Showing 12 changed files with 51 additions and 22 deletions.
33 changes: 21 additions & 12 deletions .github/workflows/test_ros2_humble.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,40 @@ name: ROS2 Humble
on:
pull_request:
types: [opened, synchronize, reopened, labeled, unlabeled]
push:
branches:
- main
schedule:
- cron: '0 02 * * *'
- cron: '0 10 * * *'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
code_quality:
name: Black Formatting
runs-on: ubuntu-22.04
lint:
name: Lint package
runs-on: ubuntu-latest
strategy:
matrix:
config:
- { python: "3.10" }
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v2
- name: Checkout repository
uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: 3.x
- run: pip install --upgrade pip
- run: pip install "black<23" pylint==v3.0.0a3 mypy==v0.902
- run: black --diff --check $(git ls-files '*.py')
python-version: ${{ matrix.config.python }}

- name: Lint sources
uses: pre-commit/[email protected]
webots_spot:
name: Webots Spot with Nav2 and Moveit2
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Install ROS2 Humble
run: >
sudo apt update
Expand Down Expand Up @@ -81,4 +90,4 @@ jobs:
export DEBIAN_FRONTEND=noninteractive
cd ~/ros2_ws
source install/setup.bash
colcon test --ctest-args tests --packages-select webots_spot --event-handlers console_direct+ --return-code-on-test-failure
colcon test --ctest-args tests --packages-select webots_spot --event-handlers console_direct+ --return-code-on-test-failure
20 changes: 20 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
repos:
- repo: https://github.com/psf/black
rev: 23.3.0
hooks:
- id: black
language_version: python3.10

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-yaml
- id: check-added-large-files
- id: end-of-file-fixer

# - repo: https://github.com/pre-commit/mirrors-mypy
# rev: v1.2.0
# hooks:
# - id: mypy
# types: [python]
# args: [--strict, --ignore-missing-imports]
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -658,4 +658,4 @@ specific requirements.
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU AGPL, see
<https://www.gnu.org/licenses/>.
<https://www.gnu.org/licenses/>.
2 changes: 1 addition & 1 deletion map/map.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ resolution: 0.05
origin: [-1.22, -4.98, 0]
negate: 0
occupied_thresh: 0.65
free_thresh: 0.25
free_thresh: 0.25
2 changes: 1 addition & 1 deletion map/map_arena3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ resolution: 0.05
origin: [-1.61, -5.08, 0]
negate: 0
occupied_thresh: 0.65
free_thresh: 0.25
free_thresh: 0.25
2 changes: 1 addition & 1 deletion protos/ImageBox.proto
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,4 @@ PROTO ImageBox [
name IS name
model "imagebox"
}
}
}
2 changes: 1 addition & 1 deletion protos/Spot.proto
Original file line number Diff line number Diff line change
Expand Up @@ -935,4 +935,4 @@ PROTO Spot [
synchronization IS synchronization
selfCollision IS selfCollision
}
}
}
2 changes: 1 addition & 1 deletion resource/moveit_controllers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ tiago_gripper_joint_trajectory_controller:
default: true
joints:
- gripper_left_finger_joint
- gripper_right_finger_joint
- gripper_right_finger_joint
2 changes: 1 addition & 1 deletion resource/moveit_kinematics.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
spot_arm:
kinematics_solver: kdl_kinematics_plugin/KDLKinematicsPlugin
kinematics_solver_search_resolution: 0.5
kinematics_solver_timeout: 0.5
kinematics_solver_timeout: 0.5
2 changes: 1 addition & 1 deletion resource/moveit_movegroup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ request_adapters: >-
default_planner_request_adapters/FixWorkspaceBounds
default_planner_request_adapters/FixStartStateBounds
default_planner_request_adapters/FixStartStateCollision
default_planner_request_adapters/FixStartStatePathConstraints
default_planner_request_adapters/FixStartStatePathConstraints
2 changes: 1 addition & 1 deletion resource/webots_blocksworld.gpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,4 @@ procedure main() {
pick (block x in {a, b, c})
pick(location y in {t1, t2, t3, a, b, c})
stack(x, y);
}
}
2 changes: 1 addition & 1 deletion worlds/spot.wbt
Original file line number Diff line number Diff line change
Expand Up @@ -768,4 +768,4 @@ DEF BLUE_3 SolidBox {
}
physics Physics {
}
}
}

0 comments on commit 13de866

Please sign in to comment.