Skip to content

Commit

Permalink
Add docstrings and type hints to driver files (#4330)
Browse files Browse the repository at this point in the history
  • Loading branch information
Qalthos authored Nov 21, 2024
1 parent 8de7900 commit 0f21762
Show file tree
Hide file tree
Showing 9 changed files with 249 additions and 137 deletions.
46 changes: 0 additions & 46 deletions .config/pydoclint-baseline.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,52 +42,6 @@ src/molecule/dependency/shell.py
DOC107: Method `Shell.__init__`: The option `--arg-type-hints-in-signature` is `True` but not all args in the signature have type hints
DOC103: Method `Shell.__init__`: Docstring arguments are different from function arguments. (Or could be other formatting issues: https://jsh9.github.io/pydoclint/violation_codes.html#notes-on-doc103 ). Arguments in the function signature but not in the docstring: [config: ].
--------------------
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__: ]. (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.
DOC106: Method `Driver.name`: The option `--arg-type-hints-in-signature` is `True` but there are no argument type hints in the signature
DOC107: Method `Driver.name`: The option `--arg-type-hints-in-signature` is `True` but not all args in the signature have type hints
DOC103: Method `Driver.name`: Docstring arguments are different from function arguments. (Or could be other formatting issues: https://jsh9.github.io/pydoclint/violation_codes.html#notes-on-doc103 ). Arguments in the function signature but not in the docstring: [value: ].
DOC202: Method `Driver.login_cmd_template` has a return section in docstring, but there are no return statements or annotations
DOC106: Method `Driver.login_options`: The option `--arg-type-hints-in-signature` is `True` but there are no argument type hints in the signature
DOC107: Method `Driver.login_options`: The option `--arg-type-hints-in-signature` is `True` but not all args in the signature have type hints
DOC202: Method `Driver.login_options` has a return section in docstring, but there are no return statements or annotations
DOC106: Method `Driver.ansible_connection_options`: The option `--arg-type-hints-in-signature` is `True` but there are no argument type hints in the signature
DOC107: Method `Driver.ansible_connection_options`: The option `--arg-type-hints-in-signature` is `True` but not all args in the signature have type hints
DOC202: Method `Driver.ansible_connection_options` has a return section in docstring, but there are no return statements or annotations
DOC201: Method `Driver.status` does not have a return section in docstring
DOC101: Method `Driver.__eq__`: Docstring contains fewer arguments than in function signature.
DOC106: Method `Driver.__eq__`: The option `--arg-type-hints-in-signature` is `True` but there are no argument type hints in the signature
DOC107: Method `Driver.__eq__`: The option `--arg-type-hints-in-signature` is `True` but not all args in the signature have type hints
DOC103: Method `Driver.__eq__`: Docstring arguments are different from function arguments. (Or could be other formatting issues: https://jsh9.github.io/pydoclint/violation_codes.html#notes-on-doc103 ). Arguments in the function signature but not in the docstring: [other: ].
DOC201: Method `Driver.__eq__` does not have a return section in docstring
DOC101: Method `Driver.__lt__`: Docstring contains fewer arguments than in function signature.
DOC106: Method `Driver.__lt__`: The option `--arg-type-hints-in-signature` is `True` but there are no argument type hints in the signature
DOC107: Method `Driver.__lt__`: The option `--arg-type-hints-in-signature` is `True` but not all args in the signature have type hints
DOC103: Method `Driver.__lt__`: Docstring arguments are different from function arguments. (Or could be other formatting issues: https://jsh9.github.io/pydoclint/violation_codes.html#notes-on-doc103 ). Arguments in the function signature but not in the docstring: [other: ].
DOC201: Method `Driver.__lt__` does not have a return section in docstring
DOC201: Method `Driver.__hash__` does not have a return section in docstring
DOC201: Method `Driver.__str__` does not have a return section in docstring
DOC201: Method `Driver.__repr__` does not have a return section in docstring
DOC201: Method `Driver.__rich__` does not have a return section in docstring
DOC101: Method `Driver.get_playbook`: Docstring contains fewer arguments than in function signature.
DOC106: Method `Driver.get_playbook`: The option `--arg-type-hints-in-signature` is `True` but there are no argument type hints in the signature
DOC107: Method `Driver.get_playbook`: The option `--arg-type-hints-in-signature` is `True` but not all args in the signature have type hints
DOC103: Method `Driver.get_playbook`: Docstring arguments are different from function arguments. (Or could be other formatting issues: https://jsh9.github.io/pydoclint/violation_codes.html#notes-on-doc103 ). Arguments in the function signature but not in the docstring: [step: ].
DOC201: Method `Driver.get_playbook` does not have a return section in docstring
DOC201: Method `Driver.modules_dir` does not have a return section in docstring
--------------------
src/molecule/driver/delegated.py
DOC601: Class `Delegated`: 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 `Delegated`: 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: [title: ]. (Please read https://jsh9.github.io/pydoclint/checking_class_attributes.html on how to correctly document class attributes.)
DOC101: Method `Delegated.__init__`: Docstring contains fewer arguments than in function signature.
DOC106: Method `Delegated.__init__`: The option `--arg-type-hints-in-signature` is `True` but there are no argument type hints in the signature
DOC107: Method `Delegated.__init__`: The option `--arg-type-hints-in-signature` is `True` but not all args in the signature have type hints
DOC103: Method `Delegated.__init__`: Docstring arguments are different from function arguments. (Or could be other formatting issues: https://jsh9.github.io/pydoclint/violation_codes.html#notes-on-doc103 ). Arguments in the function signature but not in the docstring: [config: ].
--------------------
src/molecule/model/schema_v3.py
DOC101: Function `validate`: Docstring contains fewer arguments than in function signature.
DOC106: Function `validate`: The option `--arg-type-hints-in-signature` is `True` but there are no argument type hints in the signature
Expand Down
2 changes: 1 addition & 1 deletion src/molecule/command/list.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def execute( # type: ignore[override]
Returns:
List of statuses.
"""
return self._config.driver.status() # type: ignore[no-untyped-call, no-any-return]
return self._config.driver.status()


@base.click_command_ex(name="list")
Expand Down
2 changes: 1 addition & 1 deletion src/molecule/command/login.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def _get_hostname(self, hosts: list[str]) -> str:
def _get_login(self, hostname: str) -> None: # pragma: no cover
# ruff: noqa: S605,S607
lines, columns = os.popen("stty size", "r").read().split()
login_options = self._config.driver.login_options(hostname) # type: ignore[no-untyped-call]
login_options = self._config.driver.login_options(hostname)
login_options["columns"] = columns
login_options["lines"] = lines
if not self._config.driver.login_cmd_template:
Expand Down
2 changes: 1 addition & 1 deletion src/molecule/driver/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
# D104 # noqa: D104, ERA001
# noqa: D104
Loading

0 comments on commit 0f21762

Please sign in to comment.