Lint and typing cleanup

This commit is contained in:
Alex Mykyta
2022-02-25 23:05:16 -08:00
parent da3ed05492
commit 7a890b56c5
26 changed files with 852 additions and 94 deletions

View File

@@ -1,5 +1,5 @@
import re
from typing import TYPE_CHECKING
from typing import TYPE_CHECKING, Match
if TYPE_CHECKING:
from systemrdl.node import Node, SignalNode
@@ -13,9 +13,9 @@ def get_indexed_path(top_node: 'Node', target_node: 'Node') -> str:
path = target_node.get_rel_path(top_node, empty_array_suffix="[!]")
# replace unknown indexes with incrementing iterators i0, i1, ...
class repl:
def __init__(self):
def __init__(self) -> None:
self.i = 0
def __call__(self, match):
def __call__(self, match: Match) -> str:
s = f'i{self.i}'
self.i += 1
return s