diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a48f31d..333c21b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -18,18 +18,18 @@ repos: args: [--markdown-linebreak-ext=md] - repo: https://github.com/igorshubovych/markdownlint-cli - rev: v0.32.2 + rev: v0.33.0 hooks: - id: markdownlint args: [-c, .markdownlint.yaml, --fix] - repo: https://github.com/pre-commit/mirrors-prettier - rev: v3.0.0-alpha.4 + rev: v3.0.0-alpha.6 hooks: - id: prettier - repo: https://github.com/adrienverge/yamllint - rev: v1.28.0 + rev: v1.29.0 hooks: - id: yamllint @@ -45,12 +45,12 @@ repos: args: [-w, -s, -i=4] - repo: https://github.com/pycqa/isort - rev: v5.11.3 + rev: 5.12.0 hooks: - id: isort - repo: https://github.com/psf/black - rev: 22.12.0 + rev: 23.1.0 hooks: - id: black args: [--line-length=100] @@ -72,7 +72,7 @@ repos: ] - repo: https://github.com/pre-commit/mirrors-clang-format - rev: v15.0.6 + rev: v15.0.7 hooks: - id: clang-format types_or: [c++, c, cuda] diff --git a/pre_commit_hooks/ros_include_guard.py b/pre_commit_hooks/ros_include_guard.py index d301a08..e51ba6d 100644 --- a/pre_commit_hooks/ros_include_guard.py +++ b/pre_commit_hooks/ros_include_guard.py @@ -78,7 +78,6 @@ def prepare(self, macro_name): def get_include_guard_info(lines): - guard = IncludeGuard() for line, text in enumerate(lines): if text.startswith("#pragma once"): @@ -108,7 +107,6 @@ def get_include_guard_macro_name(filepath): def main(argv=None): - parser = argparse.ArgumentParser() parser.add_argument("filenames", nargs="*", type=Path, help="Filenames to fix") args = parser.parse_args(argv) diff --git a/tests/test_ros_include_guard.py b/tests/test_ros_include_guard.py index 5555bc4..6502c55 100644 --- a/tests/test_ros_include_guard.py +++ b/tests/test_ros_include_guard.py @@ -23,7 +23,6 @@ @pytest.mark.parametrize(("target_file"), cases_auto_fix) def test_auto_fix(target_file, datadir): - target_path = datadir.joinpath(target_file) right_path = target_path.with_suffix(".right" + target_path.suffix) wrong_path = target_path.with_suffix(".wrong" + target_path.suffix) @@ -43,7 +42,6 @@ def test_auto_fix(target_file, datadir): @pytest.mark.parametrize(("target_file", "answer_code"), cases_no_fix) def test_no_fix(target_file, answer_code, datadir): - target_path = datadir.joinpath(target_file) return_code = ros_include_guard.main([str(target_path)]) assert return_code == answer_code