Philipp Hörist pushed to branch master at gajim / python-nbxmpp


Commits:
5e326b3e by lovetox at 2020-03-10T21:20:35+01:00
Update .pylintrc

- - - - -
a89e9a52 by lovetox at 2020-03-10T21:26:04+01:00
Remove unused imports

- - - - -
6afd49a5 by lovetox at 2020-03-10T21:30:28+01:00
Fix pylint errors

- - - - -
234379a6 by lovetox at 2020-03-10T21:31:25+01:00
Fix undefined var

- - - - -


6 changed files:

- .pylintrc
- nbxmpp/connection.py
- nbxmpp/old_dispatcher.py
- nbxmpp/resolver.py
- nbxmpp/util.py
- nbxmpp/websocket.py


Changes:

=====================================
.pylintrc
=====================================
@@ -50,7 +50,9 @@ 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=C0111,C0301,R1710,R0912,R0914,R0915,W0511,W0231,W0233
+# C0111 missing-docstring
+# W0511 fix-me
+disable=C0111,W0511
 
 # 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
@@ -94,7 +96,7 @@ max-nested-blocks=5
 
 # List of additional names supposed to be defined in builtins. Remember that
 # you should avoid to define new builtins when possible.
-additional-builtins=_
+additional-builtins=
 
 # Tells whether unused global variables should be treated as a violation.
 allow-global-unused-variables=yes
@@ -138,7 +140,7 @@ ignore-mixin-members=yes
 # List of class names for which member attributes should not be checked (useful
 # for classes with dynamically set attributes). This supports the use of
 # qualified names.
-ignored-classes=optparse.Values,thread._local,_thread._local
+ignored-classes=optparse.Values,thread._local,_thread._local,gi.repository.GLib.Error
 
 # List of module names for which member attributes should not be checked
 # (useful for modules/projects where namespaces are manipulated during runtime
@@ -220,10 +222,10 @@ indent-after-paren=4
 indent-string='    '
 
 # Maximum number of characters on a single line.
-max-line-length=100
+max-line-length=80
 
 # Maximum number of lines in a module
-max-module-lines=1000
+max-module-lines=3000
 
 # List of optional constructs for which whitespace checking is disabled. `dict-
 # separator` is used to allow tabulation in dicts, etc.: {1  : 1,\n222: 2}.
@@ -357,7 +359,7 @@ known-third-party=enchant
 [DESIGN]
 
 # Maximum number of arguments for function / method
-max-args=10
+max-args=15
 
 # Maximum number of attributes for a class (see R0902).
 max-attributes=9999
@@ -366,22 +368,22 @@ max-attributes=9999
 max-bool-expr=5
 
 # Maximum number of branch for function / method body
-max-branches=12
+max-branches=50
 
 # Maximum number of locals for function / method body
-max-locals=15
+max-locals=50
 
 # Maximum number of parents for a class (see R0901).
 max-parents=7
 
 # Maximum number of public methods for a class (see R0904).
-max-public-methods=20
+max-public-methods=50
 
 # Maximum number of return / yield for function / method body
 max-returns=100
 
 # Maximum number of statements in function / method body
-max-statements=50
+max-statements=100
 
 # Minimum number of public methods for a class (see R0903).
 min-public-methods=0


=====================================
nbxmpp/connection.py
=====================================
@@ -88,12 +88,12 @@ class Connection(Observable):
 
         if self._ignored_tls_errors:
             log.warning('Ignore TLS certificate errors: %s',
-                     self._ignored_tls_errors)
+                        self._ignored_tls_errors)
             self._peer_certificate_errors -= self._ignored_tls_errors
 
         if Gio.TlsCertificateFlags.UNKNOWN_CA in self._peer_certificate_errors:
             for accepted_certificate in self._accepted_certificates:
-                if certificate.is_same(accepted_certificate):
+                if self._peer_certificate.is_same(accepted_certificate):
                     self._peer_certificate_errors.discard(
                         Gio.TlsCertificateFlags.UNKNOWN_CA)
                     break


=====================================
nbxmpp/old_dispatcher.py
=====================================
@@ -20,7 +20,6 @@ different handlers to different XMPP stanzas and namespaces
 """
 
 import sys
-import locale
 import re
 import uuid
 import logging


=====================================
nbxmpp/resolver.py
=====================================
@@ -127,6 +127,7 @@ class GioResolver(metaclass=Singleton):
         for result in result_list:
             if result.startswith('_xmpp-client-websocket'):
                 return result.split('=')[1]
+        return None
 
 
 if __name__ == '__main__':


=====================================
nbxmpp/util.py
=====================================
@@ -21,7 +21,6 @@ import weakref
 import hashlib
 import uuid
 import binascii
-import ipaddress
 import os
 import re
 from collections import defaultdict
@@ -29,7 +28,6 @@ from collections import defaultdict
 from functools import wraps
 from functools import lru_cache
 
-import precis_i18n.codec
 from gi.repository import Gio
 
 from nbxmpp.protocol import DiscoInfoMalformed
@@ -37,7 +35,6 @@ from nbxmpp.protocol import isErrorNode
 from nbxmpp.protocol import NS_DATA
 from nbxmpp.protocol import NS_HTTPUPLOAD_0
 from nbxmpp.const import GIO_TLS_ERRORS
-from nbxmpp.const import StreamState
 from nbxmpp.protocol import NS_STREAMS
 from nbxmpp.protocol import NS_CLIENT
 from nbxmpp.protocol import NS_FRAMING


=====================================
nbxmpp/websocket.py
=====================================
@@ -128,7 +128,7 @@ class WebsocketConnection(Connection):
     def _on_websocket_closing(_websocket):
         log.info('Closing')
 
-    def _on_websocket_error(self, websocket, error):
+    def _on_websocket_error(self, _websocket, error):
         log.error(error)
         if self._state not in (TCPState.DISCONNECTED, TCPState.DISCONNECTING):
             self._finalize('disconnected')



View it on GitLab: 
https://dev.gajim.org/gajim/python-nbxmpp/-/compare/6113c4f50de7509563e57ba36eeb63e5132ae106...234379a6e16431bdb18c59d8d699df0a3d2fe683

-- 
View it on GitLab: 
https://dev.gajim.org/gajim/python-nbxmpp/-/compare/6113c4f50de7509563e57ba36eeb63e5132ae106...234379a6e16431bdb18c59d8d699df0a3d2fe683
You're receiving this email because of your account on dev.gajim.org.


_______________________________________________
Commits mailing list
[email protected]
https://lists.gajim.org/cgi-bin/listinfo/commits

Reply via email to