mirror of
https://github.com/varun-r-mallya/Python-BPF.git
synced 2025-12-31 21:06:25 +00:00
make type checks viable
This commit is contained in:
@ -41,16 +41,15 @@ repos:
|
||||
- id: ruff
|
||||
args: ["--fix", "--show-fixes"]
|
||||
- id: ruff-format
|
||||
exclude: ^(docs)
|
||||
exclude: ^(docs)|^(tests)|^(examples)
|
||||
|
||||
## Checking static types
|
||||
#- repo: https://github.com/pre-commit/mirrors-mypy
|
||||
# rev: "v1.10.0"
|
||||
# hooks:
|
||||
# - id: mypy
|
||||
# files: "setup.py"
|
||||
# args: []
|
||||
# additional_dependencies: [types-setuptools]
|
||||
# Checking static types
|
||||
- repo: https://github.com/pre-commit/mirrors-mypy
|
||||
rev: "v1.10.0"
|
||||
hooks:
|
||||
- id: mypy
|
||||
exclude: ^(tests)|^(examples)
|
||||
additional_dependencies: [types-setuptools]
|
||||
|
||||
# Changes tabs to spaces
|
||||
- repo: https://github.com/Lucas-C/pre-commit-hooks
|
||||
|
||||
@ -141,7 +141,7 @@ def compile() -> bool:
|
||||
success = True
|
||||
success = compile_to_ir(str(caller_file), str(ll_file)) and success
|
||||
|
||||
success = (
|
||||
success = bool(
|
||||
subprocess.run(
|
||||
[
|
||||
"llc",
|
||||
|
||||
@ -1,13 +1,13 @@
|
||||
from llvmlite import ir
|
||||
import ast
|
||||
|
||||
from typing import Any
|
||||
|
||||
from .bpf_helper_handler import helper_func_list, handle_helper_call
|
||||
from .type_deducer import ctypes_to_ir
|
||||
from .binary_ops import handle_binary_op
|
||||
from .expr_pass import eval_expr, handle_expr
|
||||
|
||||
local_var_metadata = {}
|
||||
local_var_metadata: dict[str | Any, Any] = {}
|
||||
|
||||
|
||||
def get_probe_string(func_node):
|
||||
|
||||
@ -1,7 +1,11 @@
|
||||
from collections.abc import Callable
|
||||
from typing import Any
|
||||
|
||||
|
||||
class MapProcessorRegistry:
|
||||
"""Registry for map processor functions"""
|
||||
|
||||
_processors = {}
|
||||
_processors: dict[str, Callable[..., Any]] = {}
|
||||
|
||||
@classmethod
|
||||
def register(cls, map_type_name):
|
||||
|
||||
Reference in New Issue
Block a user