From c1477829530f0501f95f52d50192be58100a4dba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Denis=20=C5=A0togl?= Date: Tue, 10 Jan 2023 22:00:00 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20Fixes=20and=20updated=20on=20pre?= =?UTF-8?q?-commit=20hooks=20and=20their=20action=20(#890)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Prevent controller manager from crashing when controller's plugin has error during loading. * Use pydocstyle instead of pep257 because it replaces it. Bump versions of hooks. * Remove fixed python version from formatting action. Fix action warnings about Node.js 12 by updating them. Bump version of clang-format. * correct typo * Bump clang-format version. * Update .pre-commit-config.yaml * Fixup formatting. --- .github/workflows/ci-format.yml | 4 ++-- .pre-commit-config.yaml | 20 +++++++++---------- hardware_interface/test/test_handle.cpp | 8 ++++++-- .../resource/controller_manager.ui | 2 +- 4 files changed, 19 insertions(+), 15 deletions(-) diff --git a/.github/workflows/ci-format.yml b/.github/workflows/ci-format.yml index 30f76824f2..2d02865188 100644 --- a/.github/workflows/ci-format.yml +++ b/.github/workflows/ci-format.yml @@ -15,9 +15,9 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-python@v4.4.0 with: - python-version: 3.9 + python-version: '3.10' - name: Install system hooks - run: sudo apt install -qq clang-format-12 cppcheck + run: sudo apt install -qq clang-format-14 cppcheck - uses: pre-commit/action@v3.0.0 with: extra_args: --all-files --hook-stage manual diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index cb127e8fcf..b7972346fb 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -16,7 +16,7 @@ repos: # Standard hooks - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.1.0 + rev: v4.4.0 hooks: - id: check-added-large-files - id: check-ast @@ -36,20 +36,20 @@ repos: # Python hooks - repo: https://github.com/asottile/pyupgrade - rev: v2.31.1 + rev: v3.3.1 hooks: - id: pyupgrade args: [--py36-plus] - # PEP 257 - - repo: https://github.com/FalconSocial/pre-commit-mirrors-pep257 - rev: v0.3.3 + # PyDocStyle + - repo: https://github.com/PyCQA/pydocstyle + rev: 6.2.2 hooks: - - id: pep257 + - id: pydocstyle args: ["--ignore=D100,D101,D102,D103,D104,D105,D106,D107,D203,D212,D404"] - repo: https://github.com/pycqa/flake8 - rev: 4.0.1 + rev: 6.0.0 hooks: - id: flake8 args: ["--extend-ignore=E501"] @@ -60,7 +60,7 @@ repos: - id: clang-format name: clang-format description: Format files with ClangFormat. - entry: clang-format-12 + 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'] @@ -110,7 +110,7 @@ repos: # Docs - RestructuredText hooks - repo: https://github.com/PyCQA/doc8 - rev: 0.10.1 + rev: v1.1.1 hooks: - id: doc8 args: ['--max-line-length=100', '--ignore=D001'] @@ -127,7 +127,7 @@ repos: # Spellcheck in comments and docs # skipping of *.svg files is not working... - repo: https://github.com/codespell-project/codespell - rev: v2.1.0 + rev: v2.2.2 hooks: - id: codespell args: ['--write-changes'] diff --git a/hardware_interface/test/test_handle.cpp b/hardware_interface/test/test_handle.cpp index da8258c643..16ca710e9d 100644 --- a/hardware_interface/test/test_handle.cpp +++ b/hardware_interface/test/test_handle.cpp @@ -27,7 +27,9 @@ constexpr auto FOO_INTERFACE = "FooInterface"; TEST(TestHandle, command_interface) { double value = 1.337; - CommandInterface interface{JOINT_NAME, FOO_INTERFACE, &value}; + CommandInterface interface { + JOINT_NAME, FOO_INTERFACE, &value + }; EXPECT_DOUBLE_EQ(interface.get_value(), value); EXPECT_NO_THROW(interface.set_value(0.0)); EXPECT_DOUBLE_EQ(interface.get_value(), 0.0); @@ -36,7 +38,9 @@ TEST(TestHandle, command_interface) TEST(TestHandle, state_interface) { double value = 1.337; - StateInterface interface{JOINT_NAME, FOO_INTERFACE, &value}; + StateInterface interface { + JOINT_NAME, FOO_INTERFACE, &value + }; EXPECT_DOUBLE_EQ(interface.get_value(), value); // interface.set_value(5); compiler error, no set_value function } diff --git a/rqt_controller_manager/resource/controller_manager.ui b/rqt_controller_manager/resource/controller_manager.ui index d6394c1b0d..2ede975248 100644 --- a/rqt_controller_manager/resource/controller_manager.ui +++ b/rqt_controller_manager/resource/controller_manager.ui @@ -23,7 +23,7 @@ - <html><head/><body><p><span style=" font-weight:600;">controller manager</span> namespace. It is assumed that the <span style=" font-weight:600;">robot_description</span> parameter also lives in the same namesapce.</p></body></html> + <html><head/><body><p><span style=" font-weight:600;">controller manager</span> namespace. It is assumed that the <span style=" font-weight:600;">robot_description</span> parameter also lives in the same namespace.</p></body></html> namespace