Switched linter from pylint to ruff

markdown
Ashley Whetter 1 year ago
parent 47e5dcd707
commit a43c6fde2b

@ -2,6 +2,6 @@
from .extension import setup
__all__ = ("setup",)
__version__ = "2.1.0"
__version_info__ = (2, 1, 0)

@ -2,3 +2,10 @@ from .dotnet import DotNetSphinxMapper
from .python import PythonSphinxMapper
from .go import GoSphinxMapper
from .javascript import JavaScriptSphinxMapper
__all__ = (
"DotNetSphinxMapper",
"PythonSphinxMapper",
"GoSphinxMapper",
"JavaScriptSphinxMapper",
)

@ -76,7 +76,6 @@ class PythonMapperBase:
try:
template = self.jinja_env.get_template(f"{self.language}/{self.type}.rst")
except TemplateNotFound:
# Use a try/except here so we fallback to language specific defaults, over base defaults
template = self.jinja_env.get_template(f"base/{self.type}.rst")
ctx.update(**self.get_context_data())

@ -1,12 +1,25 @@
from .mapper import PythonSphinxMapper
from .objects import (
PythonAttribute,
PythonClass,
PythonData,
PythonException,
PythonFunction,
PythonModule,
PythonMethod,
PythonModule,
PythonPackage,
PythonProperty,
PythonAttribute,
PythonData,
PythonException,
)
__all__ = (
"PythonAttribute",
"PythonClass",
"PythonData",
"PythonException",
"PythonFunction",
"PythonMethod",
"PythonModule",
"PythonPackage",
"PythonProperty",
"PythonSphinxMapper",
)

@ -112,7 +112,10 @@ def _resolve_module_placeholders(modules, module_name, visit_path, resolved):
continue
if imported_from not in modules:
msg = f"Cannot resolve import of unknown module {imported_from} in {module_name}"
msg = (
f"Cannot resolve import of unknown module {imported_from}"
f" in {module_name}"
)
LOGGER.warning(msg, type="autoapi", subtype="python_import_resolution")
module["children"].remove(child)
children.pop(child["name"])

@ -203,7 +203,9 @@ class PythonFunction(PythonPythonMapper):
(_format_args(args), return_annotation)
for args, return_annotation in obj["overloads"]
]
"""The list of overloaded signatures ``[(args, return_annotation), ...]`` of this function.
"""The overloaded signatures of this function.
Each tuple is a tuple of ``(args, return_annotation)``
:type: list(tuple(str, str))
"""

@ -0,0 +1 @@
Switched linter from pylint to ruff

@ -1,22 +0,0 @@
[MASTER]
load-plugins=
[MESSAGES CONTROL]
disable=duplicate-code,
fixme,
import-error,
missing-class-docstring,
missing-function-docstring,
missing-module-docstring,
too-few-public-methods,
too-many-locals,
too-many-instance-attributes,
useless-object-inheritance
enable=c-extension-no-member
[BASIC]
good-names=i,j,id,_

@ -37,9 +37,9 @@ commands =
[testenv:lint]
skip_install = true
deps =
pylint~=2.15.9
ruff
commands =
pylint {posargs:autoapi}
ruff check {posargs:autoapi}
[testenv:typecheck]
deps =

Loading…
Cancel
Save