Skip to content

Commit

Permalink
Remove self type
Browse files Browse the repository at this point in the history
  • Loading branch information
ssbarnea committed Nov 12, 2024
1 parent b405ad8 commit c13f41c
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 10 deletions.
18 changes: 11 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,6 @@ repos:
- prettier-plugin-toml
- prettier-plugin-sort-json

- repo: https://github.com/psf/black
rev: 24.10.0
hooks:
- id: black

- repo: https://github.com/pappasam/toml-sort
rev: v0.23.1
hooks:
Expand All @@ -60,14 +55,23 @@ repos:
- id: tox-ini-fmt

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.7.2
rev: v0.7.3
hooks:
- id: ruff
args:
- --fix
- --exit-non-zero-on-fix
types_or: [python, pyi]
- id: ruff-format # must be after ruff
types_or: [python, pyi]

- repo: https://github.com/psf/black # must be after ruff
rev: 24.10.0
hooks:
- id: black

- repo: https://github.com/streetsidesoftware/cspell-cli
rev: v8.15.2
rev: v8.16.0
hooks:
- id: cspell
name: Spell check with cspell
Expand Down
6 changes: 5 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -336,13 +336,17 @@ line-length = 100
target-version = "py310"

[tool.ruff.lint]
ignore = [
"COM812", # conflicts with ISC001 on format
"ISC001" # conflicts with COM812 on format
]
select = ["ALL"]

[tool.ruff.lint.flake8-pytest-style]
parametrize-values-type = "tuple"

[tool.ruff.lint.isort]
known-first-party = ["pytest_ansible"]
known-first-party = ["src"]
lines-after-imports = 2 # Ensures consistency for cases when there's variable vs function/class definitions after imports
lines-between-types = 1 # Separate import/from with 1 line
required-imports = ["from __future__ import annotations"]
Expand Down
2 changes: 1 addition & 1 deletion src/pytest_ansible/module_dispatcher/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def check_required_kwargs(self, **kwargs): # type: ignore[no-untyped-def] # no
raise TypeError(msg)

@abc.abstractmethod
def has_module(self: BaseModuleDispatcher, name: str) -> str:
def has_module(self, name: str) -> str:
"""Return whether ansible provides the requested module.
Must be implemented by a sub-class.
Expand Down
2 changes: 1 addition & 1 deletion src/pytest_ansible/module_dispatcher/v213.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def __init__(self, **kwargs) -> None: # type: ignore[no-untyped-def] # noqa: A
msg = "Only supported with ansible-2.13 and newer"
raise ImportError(msg)

def has_module(self: ModuleDispatcherV213, name: str) -> str:
def has_module(self, name: str) -> str:
"""Determine if a module exists and return the full name or "".
Attributes:
Expand Down

0 comments on commit c13f41c

Please sign in to comment.