Skip to content

Commit

Permalink
Update precommit (StoglRobotics#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
mamueluth authored Feb 9, 2022
1 parent 9faaebd commit a95fa8f
Show file tree
Hide file tree
Showing 13 changed files with 40 additions and 36 deletions.
48 changes: 29 additions & 19 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,21 +1,38 @@
# To use:
# How to use:
#
# pre-commit run -a
# Detailed:
# See https://github.com/pre-commit/pre-commit
#
# Short:
# First install pre-commit. For example: pip install pre-commit
#
# You can then install the git hook scripts with:
#
# pre-commit install # (NOTE after this pre-commit runs every time you run git commit)
#
# To skip pre-commit you then have to run: git commit -n
#
# Or:
# Just run pre-commit manually
#
# pre-commit install # (runs every time you commit in git)
# pre-commit run
#
# To rerun for all files:
#
# pre-commit run -a
#
# To update this file:
#
# pre-commit autoupdate
#
# See https://github.com/pre-commit/pre-commit

# files that should be ignored globally
exclude: ^(docs/_themes/)

repos:
# Standard hooks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.4.0
rev: v4.1.0
hooks:
- id: check-added-large-files
- id: check-ast
Expand All @@ -33,13 +50,13 @@ repos:

# Python hooks
- repo: https://github.com/asottile/pyupgrade
rev: v2.12.0
rev: v2.31.0
hooks:
- id: pyupgrade
args: [--py36-plus]

- repo: https://github.com/psf/black
rev: 20.8b1
rev: 21.12b0
hooks:
- id: black
args: ["--line-length=99"]
Expand All @@ -52,7 +69,7 @@ repos:
args: ["--ignore=D100,D101,D102,D103,D104,D105,D106,D107,D203,D212,D404"]

- repo: https://github.com/pycqa/flake8
rev: 3.9.0
rev: 4.0.1
hooks:
- id: flake8
args: ["--ignore=E501"]
Expand All @@ -67,12 +84,6 @@ repos:
language: system
files: \.(c|cc|cxx|cpp|frag|glsl|h|hpp|hxx|ih|ispc|ipp|java|js|m|proto|vert)$
args: ['-fallback-style=none', '-i']
# The same options as in ament_cppcheck are used, but its not working...
#- repo: https://github.com/pocc/pre-commit-hooks
#rev: v1.1.1
#hooks:
#- id: cppcheck
#args: ['--error-exitcode=1', '-f', '--inline-suppr', '-q', '-rp', '--suppress=internalAstError', '--suppress=unknownMacro', '--verbose']

- repo: local
hooks:
Expand Down Expand Up @@ -119,25 +130,24 @@ repos:

# Docs - RestructuredText hooks
- repo: https://github.com/PyCQA/doc8
rev: 0.9.0a1
rev: 0.10.1
hooks:
- id: doc8
args: ['--max-line-length=100', '--ignore=D001']
exclude: CHANGELOG\.rst$

- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.8.0
rev: v1.9.0
hooks:
- id: rst-backticks
exclude: CHANGELOG\.rst$
- id: rst-directive-colons
- id: rst-inline-touching-normal

# Spellcheck in comments and docs
# skipping of *.svg files is not working...
- repo: https://github.com/codespell-project/codespell
rev: v2.0.0
rev: v2.1.0
hooks:
- id: codespell
args: ['--write-changes']
exclude: \.(svg|pyc)$
exclude: (\.(svg|pyc|drawio))$|(CHANGELOG\.rst)
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ This package targets the following stakeholders:

**To achieve this, RosTeamWS defines**:

#. an architecture of overlayed workspaces for sharing standard ROS packages;
#. an architecture of overlaid workspaces for sharing standard ROS packages;
#. standardized package structure for straightforward collaboration;
#. scripts for workspace and package management to keep their internal structure familiar to everyone in the team;
#. often-used scripts for tests of small development-chunks.
Expand Down
1 change: 0 additions & 1 deletion _team_config/defines.bash
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@

1 change: 0 additions & 1 deletion _team_config/rosteamws_aliases.bash
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@

2 changes: 1 addition & 1 deletion docs/guidelines/robot_package_structure.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Here proposed architecture try to split the robot's files to minimize per-packag
│ ├── [setup.py] # if amend_python is used
│ ├── [setup.cfg] # if amend_python is used
│ ├── config/
│ │ ├── <robot_name>_controllers.yaml # Controllers' configuraiton for ros2_control
│ │ ├── <robot_name>_controllers.yaml # Controllers' configuration for ros2_control
│ │ ├── <robot_name>_forward_position_publisher.yaml # Setup test publisher for forward position controller
│ │ └── <robot_name>_joint_trajectory_publisher.yaml # Setup test publisher for joint trajectory controller
│ └── launch/
Expand Down
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ The framework is the main entry-point for teams to:

To achieve this, RosTeamWS defines:

#. an architecture of overlayed workspaces for sharing standard ROS packages;
#. an architecture of overlaid workspaces for sharing standard ROS packages;
#. standardized package structure for straightforward collaboration;
#. scripts for workspace and package management to keep their internal structure familiar to everyone in the team;
#. often-used scripts for tests of small development-chunks.
Expand Down
2 changes: 1 addition & 1 deletion docs/use-cases/ros2_control/setup_controller.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@ Parameters:
If not set, it is guessed from the current path using the folder's name.


The script will ask for some additional input.
The script will ask for some additional input.

After all files are copied and placeholders set, changes are automatically staged in git.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Script for Setting up Description Package
If the package name is not set, it is guessed from the current path using the folder's name.
The script **has to be executed** from the folder where the bringup should be generated.

**Note**: it is recomended to setup your package using :ref:`setup-new-package <uc-new-package>` scritpt.
**Note**: it is recommended to setup your package using :ref:`setup-new-package <uc-new-package>` script.

The scripts copies template files from the ``templates/robot_bringup`` folder, rename the files, and replaces the placeholders.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Script for Setting up Description Package
If the package name is not set, it is guessed from the current path using the folder's name.
The script **has to be executed** from the package folder where the description should be generated.

**Note**: it is recomended to setup your package using :ref:`create-new-package <uc-new-package>` script.
**Note**: it is recommended to setup your package using :ref:`create-new-package <uc-new-package>` script.

The scripts copies template files from the ``templates/robot_description`` folder, rename the files, and replaces the placeholders.

Expand Down
4 changes: 0 additions & 4 deletions scripts/_RosTeamWs_Docker_Defines.bash
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,3 @@
## BEGIN: Default RosTeamWS Docker Definitions and Aliases

# function _run_docker()




2 changes: 1 addition & 1 deletion scripts/setup-repository.bash
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ if [[ -f "$PACKAGE_TEMPLATES/_append_to_README_ROS_Intro.md" ]]; then
case "$choice" in
"y")
cat $PACKAGE_TEMPLATES/_append_to_README_ROS_Intro.md >> README.md
echo "Descrption is appended."
echo "Description is appended."
;;
"n")
echo "Description not appended."
Expand Down
2 changes: 1 addition & 1 deletion templates/robot_description/append_to_README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ The general package structure is the following:

