Run mypy on future tools

Add the tools directory to the mypy pre-commit configuration.
bpf_inspect.py has a bunch of mypy errors, so we'll opt it out for now.

Signed-off-by: Omar Sandoval <osandov@osandov.com>
This commit is contained in:
Omar Sandoval 2024-02-29 21:57:20 -08:00
parent aaf4414af2
commit 6eae1d34f8
2 changed files with 3 additions and 1 deletions

View File

@ -18,7 +18,7 @@ repos:
hooks: hooks:
- id: mypy - id: mypy
args: [--show-error-codes, --strict, --no-warn-return-any, --no-warn-unused-ignores] args: [--show-error-codes, --strict, --no-warn-return-any, --no-warn-unused-ignores]
files: ^drgn/.*\.py|_drgn.pyi$ files: ^(drgn/.*\.py|_drgn.pyi|tools/.*\.py)$
- repo: https://github.com/pre-commit/pre-commit-hooks - repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0 rev: v4.5.0
hooks: hooks:

View File

@ -2,6 +2,8 @@
# Copyright (c) Meta Platforms, Inc. and affiliates. # Copyright (c) Meta Platforms, Inc. and affiliates.
# SPDX-License-Identifier: LGPL-2.1-or-later # SPDX-License-Identifier: LGPL-2.1-or-later
# type: ignore
import argparse import argparse
from drgn.helpers.common.type import enum_type_to_class from drgn.helpers.common.type import enum_type_to_class