Skip to content

Commit

Permalink
Upgrade pylint version (#549)
Browse files Browse the repository at this point in the history
* Upgrade pylint
* Fixing lint errors like removing a useless super call
* Merging bad-names lists and other modernization in pylintrc
  • Loading branch information
dbieber authored Sep 20, 2024
1 parent 9c9e8c6 commit f9293c9
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 26 deletions.
2 changes: 1 addition & 1 deletion .github/scripts/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
setuptools <=75.1.0
pip
pylint <2.15.10
pylint <3.2.8
pytest <=8.3.3
pytest-pylint <=1.1.2
pytest-runner <7.0.0
Expand Down
1 change: 1 addition & 0 deletions fire/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -872,6 +872,7 @@ def _ParseKeywordArgs(args, fn_spec):
key, value = stripped_argument.split('=', 1)
else:
key = stripped_argument
value = None # value will be set later on.

key = key.replace('-', '_')
is_bool_syntax = (not contains_equals and
Expand Down
3 changes: 1 addition & 2 deletions fire/test_components.py
Original file line number Diff line number Diff line change
Expand Up @@ -388,8 +388,7 @@ def example_generator(n):
[0, 1, 2, 3]
"""
for i in range(n):
yield i
yield from range(n)


def simple_set():
Expand Down
3 changes: 0 additions & 3 deletions fire/testutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,6 @@ def assertOutputMatches(self, stdout='.*', stderr='.*', capture=True):
raise AssertionError('%s: Expected %r to match %r' %
(name, value, regexp))

def assertRaisesRegex(self, *args, **kwargs): # pylint: disable=arguments-differ
return super(BaseTestCase, self).assertRaisesRegex(*args, **kwargs) # pylint: disable=no-member

@contextlib.contextmanager
def assertRaisesFireExit(self, code, regexp='.*'):
"""Asserts that a FireExit error is raised in the context.
Expand Down
22 changes: 2 additions & 20 deletions pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
# pygtk.require().
#init-hook=

# Profiled execution.
profile=no

# Add <file or directory> to the black list. It should be a base name, not a
# path. You may set this option multiple times.
ignore=
Expand Down Expand Up @@ -41,14 +38,6 @@ disable=design,similarities,no-self-use,attribute-defined-outside-init,locally-d
# (visual studio) and html
output-format=text

# Include message's id in output
include-ids=no

# Put messages in a separate file for each module / package specified on the
# command line instead of printing them on stdout. Reports (if any) will be
# written in a file name "pylint_global.[txt|html]".
files-output=no

# Tells whether to display a full report or only the messages
reports=yes

Expand All @@ -59,10 +48,6 @@ reports=yes
# (R0004).
evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10)

# Add a comment according to your evaluation note. This is used by the global
# evaluation report (R0004).
comment=no


[VARIABLES]

Expand All @@ -79,9 +64,6 @@ additional-builtins=

[BASIC]

# List of builtins function names that should not be used, separated by a comma
bad-functions=map,filter,apply,input,reduce

# Regular expression which should only match correct module names
module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$

Expand Down Expand Up @@ -114,7 +96,7 @@ inlinevar-rgx=^[a-z][a-z0-9_]*$
good-names=i,j,k,ex,main,Run,_

# Bad variable names which should always be refused, separated by a comma
bad-names=foo,bar,baz,toto,tutu,tata
bad-names=map,filter,apply,input,reduce,foo,bar,baz,toto,tutu,tata

# Regular expression which should only match functions or classes name which do
# not require a docstring
Expand Down Expand Up @@ -186,7 +168,7 @@ max-locals=15
max-returns=6

# Maximum number of branch for function / method body
max-branchs=12
max-branches=12

# Maximum number of statements in function / method body
max-statements=50
Expand Down

0 comments on commit f9293c9

Please sign in to comment.