Skip to content

Commit 4c67b09

Browse files
committed
pre-commit: Add mypy hook
Signed-off-by: dann frazier <dann.frazier@chainguard.dev>
1 parent 21ae0b9 commit 4c67b09

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

.pre-commit-config.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,7 @@ repos:
4242
rev: 4b5e89b4b108a6c1a000c591d334a99a80d34c7b # frozen: 7.2.0
4343
hooks:
4444
- id: flake8
45+
- repo: https://github.com/pre-commit/mirrors-mypy
46+
rev: f40886d54c729f533f864ed6ce584e920feb0af7 # frozen: v1.15.0
47+
hooks:
48+
- id: mypy

pre_commit_hooks/shellcheck_run_steps.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import subprocess
55
import tempfile
66
from collections.abc import Generator
7+
from collections.abc import Mapping
78
from collections.abc import Sequence
89
from typing import Any
910
from typing import NamedTuple
@@ -31,9 +32,9 @@ class Key(NamedTuple):
3132
unsafe: bool
3233

3334

34-
def do_shellcheck(melange_cfg):
35+
def do_shellcheck(melange_cfg: Mapping[str, Any]) -> None:
3536
if melange_cfg == {}:
36-
return 0
37+
return
3738

3839
pkgs = [melange_cfg]
3940
pkgs.extend(melange_cfg.get("subpackages", []))

0 commit comments

Comments
 (0)