From 4d4e8f133bcfa5d4db7042c5737ad07807dfda36 Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Tue, 23 Nov 2021 13:08:44 +0100 Subject: [PATCH] Fix some pylint warnings --- mylib/config.py | 5 ++++- mylib/ldap.py | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/mylib/config.py b/mylib/config.py index b296152..6d964cf 100644 --- a/mylib/config.py +++ b/mylib/config.py @@ -533,6 +533,9 @@ class ConfigSection: class RawWrappedTextHelpFormatter(argparse.RawDescriptionHelpFormatter): + """ + Custom TextHelpFormatter for argparse.ArgumentParser that allowing line to keep line return + """ def _split_lines(self, text, width): result = [] @@ -551,7 +554,7 @@ class RawWrappedTextHelpFormatter(argparse.RawDescriptionHelpFormatter): return result -class Config: +class Config: # pylint: disable=too-many-instance-attributes """ Configuration helper """ def __init__(self, appname, shortname=None, version=None, encoding=None, diff --git a/mylib/ldap.py b/mylib/ldap.py index ce30951..3f09020 100644 --- a/mylib/ldap.py +++ b/mylib/ldap.py @@ -372,7 +372,9 @@ class LdapClient: """ Configure options on registered mylib.Config object """ assert self._config, "mylib.Config object not registered. Must be passed to __init__ as config keyword argument." - from mylib.config import StringOption, PasswordOption + # Load configuration option types only here to avoid global + # dependency of ldap module with config one. + from mylib.config import StringOption, PasswordOption # pylint: disable=import-outside-toplevel section = self._config.add_section( self._config_section,