Skip to content

Commit

Permalink
Improve type hinting (#1500)
Browse files Browse the repository at this point in the history
  • Loading branch information
shatakshiiii authored Apr 28, 2023
1 parent 47fe04d commit 3e3c419
Show file tree
Hide file tree
Showing 11 changed files with 3 additions and 22 deletions.
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,6 @@ ignore = [
'TRY400', # Use `logging.exception` instead of `logging.error`
'TRY401', # Redundant exception object included in `logging.exception` call
'UP033', # [*] Use `@functools.cache` instead of `@functools.lru_cache(maxsize=None)`
'UP035', # `typing.Dict` is deprecated, use `dict` instead

]
exclude = ["tests/fixtures/**", ".git"]
Expand Down
3 changes: 0 additions & 3 deletions src/ansible_navigator/tm_tokenize/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
import functools

from typing import TYPE_CHECKING
from typing import Dict
from typing import List
from typing import Tuple

from .fchainmap import FChainMap
from .reg import make_regset
Expand Down
4 changes: 0 additions & 4 deletions src/ansible_navigator/tm_tokenize/grammars.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,7 @@
import os

from typing import Any
from typing import Dict
from typing import FrozenSet
from typing import List
from typing import NamedTuple
from typing import Tuple
from typing import TypeVar

from .compiler import Compiler
Expand Down
1 change: 0 additions & 1 deletion src/ansible_navigator/tm_tokenize/reg.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from re import Match
from typing import TYPE_CHECKING
from typing import Optional
from typing import Tuple

import onigurumacffi

Expand Down
1 change: 0 additions & 1 deletion src/ansible_navigator/tm_tokenize/region.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from __future__ import annotations

from typing import NamedTuple
from typing import Tuple


Scope = tuple[str, ...]
Expand Down
3 changes: 0 additions & 3 deletions src/ansible_navigator/tm_tokenize/rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,8 @@
from re import Match
from typing import TYPE_CHECKING
from typing import Any
from typing import Dict
from typing import List
from typing import NamedTuple
from typing import Optional
from typing import Tuple

from ._types import Protocol
from .fchainmap import FChainMap
Expand Down
1 change: 0 additions & 1 deletion src/ansible_navigator/tm_tokenize/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

from typing import TYPE_CHECKING
from typing import NamedTuple
from typing import Tuple


if TYPE_CHECKING:
Expand Down
2 changes: 0 additions & 2 deletions src/ansible_navigator/tm_tokenize/tokenize.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
from __future__ import annotations

from typing import TYPE_CHECKING
from typing import List
from typing import Tuple

from .region import Region
from .region import Regions
Expand Down
1 change: 0 additions & 1 deletion src/ansible_navigator/tm_tokenize/utils.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from __future__ import annotations

from re import Match # noqa: F401
from typing import List # noqa: F401
from typing import TypeVar


Expand Down
6 changes: 3 additions & 3 deletions src/ansible_navigator/utils/json_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@

import json

from collections import deque
from dataclasses import dataclass
from typing import Any
from typing import Deque

from jsonschema import SchemaError
from jsonschema import ValidationError
Expand All @@ -14,7 +14,7 @@
from .functions import ExitMessage


def to_path(schema_path: Deque[str]):
def to_path(schema_path: deque):
"""Flatten a path to a dot delimited string.
:param schema_path: The schema path
Expand All @@ -23,7 +23,7 @@ def to_path(schema_path: Deque[str]):
return ".".join(str(index) for index in schema_path)


def json_path(absolute_path: Deque[str]):
def json_path(absolute_path: deque):
"""Flatten a data path to a dot delimited string.
:param absolute_path: The path
Expand Down
2 changes: 0 additions & 2 deletions tests/smoke/no_test_dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@

from dataclasses import dataclass
from pathlib import Path
from typing import List
from typing import Tuple

from ansible_navigator.command_runner import Command
from ansible_navigator.command_runner import CommandRunner
Expand Down

0 comments on commit 3e3c419

Please sign in to comment.