Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove self type #406

Merged
merged 1 commit into from
Nov 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/tox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ on:
pull_request:
branches:
- "main"
schedule:
- cron: "0 0 * * *"
workflow_call:

concurrency:
Expand Down
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