Skip to content

Commit

Permalink
Add mypy to our pre-commit config
Browse files Browse the repository at this point in the history
Also use explicit hashes for pre-commit hooks.
That's a little safer.
  • Loading branch information
stefanscherzinger committed Oct 30, 2024
1 parent 5ee4702 commit 504d9d4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
9 changes: 7 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,20 @@ repos:

# Python
- repo: https://github.com/pycqa/flake8
rev: 6.0.0
rev: '88a4f9b2f48fc44b025a48fa6a8ac7cc89ef70e0' # 7.0.0
hooks:
- id: flake8

- repo: https://github.com/psf/black.git
rev: 23.7.0
rev: '6fdf8a4af28071ed1d079c01122b34c5d587207a' # 24.2.0
hooks:
- id: black

- repo: https://github.com/pre-commit/mirrors-mypy
rev: '9db9854e3041219b1eb619872a2dfaf58adfb20b' # v1.9.0
hooks:
- id: mypy

# C++
- repo: local
hooks:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -272,11 +272,15 @@ def set_parameters(self, client: Client, params: list[Parameter]) -> None:
req = SetParameters.Request()
req.parameters = params
future = client.call_async(req)
rclpy.spin_until_future_complete(self.node, future)
rclpy.spin_until_future_complete(
self.node, future # type: ignore[attr-defined]
)

def get_parameters(self, client: Client, names: list[str]) -> Any:
req = GetParameters.Request()
req.names = names
future = client.call_async(req)
rclpy.spin_until_future_complete(self.node, future)
rclpy.spin_until_future_complete(
self.node, future # type: ignore[attr-defined]
)
return future.result()

0 comments on commit 504d9d4

Please sign in to comment.