From d9e5b67060e0b402105854b9f67a925cea7bc1ff Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 16 Aug 2024 16:46:39 +0000 Subject: [PATCH] chore: pre-commit autoupdate (#4270) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pycontribs/mirrors-prettier: v3.3.2 → v3.3.3](https://github.com/pycontribs/mirrors-prettier/compare/v3.3.2...v3.3.3) - [github.com/psf/black: 24.4.2 → 24.8.0](https://github.com/psf/black/compare/24.4.2...24.8.0) - [github.com/astral-sh/ruff-pre-commit: v0.5.0 → v0.5.6](https://github.com/astral-sh/ruff-pre-commit/compare/v0.5.0...v0.5.6) - [github.com/streetsidesoftware/cspell-cli: v8.9.0 → v8.13.1](https://github.com/streetsidesoftware/cspell-cli/compare/v8.9.0...v8.13.1) - [github.com/jsh9/pydoclint: 0.5.3 → 0.5.6](https://github.com/jsh9/pydoclint/compare/0.5.3...0.5.6) - [github.com/pycqa/pylint.git: v3.2.4 → v3.2.6](https://github.com/pycqa/pylint.git/compare/v3.2.4...v3.2.6) - [github.com/pre-commit/mirrors-mypy.git: v1.10.1 → v1.11.1](https://github.com/pre-commit/mirrors-mypy.git/compare/v1.10.1...v1.11.1) - [github.com/ansible/ansible-lint: v24.6.1 → v24.7.0](https://github.com/ansible/ansible-lint/compare/v24.6.1...v24.7.0) --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Kate Case --- .config/pydoclint-baseline.txt | 6 +++--- .pre-commit-config.yaml | 16 ++++++++-------- src/molecule/dependency/ansible_galaxy/base.py | 6 +++++- src/molecule/dependency/base.py | 8 +++++++- src/molecule/driver/base.py | 8 ++++++-- src/molecule/interpolation.py | 6 +++--- 6 files changed, 32 insertions(+), 18 deletions(-) diff --git a/.config/pydoclint-baseline.txt b/.config/pydoclint-baseline.txt index d571d8555d..d7a15e60fc 100644 --- a/.config/pydoclint-baseline.txt +++ b/.config/pydoclint-baseline.txt @@ -242,7 +242,7 @@ src/molecule/dependency/ansible_galaxy/__init__.py -------------------- src/molecule/dependency/ansible_galaxy/base.py DOC601: Class `AnsibleGalaxyBase`: Class docstring contains fewer class attributes than actual class attributes. (Please read https://jsh9.github.io/pydoclint/checking_class_attributes.html on how to correctly document class attributes.) - DOC603: Class `AnsibleGalaxyBase`: Class docstring attributes are different from actual class attributes. (Or could be other formatting issues: https://jsh9.github.io/pydoclint/violation_codes.html#notes-on-doc103 ). Attributes in the class definition but not in the docstring: [FILTER_OPTS: , __metaclass__: ]. (Please read https://jsh9.github.io/pydoclint/checking_class_attributes.html on how to correctly document class attributes.) + DOC603: Class `AnsibleGalaxyBase`: Class docstring attributes are different from actual class attributes. (Or could be other formatting issues: https://jsh9.github.io/pydoclint/violation_codes.html#notes-on-doc103 ). Attributes in the class definition but not in the docstring: [__metaclass__: ]. (Please read https://jsh9.github.io/pydoclint/checking_class_attributes.html on how to correctly document class attributes.) DOC101: Method `AnsibleGalaxyBase.__init__`: Docstring contains fewer arguments than in function signature. DOC106: Method `AnsibleGalaxyBase.__init__`: The option `--arg-type-hints-in-signature` is `True` but there are no argument type hints in the signature DOC107: Method `AnsibleGalaxyBase.__init__`: The option `--arg-type-hints-in-signature` is `True` but not all args in the signature have type hints @@ -262,7 +262,7 @@ src/molecule/dependency/ansible_galaxy/roles.py -------------------- src/molecule/dependency/base.py DOC601: Class `Base`: Class docstring contains fewer class attributes than actual class attributes. (Please read https://jsh9.github.io/pydoclint/checking_class_attributes.html on how to correctly document class attributes.) - DOC603: Class `Base`: Class docstring attributes are different from actual class attributes. (Or could be other formatting issues: https://jsh9.github.io/pydoclint/violation_codes.html#notes-on-doc103 ). Attributes in the class definition but not in the docstring: [BACKOFF: , RETRY: , SLEEP: , __metaclass__: ]. (Please read https://jsh9.github.io/pydoclint/checking_class_attributes.html on how to correctly document class attributes.) + DOC603: Class `Base`: Class docstring attributes are different from actual class attributes. (Or could be other formatting issues: https://jsh9.github.io/pydoclint/violation_codes.html#notes-on-doc103 ). Attributes in the class definition but not in the docstring: [__metaclass__: ]. (Please read https://jsh9.github.io/pydoclint/checking_class_attributes.html on how to correctly document class attributes.) DOC106: Method `Base.__init__`: The option `--arg-type-hints-in-signature` is `True` but there are no argument type hints in the signature DOC107: Method `Base.__init__`: The option `--arg-type-hints-in-signature` is `True` but not all args in the signature have type hints DOC201: Method `Base.execute_with_retries` does not have a return section in docstring @@ -280,7 +280,7 @@ src/molecule/dependency/shell.py -------------------- src/molecule/driver/base.py DOC601: Class `Driver`: Class docstring contains fewer class attributes than actual class attributes. (Please read https://jsh9.github.io/pydoclint/checking_class_attributes.html on how to correctly document class attributes.) - DOC603: Class `Driver`: Class docstring attributes are different from actual class attributes. (Or could be other formatting issues: https://jsh9.github.io/pydoclint/violation_codes.html#notes-on-doc103 ). Attributes in the class definition but not in the docstring: [__metaclass__: , title: ]. (Please read https://jsh9.github.io/pydoclint/checking_class_attributes.html on how to correctly document class attributes.) + DOC603: Class `Driver`: Class docstring attributes are different from actual class attributes. (Or could be other formatting issues: https://jsh9.github.io/pydoclint/violation_codes.html#notes-on-doc103 ). Attributes in the class definition but not in the docstring: [__metaclass__: ]. (Please read https://jsh9.github.io/pydoclint/checking_class_attributes.html on how to correctly document class attributes.) DOC106: Method `Driver.__init__`: The option `--arg-type-hints-in-signature` is `True` but there are no argument type hints in the signature DOC107: Method `Driver.__init__`: The option `--arg-type-hints-in-signature` is `True` but not all args in the signature have type hints DOC101: Method `Driver.name`: Docstring contains fewer arguments than in function signature. diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 42b3468385..e0c1ac9e3f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -34,7 +34,7 @@ repos: )$ - repo: https://github.com/pycontribs/mirrors-prettier - rev: v3.3.2 + rev: v3.3.3 hooks: - id: prettier always_run: true @@ -44,7 +44,7 @@ repos: - prettier-plugin-sort-json - repo: https://github.com/psf/black - rev: 24.4.2 + rev: 24.8.0 hooks: - id: black @@ -59,20 +59,20 @@ repos: - id: tox-ini-fmt - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.5.0 + rev: v0.5.6 hooks: - id: ruff args: - --exit-non-zero-on-fix - repo: https://github.com/streetsidesoftware/cspell-cli - rev: v8.9.0 + rev: v8.13.1 hooks: - id: cspell name: Spell check with cspell - repo: https://github.com/jsh9/pydoclint - rev: "0.5.3" + rev: "0.5.6" hooks: - id: pydoclint # This allows automatic reduction of the baseline file when needed. @@ -80,7 +80,7 @@ repos: pass_filenames: false - repo: https://github.com/pycqa/pylint.git - rev: v3.2.4 + rev: v3.2.6 hooks: - id: pylint args: @@ -98,7 +98,7 @@ repos: - wcmatch - repo: https://github.com/pre-commit/mirrors-mypy.git - rev: v1.10.1 + rev: v1.11.1 hooks: - id: mypy additional_dependencies: @@ -135,7 +135,7 @@ repos: files: ^.config\/.*requirements.*$ language_version: "3.10" # minimal we support officially - repo: https://github.com/ansible/ansible-lint - rev: v24.6.1 + rev: v24.7.0 hooks: - id: ansible-lint stages: [manual] diff --git a/src/molecule/dependency/ansible_galaxy/base.py b/src/molecule/dependency/ansible_galaxy/base.py index 46437ca594..a4d22ef300 100644 --- a/src/molecule/dependency/ansible_galaxy/base.py +++ b/src/molecule/dependency/ansible_galaxy/base.py @@ -33,7 +33,11 @@ class AnsibleGalaxyBase(base.Base): - """Ansible Galaxy dependency base class.""" + """Ansible Galaxy dependency base class. + + Attributes: + FILTER_OPTS: Keys to remove from the dictionary returned by options(). + """ __metaclass__ = abc.ABCMeta diff --git a/src/molecule/dependency/base.py b/src/molecule/dependency/base.py index 9a22ff1f68..f8d871e3b2 100644 --- a/src/molecule/dependency/base.py +++ b/src/molecule/dependency/base.py @@ -34,7 +34,13 @@ class Base: - """Dependency Base Class.""" + """Dependency Base Class. + + Attributes: + RETRY: Number of times to retry the dependency. + SLEEP: Number of seconds to sleep between retries. + BACKOFF: Additional number of seconds to sleep for each successive attempt. + """ __metaclass__ = abc.ABCMeta diff --git a/src/molecule/driver/base.py b/src/molecule/driver/base.py index f459f38094..cf078668c4 100644 --- a/src/molecule/driver/base.py +++ b/src/molecule/driver/base.py @@ -30,10 +30,14 @@ class Driver: - """Driver Class.""" + """Driver Class. + + Attributes: + title: Short description of the driver. + """ __metaclass__ = ABCMeta - title = "" # Short description of the driver. + title = "" def __init__(self, config=None) -> None: # type: ignore[no-untyped-def] # noqa: ANN001 """Initialize code for all :ref:`Driver` classes. diff --git a/src/molecule/interpolation.py b/src/molecule/interpolation.py index d39927a91a..0b9bee968c 100644 --- a/src/molecule/interpolation.py +++ b/src/molecule/interpolation.py @@ -23,7 +23,7 @@ if TYPE_CHECKING: - from collections.abc import MutableMapping + from collections.abc import Mapping, MutableMapping class InvalidInterpolation(Exception): # noqa: N818 @@ -96,7 +96,7 @@ def __init__( def interpolate(self, string: str, keep_string=None) -> str: # type: ignore[no-untyped-def] # pylint: disable=redefined-outer-name # noqa: ANN001, D102 try: - return self.templater(string).substitute(self.mapping, keep_string) # type: ignore[no-any-return, no-untyped-call] + return self.templater(string).substitute(self.mapping, keep_string) except ValueError as e: raise InvalidInterpolation(string, e) from e @@ -107,7 +107,7 @@ class TemplateWithDefaults(string.Template): idpattern = r"[_a-z][_a-z0-9]*(?::?-[^}]+)?" # pylint: disable=too-many-return-statements # pylint: disable=useless-suppression - def substitute(self, mapping, keep_string): # type: ignore[no-untyped-def] # pylint: disable=arguments-differ # noqa: ANN001, ANN201, D102 + def substitute(self, mapping: Mapping[str, object], keep_string: str | None) -> str: # type: ignore[override] # pylint: disable=arguments-differ # noqa: D102 # Helper function for .sub() def convert(mo): # type: ignore[no-untyped-def] # noqa: ANN001, ANN202, PLR0911 # Check the most common path first.