From c255a121f1fba0a5a0cee4abdaf24893d59ff806 Mon Sep 17 00:00:00 2001 From: Julian Rother <julian@jrother.eu> Date: Wed, 28 Jul 2021 17:57:49 +0200 Subject: [PATCH] Fixed some linter errors and temporarily disabled all docstring errors --- .pylintrc | 13 ++++++++----- ldapserver/exceptions.py | 1 + ldapserver/schema.py | 2 ++ ldapserver/server.py | 9 +++------ ldapserver/util.py | 1 - 5 files changed, 14 insertions(+), 12 deletions(-) diff --git a/.pylintrc b/.pylintrc index ee3290f..af17b43 100644 --- a/.pylintrc +++ b/.pylintrc @@ -60,11 +60,14 @@ confidence= # --enable=similarities". If you want to run only the classes checker, but have # no Warning level messages displayed, use "--disable=all --enable=classes # --disable=W". -disable=unused-wildcard-import, # Currently used for the many protocol types/constants - wildcard-import, # Currently used for the many protocol types/constants - unused-argument, # Too many false-positives, we're implementing interfaces in most cases - too-few-public-methods, # Too many false-positives - no-else-return, # Personal stylistic preference +disable=unused-argument, # Too many false-positives, we're implementing interfaces in most cases + too-few-public-methods, # Too many false-positives + no-else-return, # Personal stylistic preference + attribute-defined-outside-init, # False-positives with socketserver + missing-module-docstring, # Temporarily disabled + missing-class-docstring, # Temporarily disabled + missing-function-docstring, # Temporarily disabled + empty-docstring, # Temporarily disabled # Enable the message, report, category or checker with the given id(s). You can # either give multiple identifier separated by comma (,) or put this option diff --git a/ldapserver/exceptions.py b/ldapserver/exceptions.py index 990493e..69a45df 100644 --- a/ldapserver/exceptions.py +++ b/ldapserver/exceptions.py @@ -6,6 +6,7 @@ class LDAPError(Exception): result_code = None def __init__(self, message=''): + super().__init__() self.code = self.result_code self.message = message diff --git a/ldapserver/schema.py b/ldapserver/schema.py index 24c2f02..8a2beaa 100644 --- a/ldapserver/schema.py +++ b/ldapserver/schema.py @@ -1,3 +1,5 @@ +# pylint: disable=line-too-long + from . import directory CORE_SYNTAXES = ( diff --git a/ldapserver/server.py b/ldapserver/server.py index 101b849..a8b7607 100644 --- a/ldapserver/server.py +++ b/ldapserver/server.py @@ -1,7 +1,4 @@ import traceback -import hashlib -import secrets -import socket import ssl import socketserver @@ -203,7 +200,7 @@ class SimpleLDAPRequestHandler(BaseLDAPRequestHandler): :rtype: list of bytes objects SASL mechanism name are typically all-caps, like "EXTERNAL". - + Called whenever the root DSE attribute "supportedSASLMechanisms" is queried.''' res = [] if self.supports_sasl_anonymous: @@ -526,7 +523,7 @@ class SimpleLDAPRequestHandler(BaseLDAPRequestHandler): def do_password_modify(self, user=None, old_password=None, new_password=None): '''Do password modify extended operation (RFC 3062) - + :param user: User the request relates to, may or may not be a distinguished name. If absent, the request relates to the user currently associated with the LDAP connection @@ -535,7 +532,7 @@ class SimpleLDAPRequestHandler(BaseLDAPRequestHandler): :type old_password: bytes, optional :param new_password: Desired password for user :type new_password: bytes, optional - + Called by `handle_extended()` if :any:`supports_password_modify` is True. The default implementation always raises an :any:`LDAPUnwillingToPerform` error.''' raise exceptions.LDAPUnwillingToPerform() diff --git a/ldapserver/util.py b/ldapserver/util.py index 745df98..7c03663 100644 --- a/ldapserver/util.py +++ b/ldapserver/util.py @@ -45,4 +45,3 @@ class AttributeDict(CaseInsensitiveDict): if key not in self: self[key] = [] return super().__getitem__(key) - -- GitLab