Skip to content

Commit

Permalink
[CI] Update pre-commit and remove ros-lint (#187)
Browse files Browse the repository at this point in the history
  • Loading branch information
christophfroehlich authored Mar 4, 2024
1 parent 02a9e3a commit 741e0fa
Show file tree
Hide file tree
Showing 8 changed files with 52 additions and 104 deletions.
21 changes: 0 additions & 21 deletions .github/workflows/ci-format.yml

This file was deleted.

15 changes: 15 additions & 0 deletions .github/workflows/ci-pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Pre-Commit

on:
workflow_dispatch:
pull_request:

jobs:
pre-commit:
uses: ros-controls/ros2_control_ci/.github/workflows/reusable-pre-commit.yml@master
strategy:
fail-fast: false
matrix:
ROS_DISTRO: [rolling, iron, humble]
with:
ros_distro: ${{ matrix.ROS_DISTRO }}
59 changes: 0 additions & 59 deletions .github/workflows/ros-lint.yml

This file was deleted.

12 changes: 12 additions & 0 deletions .github/workflows/update-pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Auto Update pre-commit
# Update pre-commit config and create PR if changes are detected
# author: Christoph Fröhlich <[email protected]>

on:
workflow_dispatch:
schedule:
- cron: '0 0 * * 0' # Run every Sunday at midnight

jobs:
auto_update_and_create_pr:
uses: ros-controls/ros2_control_ci/.github/workflows/reusable-update-pre-commit.yml@master
45 changes: 23 additions & 22 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
repos:
# Standard hooks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: check-added-large-files
- id: check-ast
Expand All @@ -36,58 +36,51 @@ repos:

# Python hooks
- repo: https://github.com/asottile/pyupgrade
rev: v3.3.1
rev: v3.15.1
hooks:
- id: pyupgrade
args: [--py36-plus]

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

# PyDocStyle
- repo: https://github.com/PyCQA/pydocstyle
rev: 6.3.0
hooks:
- id: pydocstyle
args: ["--ignore=D100,D101,D102,D103,D104,D105,D106,D107,D203,D212,D404"]

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

- repo: https://github.com/pycqa/flake8
rev: 6.0.0
rev: 7.0.0
hooks:
- id: flake8
args: ["--extend-ignore=E501"]

# CPP hooks
- repo: local
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v17.0.6
hooks:
- id: clang-format
name: clang-format
description: Format files with ClangFormat.
entry: clang-format-14
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']

- repo: local
hooks:
- id: ament_cppcheck
name: ament_cppcheck
description: Static code analysis of C/C++ files.
stages: [commit]
entry: ament_cppcheck
entry: env AMENT_CPPCHECK_ALLOW_SLOW_VERSIONS=1 ament_cppcheck
language: system
files: \.(h\+\+|h|hh|hxx|hpp|cuh|c|cc|cpp|cu|c\+\+|cxx|tpp|txx)$

# Maybe use https://github.com/cpplint/cpplint instead
- repo: local
hooks:
- id: ament_cpplint
name: ament_cpplint
description: Static code analysis of C/C++ files.
stages: [commit]
entry: ament_cpplint
language: system
files: \.(h\+\+|h|hh|hxx|hpp|cuh|c|cc|cpp|cu|c\+\+|cxx|tpp|txx)$
Expand All @@ -99,7 +92,6 @@ repos:
- id: ament_lint_cmake
name: ament_lint_cmake
description: Check format of CMakeLists.txt files.
stages: [commit]
entry: ament_lint_cmake
language: system
files: CMakeLists\.txt$
Expand All @@ -110,7 +102,6 @@ repos:
- id: ament_copyright
name: ament_copyright
description: Check if copyright notice is available in all files.
stages: [commit]
entry: ament_copyright
language: system

Expand All @@ -133,8 +124,18 @@ repos:
# Spellcheck in comments and docs
# skipping of *.svg files is not working...
- repo: https://github.com/codespell-project/codespell
rev: v2.2.2
rev: v2.2.6
hooks:
- id: codespell
args: ['--write-changes']
exclude: CHANGELOG\.rst|\.(svg|pyc)$

- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.28.0
hooks:
- id: check-github-workflows
args: ["--verbose"]
- id: check-github-actions
args: ["--verbose"]
- id: check-dependabot
args: ["--verbose"]
1 change: 0 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,3 @@ be under the 3-Clause BSD License, as dictated by that
[issues]: https://github.com/ros-controls/control_toolbox/issues
[closed-issues]: https://github.com/ros-controls/control_toolbox/issues?utf8=%E2%9C%93&q=is%3Aissue%20is%3Aclosed%20
[help-wanted]: https://github.com/ros-controls/control_toolbox/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22
[license]: https://opensource.org/licenses/BSD-3-Clause
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
control_toolbox
===========
[![License](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause)
[![codecov](https://codecov.io/gh/ros-controls/control_toolbox/graph/badge.svg?token=0o4dFzADHj)](https://codecov.io/gh/ros-controls/control_toolbox)

See the documentation of [ros2_control](http://control.ros.org) and release infos on [index.ros.org](http://index.ros.org/p/control_toolbox).
Expand Down
2 changes: 1 addition & 1 deletion src/sine_sweep.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ bool SineSweep::init(double start_freq, double end_freq, double duration, double

amplitude_ = amplitude;
duration_ = rclcpp::Duration::from_seconds(duration);
// calculate the angular fequencies
// calculate the angular frequencies
start_angular_freq_ = 2 * M_PI * start_freq;
end_angular_freq_ = 2 * M_PI * end_freq;

Expand Down

0 comments on commit 741e0fa

Please sign in to comment.