Philipp Hörist pushed to branch master at gajim / gajim

Commits:
422cd129 by Philipp Hörist at 2018-09-18T16:45:16Z
Fix pylint errors

- deprecated-method
- anomalous-backslash-in-string
- cell-var-from-loop
- undefined-loop-variable

- - - - -
7fcd85f0 by Philipp Hörist at 2018-09-18T16:53:13Z
Update pylint error list

- Check for W0631 undefined-loop-variable
- Check for W0640 cell-var-from-loop
- Check for W1401 anomalous-backslash-in-string
- Check for W1505 deprecated-method

- - - - -


8 changed files:

- .gitlab-ci.yml
- gajim/command_system/framework.py
- gajim/common/config.py
- gajim/common/optparser.py
- gajim/common/zeroconf/zeroconf_bonjour.py
- gajim/dataforms_widget.py
- gajim/dialogs.py
- scripts/dev/pre-push-tests.sh


Changes:

=====================================
.gitlab-ci.yml
=====================================
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -19,7 +19,7 @@ run-mypy:
 run-pylint:
   stage: test
   script:
-    - pylint3 --jobs=2 
--disable=C0103,C0302,C0330,C0411,C0412,C0413,E0203,E0401,E0611,E0710,E0712,E1101,E1102,E1128,E1133,E1136,R0201,R0901,R0904,R0913,R0916,R1702,R1706,R1711,R1716,W0201,W0212,W0221,W0223,W0311,W0401,W0603,W0613,W0614,W0631,W0640,W1401,W1505
 gajim
+    - pylint3 --jobs=2 
--disable=C0103,C0302,C0330,C0411,C0412,C0413,E0203,E0401,E0611,E0710,E0712,E1101,E1102,E1128,E1133,E1136,R0201,R0901,R0904,R0913,R0916,R1702,R1706,R1711,R1716,W0201,W0212,W0221,W0223,W0311,W0401,W0603,W0613,W0614
 gajim
 
 run-build:
   stage: build


=====================================
gajim/command_system/framework.py
=====================================
--- a/gajim/command_system/framework.py
+++ b/gajim/command_system/framework.py
@@ -215,7 +215,7 @@ class Command:
         Extract handler's arguments specification, as it was defined
         preserving their order.
         """
-        names, var_args, var_kwargs, defaults = getargspec(self.handler)
+        names, var_args, var_kwargs, defaults = getargspec(self.handler)  # 
pylint: disable=W1505
 
         # Behavior of this code need to be checked. Might yield
         # incorrect results on some rare occasions.


=====================================
gajim/common/config.py
=====================================
--- a/gajim/common/config.py
+++ b/gajim/common/config.py
@@ -48,7 +48,7 @@ class Option(IntEnum):
 opt_int = ['integer', 0]
 opt_str = ['string', 0]
 opt_bool = ['boolean', 0]
-opt_color = ['color', 
'^(#[0-9a-fA-F]{6})|()|rgb\(\d+,\d+,\d+\)|rgba\(\d+,\d+,\d+,[01]\.?\d*\)$']
+opt_color = ['color', 
r'(#[0-9a-fA-F]{6})|rgb\(\d+,\d+,\d+\)|rgba\(\d+,\d+,\d+,[01]\.?\d*\)']
 opt_one_window_types = ['never', 'always', 'always_with_roster', 'peracct', 
'pertype']
 opt_show_roster_on_startup = ['always', 'never', 'last_state']
 opt_treat_incoming_messages = ['', 'chat', 'normal']


=====================================
gajim/common/optparser.py
=====================================
--- a/gajim/common/optparser.py
+++ b/gajim/common/optparser.py
@@ -59,7 +59,7 @@ class OptionsParser:
         for line in fd:
             match = regex.match(line)
             if match is None:
-                log.warn('Invalid configuration line, ignoring it: %s', line)
+                log.warning('Invalid configuration line, ignoring it: %s', 
line)
                 continue
             optname, key, subname, value = match.groups()
             if key is None:


=====================================
gajim/common/zeroconf/zeroconf_bonjour.py
=====================================
--- a/gajim/common/zeroconf/zeroconf_bonjour.py
+++ b/gajim/common/zeroconf/zeroconf_bonjour.py
@@ -121,7 +121,7 @@ class Zeroconf:
                     }
 
         # Split on '.' but do not split on '\.'
-        result = re.split('(?<!\\\\)\.', fullname)
+        result = re.split(r'(?<!\\\\)\.', fullname)
         name = result[0]
         protocol, domain = result[2:4]
 


=====================================
gajim/dataforms_widget.py
=====================================
--- a/gajim/dataforms_widget.py
+++ b/gajim/dataforms_widget.py
@@ -428,12 +428,12 @@ class SingleForm(Gtk.Table):
                         widget.set_sensitive(readwrite)
                 else:
                     # more than 5 options: show combobox
-                    def on_list_multi_treeview_changed(selection, f):
-                        def for_selected(treemodel, path, iter_):
+                    def on_list_multi_treeview_changed(selection, field_):
+                        def for_selected(treemodel, _path, iter_):
                             vals.append(treemodel[iter_][1])
                         vals = []
                         selection.selected_foreach(for_selected)
-                        field.values = vals[:]
+                        field_.values = vals[:]
                     widget = Gtk.ScrolledWindow()
                     widget.set_policy(Gtk.PolicyType.AUTOMATIC, 
Gtk.PolicyType.AUTOMATIC)
                     tv = gtkgui_helpers.create_list_multi(field.options,


=====================================
gajim/dialogs.py
=====================================
--- a/gajim/dialogs.py
+++ b/gajim/dialogs.py
@@ -104,6 +104,7 @@ class EditGroupsDialog:
                 account, [group])
 
         # FIXME: Ugly workaround.
+        # pylint: disable=undefined-loop-variable
         app.interface.roster.draw_group(_('General'), account)
 
     def add_group(self, group):
@@ -116,6 +117,7 @@ class EditGroupsDialog:
 
         # FIXME: Ugly workaround.
         # Maybe we haven't been in any group (defaults to General)
+        # pylint: disable=undefined-loop-variable
         app.interface.roster.draw_group(_('General'), account)
 
     def on_add_button_clicked(self, widget):
@@ -1692,17 +1694,15 @@ class VoIPCallReceivedDialog:
                         out_xid = ctrl.xml.get_object('outgoing_drawingarea').\
                             get_property('window').get_xid()
                     b = content.src_bin
-                    found = False
                     for e in b.children:
-                        if e.get_name().startswith('autovideosink'):
-                            found = True
-                            break
-                    if found:
+                        if not e.get_name().startswith('autovideosink'):
+                            continue
                         for f in e.children:
                             if f.get_name().startswith('autovideosink'):
                                 f.set_window_handle(out_xid)
                                 content.out_xid = out_xid
                                 break
+                        break
                 content.in_xid = in_xid
                 ctrl.set_video_state('connecting', self.sid)
             # Now, accept the content/sessions.


=====================================
scripts/dev/pre-push-tests.sh
=====================================
--- a/scripts/dev/pre-push-tests.sh
+++ b/scripts/dev/pre-push-tests.sh
@@ -1,5 +1,5 @@
 mypy -p gajim.common.modules --follow-imports=skip
-pylint --jobs=2 
--disable=C0103,C0302,C0330,C0411,C0412,C0413,E0203,E0401,E0611,E0710,E0712,E1101,E1102,E1128,E1133,E1136,R0201,R0901,R0904,R0913,R0916,R1702,R1706,R1711,R1716,W0201,W0212,W0221,W0223,W0311,W0401,W0603,W0613,W0614,W0631,W0640,W1401,W1505
 gajim
+pylint --jobs=2 
--disable=C0103,C0302,C0330,C0411,C0412,C0413,E0203,E0401,E0611,E0710,E0712,E1101,E1102,E1128,E1133,E1136,R0201,R0901,R0904,R0913,R0916,R1702,R1706,R1711,R1716,W0143,W0201,W0212,W0221,W0223,W0311,W0401,W0603,W0613,W0614
 gajim
 
 # C0103 invalid-name
 # C0302 too-many-lines
@@ -10,6 +10,7 @@ pylint --jobs=2 
--disable=C0103,C0302,C0330,C0411,C0412,C0413,E0203,E0401,E0611,
 # E0203 access-member-before-definition
 # E0401 import-error
 # E0611 no-name-in-module
-# E0710 raising-non-exception   - GLIB
-# E0712 catching-non-exception  - GLIB
-# R0201 no-self-use
\ No newline at end of file
+# E0710 raising-non-exception   - GLib.GError is not recognized
+# E0712 catching-non-exception  - GLib.GError is not recognized
+# R0201 no-self-use
+# W0143 comparison-with-callable - Dont add to Server CI, only available on 
pylint 2.0+
\ No newline at end of file



View it on GitLab: 
https://dev.gajim.org/gajim/gajim/compare/6c80473ebe645e38c38b10a3d67d008f27e4aac5...7fcd85f0266727556b474298abd84145bddcb912

-- 
View it on GitLab: 
https://dev.gajim.org/gajim/gajim/compare/6c80473ebe645e38c38b10a3d67d008f27e4aac5...7fcd85f0266727556b474298abd84145bddcb912
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