fix: fix 'empty-docstring' for pylint
This commit is contained in:
parent
3010c5f435
commit
99e6b98627
6 changed files with 24 additions and 23 deletions
|
@ -7,6 +7,7 @@ enable=anomalous-backslash-in-string,
|
||||||
broad-exception-caught,
|
broad-exception-caught,
|
||||||
dangerous-default-value,
|
dangerous-default-value,
|
||||||
disallowed-name,
|
disallowed-name,
|
||||||
|
empty-docstring,
|
||||||
inconsistent-return-statements,
|
inconsistent-return-statements,
|
||||||
invalid-name,
|
invalid-name,
|
||||||
redefined-argument-from-local,
|
redefined-argument-from-local,
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
################################################################################
|
################################################################################
|
||||||
#
|
#
|
||||||
# WuttJamaican -- Base package for Wutta Framework
|
# WuttJamaican -- Base package for Wutta Framework
|
||||||
# Copyright © 2024 Lance Edgar
|
# Copyright © 2024-2025 Lance Edgar
|
||||||
#
|
#
|
||||||
# This file is part of Wutta Framework.
|
# This file is part of Wutta Framework.
|
||||||
#
|
#
|
||||||
|
@ -34,7 +34,7 @@ class DatabaseHandler(GenericHandler):
|
||||||
Base class and default implementation for the :term:`db handler`.
|
Base class and default implementation for the :term:`db handler`.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def get_dialect(self, bind):
|
def get_dialect(self, bind): # pylint: disable=empty-docstring
|
||||||
""" """
|
""" """
|
||||||
return bind.url.get_dialect().name
|
return bind.url.get_dialect().name
|
||||||
|
|
||||||
|
|
|
@ -51,7 +51,7 @@ if Version(version('SQLAlchemy')) < Version('2'): # pragma: no cover
|
||||||
SA2 = False
|
SA2 = False
|
||||||
|
|
||||||
|
|
||||||
class ModelBase:
|
class ModelBase: # pylint: disable=empty-docstring
|
||||||
""" """
|
""" """
|
||||||
|
|
||||||
def __iter__(self):
|
def __iter__(self):
|
||||||
|
@ -82,16 +82,16 @@ class UUID(sa.types.TypeDecorator):
|
||||||
"""
|
"""
|
||||||
impl = sa.CHAR
|
impl = sa.CHAR
|
||||||
cache_ok = True
|
cache_ok = True
|
||||||
""" """ # nb. suppress sphinx autodoc for cache_ok
|
""" """ # nb. suppress sphinx autodoc for cache_ok
|
||||||
|
|
||||||
def load_dialect_impl(self, dialect):
|
def load_dialect_impl(self, dialect): # pylint: disable=empty-docstring
|
||||||
""" """
|
""" """
|
||||||
if dialect.name == "postgresql":
|
if dialect.name == "postgresql":
|
||||||
return dialect.type_descriptor(PGUUID())
|
return dialect.type_descriptor(PGUUID())
|
||||||
else:
|
else:
|
||||||
return dialect.type_descriptor(sa.CHAR(32))
|
return dialect.type_descriptor(sa.CHAR(32))
|
||||||
|
|
||||||
def process_bind_param(self, value, dialect):
|
def process_bind_param(self, value, dialect): # pylint: disable=empty-docstring
|
||||||
""" """
|
""" """
|
||||||
if value is None:
|
if value is None:
|
||||||
return value
|
return value
|
||||||
|
@ -104,7 +104,7 @@ class UUID(sa.types.TypeDecorator):
|
||||||
# hexstring
|
# hexstring
|
||||||
return "%.32x" % value.int
|
return "%.32x" % value.int
|
||||||
|
|
||||||
def process_result_value(self, value, dialect): # pylint: disable=unused-argument
|
def process_result_value(self, value, dialect): # pylint: disable=unused-argument,empty-docstring
|
||||||
""" """
|
""" """
|
||||||
if value is None:
|
if value is None:
|
||||||
return value
|
return value
|
||||||
|
|
|
@ -196,7 +196,7 @@ class Message:
|
||||||
self.html_body = html_body
|
self.html_body = html_body
|
||||||
self.attachments = attachments or []
|
self.attachments = attachments or []
|
||||||
|
|
||||||
def set_recips(self, name, value):
|
def set_recips(self, name, value): # pylint: disable=empty-docstring
|
||||||
""" """
|
""" """
|
||||||
if value:
|
if value:
|
||||||
if isinstance(value, str):
|
if isinstance(value, str):
|
||||||
|
@ -549,7 +549,7 @@ class EmailHandler(GenericHandler):
|
||||||
"""
|
"""
|
||||||
return self.get_auto_recips(key, 'bcc')
|
return self.get_auto_recips(key, 'bcc')
|
||||||
|
|
||||||
def get_auto_recips(self, key, typ):
|
def get_auto_recips(self, key, typ): # pylint: disable=empty-docstring
|
||||||
""" """
|
""" """
|
||||||
typ = typ.lower()
|
typ = typ.lower()
|
||||||
if typ not in ('to', 'cc', 'bcc'):
|
if typ not in ('to', 'cc', 'bcc'):
|
||||||
|
@ -589,7 +589,7 @@ class EmailHandler(GenericHandler):
|
||||||
return template.render(**context)
|
return template.render(**context)
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def get_auto_body_template(self, key, mode):
|
def get_auto_body_template(self, key, mode): # pylint: disable=empty-docstring
|
||||||
""" """
|
""" """
|
||||||
mode = mode.lower()
|
mode = mode.lower()
|
||||||
if mode not in ('txt', 'html'):
|
if mode not in ('txt', 'html'):
|
||||||
|
|
|
@ -104,10 +104,10 @@ class ConsoleProgress(ProgressBase):
|
||||||
self.bar = Bar(message='', max=self.maximum, width=70, # pylint: disable=disallowed-name
|
self.bar = Bar(message='', max=self.maximum, width=70, # pylint: disable=disallowed-name
|
||||||
suffix='%(index)d/%(max)d %(percent)d%% ETA %(eta)ds')
|
suffix='%(index)d/%(max)d %(percent)d%% ETA %(eta)ds')
|
||||||
|
|
||||||
def update(self, value):
|
def update(self, value): # pylint: disable=empty-docstring
|
||||||
""" """
|
""" """
|
||||||
self.bar.next()
|
self.bar.next()
|
||||||
|
|
||||||
def finish(self):
|
def finish(self): # pylint: disable=empty-docstring
|
||||||
""" """
|
""" """
|
||||||
self.bar.finish()
|
self.bar.finish()
|
||||||
|
|
|
@ -53,7 +53,7 @@ class FileTestCase(TestCase):
|
||||||
class.
|
class.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self): # pylint: disable=empty-docstring
|
||||||
""" """
|
""" """
|
||||||
self.setup_files()
|
self.setup_files()
|
||||||
|
|
||||||
|
@ -63,14 +63,14 @@ class FileTestCase(TestCase):
|
||||||
"""
|
"""
|
||||||
self.tempdir = tempfile.mkdtemp()
|
self.tempdir = tempfile.mkdtemp()
|
||||||
|
|
||||||
def setup_file_config(self): # pragma: no cover
|
def setup_file_config(self): # pragma: no cover; pylint: disable=empty-docstring
|
||||||
""" """
|
""" """
|
||||||
warnings.warn("FileTestCase.setup_file_config() is deprecated; "
|
warnings.warn("FileTestCase.setup_file_config() is deprecated; "
|
||||||
"please use setup_files() instead",
|
"please use setup_files() instead",
|
||||||
DeprecationWarning, stacklevel=2)
|
DeprecationWarning, stacklevel=2)
|
||||||
self.setup_files()
|
self.setup_files()
|
||||||
|
|
||||||
def tearDown(self):
|
def tearDown(self): # pylint: disable=empty-docstring
|
||||||
""" """
|
""" """
|
||||||
self.teardown_files()
|
self.teardown_files()
|
||||||
|
|
||||||
|
@ -80,7 +80,7 @@ class FileTestCase(TestCase):
|
||||||
"""
|
"""
|
||||||
shutil.rmtree(self.tempdir)
|
shutil.rmtree(self.tempdir)
|
||||||
|
|
||||||
def teardown_file_config(self): # pragma: no cover
|
def teardown_file_config(self): # pragma: no cover; pylint: disable=empty-docstring
|
||||||
""" """
|
""" """
|
||||||
warnings.warn("FileTestCase.teardown_file_config() is deprecated; "
|
warnings.warn("FileTestCase.teardown_file_config() is deprecated; "
|
||||||
"please use teardown_files() instead",
|
"please use teardown_files() instead",
|
||||||
|
@ -99,7 +99,7 @@ class FileTestCase(TestCase):
|
||||||
f.write(content)
|
f.write(content)
|
||||||
return path
|
return path
|
||||||
|
|
||||||
def mkdir(self, dirname): # pylint: disable=unused-argument
|
def mkdir(self, dirname): # pylint: disable=unused-argument,empty-docstring
|
||||||
""" """
|
""" """
|
||||||
warnings.warn("FileTestCase.mkdir() is deprecated; "
|
warnings.warn("FileTestCase.mkdir() is deprecated; "
|
||||||
"please use FileTestCase.mkdtemp() instead",
|
"please use FileTestCase.mkdtemp() instead",
|
||||||
|
@ -143,7 +143,7 @@ class ConfigTestCase(FileTestCase):
|
||||||
methods for this class.
|
methods for this class.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self): # pylint: disable=empty-docstring
|
||||||
""" """
|
""" """
|
||||||
self.setup_config()
|
self.setup_config()
|
||||||
|
|
||||||
|
@ -155,7 +155,7 @@ class ConfigTestCase(FileTestCase):
|
||||||
self.config = self.make_config()
|
self.config = self.make_config()
|
||||||
self.app = self.config.get_app()
|
self.app = self.config.get_app()
|
||||||
|
|
||||||
def tearDown(self):
|
def tearDown(self): # pylint: disable=empty-docstring
|
||||||
""" """
|
""" """
|
||||||
self.teardown_config()
|
self.teardown_config()
|
||||||
|
|
||||||
|
@ -165,7 +165,7 @@ class ConfigTestCase(FileTestCase):
|
||||||
"""
|
"""
|
||||||
self.teardown_files()
|
self.teardown_files()
|
||||||
|
|
||||||
def make_config(self, **kwargs):
|
def make_config(self, **kwargs): # pylint: disable=empty-docstring
|
||||||
""" """
|
""" """
|
||||||
return WuttaConfig(**kwargs)
|
return WuttaConfig(**kwargs)
|
||||||
|
|
||||||
|
@ -203,7 +203,7 @@ class DataTestCase(FileTestCase):
|
||||||
teardown methods, as this class handles that automatically.
|
teardown methods, as this class handles that automatically.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self): # pylint: disable=empty-docstring
|
||||||
""" """
|
""" """
|
||||||
self.setup_db()
|
self.setup_db()
|
||||||
|
|
||||||
|
@ -222,7 +222,7 @@ class DataTestCase(FileTestCase):
|
||||||
model.Base.metadata.create_all(bind=self.config.appdb_engine)
|
model.Base.metadata.create_all(bind=self.config.appdb_engine)
|
||||||
self.session = self.app.make_session()
|
self.session = self.app.make_session()
|
||||||
|
|
||||||
def tearDown(self):
|
def tearDown(self): # pylint: disable=empty-docstring
|
||||||
""" """
|
""" """
|
||||||
self.teardown_db()
|
self.teardown_db()
|
||||||
|
|
||||||
|
@ -232,6 +232,6 @@ class DataTestCase(FileTestCase):
|
||||||
"""
|
"""
|
||||||
self.teardown_files()
|
self.teardown_files()
|
||||||
|
|
||||||
def make_config(self, **kwargs):
|
def make_config(self, **kwargs): # pylint: disable=empty-docstring
|
||||||
""" """
|
""" """
|
||||||
return WuttaConfig(**kwargs)
|
return WuttaConfig(**kwargs)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue