Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Humble - General code maintenance #126

Merged
merged 17 commits into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 10 additions & 30 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,11 @@ on:
workflow_dispatch:

jobs:
black:
name: Black
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Black
uses: psf/[email protected]
with:
options: --line-length=99

spellcheck:
name: Spellcheck
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Spellcheck
uses: rojopolis/[email protected]
pre-commit:
name: Pre-commit
uses: ros-controls/ros2_control_ci/.github/workflows/reusable-pre-commit.yml@master
with:
ros_distro: humble

industrial_ci:
name: Industrial CI
Expand All @@ -36,20 +22,15 @@ jobs:
ROS_DISTRO: [humble]
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Act + Docker fix
run: |
sudo chown runner:docker /var/run/docker.sock
uses: actions/checkout@v4

- name: Setup ROS2 Workspace and Clone Repositories
run: |
mkdir -p src
find . -maxdepth 1 -not -name src -not -name . -exec mv {} src/ \;
mkdir -p src/rosbot_ros
find . -maxdepth 1 -not -name src -not -name . -exec mv {} src/rosbot_ros \;
python3 -m pip install -U vcstool
vcs import src < src/rosbot/rosbot_hardware.repos
vcs import src < src/rosbot/rosbot_simulation.repos
cp -r src/ros2_controllers/diff_drive_controller src/
vcs import src < src/rosbot_ros/rosbot/rosbot_hardware.repos
vcs import src < src/rosbot_ros/rosbot/rosbot_simulation.repos
cp -r src/ros2_controllers/imu_sensor_broadcaster src/
rm -rf src/ros2_controllers

Expand All @@ -58,7 +39,6 @@ jobs:
- name: Leave only ROSbot tests
shell: bash
run: |
sed '/if(BUILD_TESTING)/,/endif()/d' src/diff_drive_controller/CMakeLists.txt -i
sed '/if(BUILD_TESTING)/,/endif()/d' src/imu_sensor_broadcaster/CMakeLists.txt -i
sed '/if(BUILD_TESTING)/,/endif()/d' src/micro_ros_msgs/CMakeLists.txt -i

Expand Down
67 changes: 45 additions & 22 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,27 +1,51 @@
---
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v5.0.0
hooks:
- id: check-merge-conflict
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-xml
- id: check-added-large-files
# mesh files has to be taken into account
args: [--maxkb=3000]
- id: check-ast
- id: check-json
exclude: ^.vscode/
- id: check-merge-conflict
- id: check-symlinks
- id: check-xml
- id: check-yaml
- id: debug-statements
- id: destroyed-symlinks
- id: detect-private-key
- id: end-of-file-fixer
- id: fix-byte-order-marker
- id: name-tests-test
files: ^.*\/test\/.*$
args: [--pytest-test-first]
- id: mixed-line-ending
- id: trailing-whitespace

- repo: https://github.com/PyCQA/isort
rev: 5.13.2
hooks:
- id: isort
args: [--profile, black]

- repo: https://github.com/cheshirekow/cmake-format-precommit
rev: v0.6.13
hooks:
- id: cmake-format

- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v19.1.4
hooks:
- id: clang-format

- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
rev: v2.3.0
hooks:
- id: codespell
name: codespell
description: Checks for common misspellings in text files.
entry: codespell *
entry: codespell
exclude_types: [rst, svg]
language: python
types: [text]

Expand All @@ -33,23 +57,16 @@ repos:
args: [--mapping, '2', --sequence, '4', --offset, '2', --width, '100']

- repo: https://github.com/psf/black
rev: 24.4.0
rev: 24.10.0
hooks:
- id: black
args: [--line-length=99]

- repo: https://github.com/PyCQA/flake8
rev: 7.0.0
rev: 7.1.1
hooks:
- id: flake8
args: ['--ignore=E501,W503'] # ignore too long line and line break before binary operator,
# black checks it

- repo: https://github.com/PyCQA/isort
rev: 5.13.2
hooks:
- id: isort
args: [--profile, black]
args: ['--ignore=E501,W503']

- repo: local
hooks:
Expand All @@ -68,11 +85,17 @@ repos:
stages: [commit]
entry: ament_copyright
language: system
exclude: ^.*\.md$

# Docs - RestructuredText hooks
- repo: https://github.com/PyCQA/doc8
rev: v1.1.1
rev: v1.1.2
hooks:
- id: doc8
args: [--max-line-length=100, --ignore=D001]
exclude: ^.*\/CHANGELOG\.rst/.*$

- repo: https://github.com/tier4/pre-commit-hooks-ros
rev: v0.10.0
hooks:
- id: prettier-package-xml
- id: sort-package-xml
54 changes: 0 additions & 54 deletions .pyspelling.yaml

This file was deleted.

161 changes: 0 additions & 161 deletions .wordlist.txt

This file was deleted.

Loading
Loading