summaryrefslogtreecommitdiff
path: root/tests/scripts/python
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2020-05-03 18:39:42 +0200
committerSébastien Helleu <flashcode@flashtux.org>2020-05-03 20:22:21 +0200
commit2b05b64cc1370801a32fc8ffcbaadb7c80d296ba (patch)
tree522a71a81790f74cafb408f99199d735235a5e69 /tests/scripts/python
parentdff1bf6f0f5521cf9e23e2b32a648512e13b6a72 (diff)
downloadweechat-2b05b64cc1370801a32fc8ffcbaadb7c80d296ba.zip
tests: fix pylint errors
Diffstat (limited to 'tests/scripts/python')
-rwxr-xr-xtests/scripts/python/testapigen.py6
-rwxr-xr-xtests/scripts/python/unparse.py22
2 files changed, 15 insertions, 13 deletions
diff --git a/tests/scripts/python/testapigen.py b/tests/scripts/python/testapigen.py
index 723add183..5797861b7 100755
--- a/tests/scripts/python/testapigen.py
+++ b/tests/scripts/python/testapigen.py
@@ -29,6 +29,8 @@ It uses the following scripts:
- testapi.py: the WeeChat scripting API tests
"""
+# pylint: disable=wrong-import-order,wrong-import-position
+
from __future__ import print_function
import argparse
import ast
@@ -46,7 +48,7 @@ sys.dont_write_bytecode = True
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
sys.path.append(SCRIPT_DIR)
-from unparse import ( # pylint: disable=wrong-import-position
+from unparse import (
UnparsePython,
UnparsePerl,
UnparseRuby,
@@ -170,7 +172,7 @@ class WeechatScript(object): # pylint: disable=too-many-instance-attributes
def write_footer(self, output):
"""Write footer (nothing by default)."""
- pass
+ pass # pylint: disable=unnecessary-pass
class WeechatPythonScript(WeechatScript):
diff --git a/tests/scripts/python/unparse.py b/tests/scripts/python/unparse.py
index 52dd9a4e0..da480fe1e 100755
--- a/tests/scripts/python/unparse.py
+++ b/tests/scripts/python/unparse.py
@@ -22,7 +22,7 @@ Unparse AST tree to generate scripts in all supported languages
(Python, Perl, Ruby, ...).
"""
-# pylint: disable=too-many-lines
+# pylint: disable=too-many-lines,unnecessary-pass
from __future__ import print_function
import argparse
@@ -228,7 +228,7 @@ class UnparsePython(object):
self.fill,
self.fill if self._indent_level == 0 else None,
'def %s(' % node.name,
- self.make_list([arg for arg in node.args.args]),
+ self.make_list(node.args.args),
'):',
self.indent,
node.body,
@@ -424,7 +424,7 @@ class UnparsePerl(UnparsePython):
self.fill,
'my (',
(self.prefix, '$'),
- self.make_list([arg for arg in node.args.args]),
+ self.make_list(node.args.args),
(self.prefix, None),
') = @_;',
)
@@ -525,7 +525,7 @@ class UnparseRuby(UnparsePython):
if node.args.args:
self.add(
'(',
- self.make_list([arg for arg in node.args.args]),
+ self.make_list(node.args.args),
')',
)
self.add(
@@ -621,7 +621,7 @@ class UnparseLua(UnparsePython):
)
self.add(
'(',
- self.make_list([arg for arg in node.args.args]),
+ self.make_list(node.args.args),
')',
self.indent,
node.body,
@@ -713,7 +713,7 @@ class UnparseTcl(UnparsePython):
node.func,
' ' if node.args else None,
(self.prefix, '$'),
- self.make_list([arg for arg in node.args], sep=' '),
+ self.make_list(node.args, sep=' '),
(self.prefix, None),
)
self._call -= 1
@@ -769,7 +769,7 @@ class UnparseTcl(UnparsePython):
self.fill,
self.fill,
'proc %s {' % node.name,
- (self.make_list([arg for arg in node.args.args], sep=' ')
+ (self.make_list(node.args.args, sep=' ')
if node.args.args else None),
'} {',
self.indent,
@@ -894,7 +894,7 @@ class UnparseGuile(UnparsePython):
'(',
node.func,
' ' if node.args else None,
- self.make_list([arg for arg in node.args], sep=' '),
+ self.make_list(node.args, sep=' '),
')',
)
self._call -= 1
@@ -942,7 +942,7 @@ class UnparseGuile(UnparsePython):
self.fill,
'(define (%s' % node.name,
' ' if node.args.args else None,
- (self.make_list([arg for arg in node.args.args], sep=' ')
+ (self.make_list(node.args.args, sep=' ')
if node.args.args else None),
')',
self.indent,
@@ -1036,7 +1036,7 @@ class UnparseJavascript(UnparsePython):
self.fill,
self.fill,
'function %s(' % node.name,
- self.make_list([arg for arg in node.args.args]),
+ self.make_list(node.args.args),
') {',
self.indent,
node.body,
@@ -1162,7 +1162,7 @@ class UnparsePhp(UnparsePython):
self.fill,
'function %s(' % node.name,
(self.prefix, '$'),
- self.make_list([arg for arg in node.args.args]),
+ self.make_list(node.args.args),
(self.prefix, None),
')',
self.fill,