fix flake8 issues

This commit is contained in:
Yacine Elhamer
2023-07-27 15:10:01 +01:00
parent 44c5e96cf0
commit 2efb7f2975

View File

@@ -25,7 +25,7 @@ except ImportError:
# https://github.com/python/mypy/issues/1153
from backports.functools_lru_cache import lru_cache # type: ignore
from typing import Any, Set, Dict, List, Tuple, Union, Iterator
from typing import Any, Set, Dict, List, Tuple, Union, Iterator, Optional
from dataclasses import asdict, dataclass
import yaml
@@ -112,8 +112,8 @@ DYNAMIC_SCOPES = (
@dataclass
class Scopes:
static: Union[str, None] = None
dynamic: Union[str, None] = None
static: Optional[str] = None
dynamic: Optional[str] = None
@lru_cache() # type: ignore
def __new__(cls, *args, **kwargs):
@@ -586,7 +586,7 @@ def build_statements(d, scopes: Scopes):
)
elif key == "instruction":
if all(map(lambda s: s not in scopes, (FUNCTION_SCOPE, BASIC_BLOCK_SCOPE))):
if all(s not in scopes for s in (FUNCTION_SCOPE, BASIC_BLOCK_SCOPE)):
raise InvalidRule("instruction subscope supported only for function and basic block scope")
if len(d[key]) == 1: