Philipp Hörist pushed to branch master at gajim / gajim
Commits: 385ef2e4 by Philipp Hörist at 2018-09-18T15:02:14Z Fix pylint errors
- duplicate-key - eval-used - comparison-with-callable
- - - - - 803ff3de by Philipp Hörist at 2018-09-18T15:21:53Z Update pylint error list
- Check for W0109 duplicate-key - Check for W0123 eval-used - Check for W0143 comparison-with-callable
- - - - -
6 changed files:
- .gitlab-ci.yml - gajim/common/connection.py - gajim/gui_interface.py - gajim/gui_menu_builder.py - gajim/htmltextview.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,W0109,W0123,W0143,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,W0631,W0640,W1401,W1505 gajim
run-build: stage: build
===================================== gajim/common/connection.py ===================================== --- a/gajim/common/connection.py +++ b/gajim/common/connection.py @@ -1031,7 +1031,7 @@ class Connection(CommonConnection, ConnectionHandlers): nbxmpp.dispatcher_nb.DEFAULT_TIMEOUT_SECONDS = \ self.try_connecting_for_foo_secs # FIXME: this is a hack; need a better way - if self.on_connect_success == self._on_new_account: + if self.on_connect_success == self._on_new_account: # pylint: disable=W0143 con.RegisterDisconnectHandler(self._on_new_account)
if self.client_cert and app.config.get_per('accounts', self.name,
===================================== gajim/gui_interface.py ===================================== --- a/gajim/gui_interface.py +++ b/gajim/gui_interface.py @@ -1873,18 +1873,19 @@ class Interface: ################################################################################
def join_gc_room(self, account, room_jid, nick, password, minimize=False, - is_continued=False): + is_continued=False): """ Join the room immediately """
if app.contacts.get_contact(account, room_jid) and \ not app.contacts.get_contact(account, room_jid).is_groupchat(): - ErrorDialog(_('This is not a group chat'), + ErrorDialog( + _('This is not a group chat'), _('%(room_jid)s is already in your roster. Please check ' - 'if %(room_jid)s is a correct group chat name. If it is, ' - 'delete it from your roster and try joining the group chat ' - 'again.') % {'room_jid': room_jid, 'room_jid': room_jid}) + 'if %(room_jid)s is a correct group chat name. If it is, ' + 'delete it from your roster and try joining the group chat ' + 'again.') % {'room_jid': room_jid}) return
if not nick:
===================================== gajim/gui_menu_builder.py ===================================== --- a/gajim/gui_menu_builder.py +++ b/gajim/gui_menu_builder.py @@ -41,7 +41,7 @@ def build_resources_submenu(contacts, account, action, room_jid=None, item = Gtk.MenuItem.new_with_label( '%s (%s)' % (c.resource, str(c.priority))) sub_menu.append(item) - + # pylint: disable=W0143 if action == roster.on_invite_to_room: item.connect('activate', action, [(c, account)], room_jid, room_account, c.resource)
===================================== gajim/htmltextview.py ===================================== --- a/gajim/htmltextview.py +++ b/gajim/htmltextview.py @@ -183,7 +183,7 @@ INLINE = INLINE_PHRASAL.union(INLINE_PRES).union(INLINE_STRUCT) LIST_ELEMS = set('dl, ol, ul'.split(', '))
for _name in BLOCK_HEAD: - _num = eval(_name[1]) + _num = int(_name[1]) _header_size = (_num - 1) // 2 _weight = (_num - 1) % 2 _element_styles[_name] = '; font-size: %s; %s' % (('large', 'medium', 'small')[_header_size],
===================================== 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,W0109,W0123,W0143,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,W0201,W0212,W0221,W0223,W0311,W0401,W0603,W0613,W0614,W0631,W0640,W1401,W1505 gajim
# C0103 invalid-name # C0302 too-many-lines
View it on GitLab: https://dev.gajim.org/gajim/gajim/compare/457faf38067537735acdaa8b67a4c22eff...