1. Go to the root of your workspace folder (there where `src`, `build`, `install` and `log` files are).
2. Install the package by calling `colcon build --symlink-install --packages-select $PKG_NAME$`
3. (Re-)Source environemnt `source install/setup.bash`
3. (Re-)Source environment `source install/setup.bash`
4. Launch description test:
```
ros2 launch $PKG_NAME$ test_$ROBOT_NAME$_description.launch.py
Expand Down
6 changes: 3 additions & 3 deletions templates/ros2_control/append_to_README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ The general package structure is the following:
├── [setup.py] # if amend_python is used
├── [setup.cfg] # if amend_python is used
├── config/
│ ├── <robot_name>_controllers.yaml # Controllers' configuraiton for ros2_control
│ ├── <robot_name>_controllers.yaml # Controllers' configuration for ros2_control
│ ├── <robot_name>_forward_position_publisher.yaml # Setup test publisher for forward position controller
│ └── <robot_name>_joint_trajectory_publisher.yaml # Setup test publisher for joint trajectory controller
└── launch/
Expand Down Expand Up @@ -62,7 +62,7 @@ The sections below describe their usage.
### Joint State Controller
Joint state Controllers provides output of robot's internal states to `/joint_states` and `/dynamic_joint_states` ROS2-topics.

In a new terminal with sourced ROS2 environement load, configure and start `joint_state_controller`:
In a new terminal with sourced ROS2 environment load, configure and start `joint_state_controller`:
```
ros2 control load_start_controller joint_state_controller
```
Expand Down Expand Up @@ -161,7 +161,7 @@ Now you should also see your robot represented correctly in the `rviz2`.
ros2 launch ros2_control_demo_robot test_joint_trajectory_controller.launch.py
```

**NOTE**: You can swith contorllers (step 1 and 2) also with one command:
**NOTE**: You can switch contorllers (step 1 and 2) also with one command:
```
ros2 control switch_controllers --stop-controllers forward_<controller_type>_controller --start-controllers joint_trajectory_controller
```
Expand Down

0 comments on commit a95fa8f

Please sign in to comment.