Skip to content

Commit 27190ff

Browse files
committed
remove # pylint: ...
1 parent 1812252 commit 27190ff

17 files changed

+58
-60
lines changed

fire/__main__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
# pylint: disable=invalid-name
15+
1616
"""Enables use of Python Fire as a "main" function (i.e. "python -m fire").
1717
1818
This allows using Fire with third-party libraries without modifying their code.
@@ -63,7 +63,7 @@ def import_from_file_path(path):
6363
if spec is None:
6464
raise OSError('Unable to load module from specified path.')
6565

66-
module = util.module_from_spec(spec) # pylint: disable=no-member
66+
module = util.module_from_spec(spec)
6767
spec.loader.exec_module(module)
6868

6969
return module, module_name

fire/completion_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def testCompletionBashScript(self):
2929
['halt'],
3030
['halt', '--now'],
3131
]
32-
script = completion._BashScript(name='command', commands=commands) # pylint: disable=protected-access
32+
script = completion._BashScript(name='command', commands=commands)
3333
self.assertIn('command', script)
3434
self.assertIn('halt', script)
3535

@@ -44,7 +44,7 @@ def testCompletionFishScript(self):
4444
['halt'],
4545
['halt', '--now'],
4646
]
47-
script = completion._FishScript(name='command', commands=commands) # pylint: disable=protected-access
47+
script = completion._FishScript(name='command', commands=commands)
4848
self.assertIn('command', script)
4949
self.assertIn('halt', script)
5050
self.assertIn('-l now', script)

fire/console/console_attr.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -649,15 +649,15 @@ def GetConsoleAttr(encoding=None, reset=False):
649649
Returns:
650650
The global ConsoleAttr state object.
651651
"""
652-
attr = ConsoleAttr._CONSOLE_ATTR_STATE # pylint: disable=protected-access
652+
attr = ConsoleAttr._CONSOLE_ATTR_STATE
653653
if not reset:
654654
if not attr:
655655
reset = True
656656
elif encoding and encoding != attr.GetEncoding():
657657
reset = True
658658
if reset:
659659
attr = ConsoleAttr(encoding=encoding)
660-
ConsoleAttr._CONSOLE_ATTR_STATE = attr # pylint: disable=protected-access
660+
ConsoleAttr._CONSOLE_ATTR_STATE = attr
661661
return attr
662662

663663

fire/console/console_attr_os.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,11 @@ def GetTermSize():
5454

5555
def _GetTermSizePosix():
5656
"""Returns the Posix terminal x and y dimensions."""
57-
# pylint: disable=g-import-not-at-top
57+
5858
import fcntl
59-
# pylint: disable=g-import-not-at-top
59+
6060
import struct
61-
# pylint: disable=g-import-not-at-top
61+
6262
import termios
6363

6464
def _GetXY(fd):
@@ -96,7 +96,7 @@ def _GetTermSizeWindows():
9696
"""Returns the Windows terminal x and y dimensions."""
9797
# pylint:disable=g-import-not-at-top
9898
import struct
99-
# pylint: disable=g-import-not-at-top
99+
100100
from ctypes import create_string_buffer
101101
# pylint:disable=g-import-not-at-top
102102
from ctypes import windll
@@ -124,7 +124,7 @@ def _GetTermSizeEnvironment():
124124

125125
def _GetTermSizeTput():
126126
"""Returns the terminal x and y dimensions from tput(1)."""
127-
import subprocess # pylint: disable=g-import-not-at-top
127+
import subprocess
128128
output = encoding.Decode(subprocess.check_output(['tput', 'cols'],
129129
stderr=subprocess.STDOUT))
130130
cols = int(output)
@@ -160,9 +160,9 @@ def GetRawKeyFunction():
160160

161161
def _GetRawKeyFunctionPosix():
162162
"""_GetRawKeyFunction helper using Posix APIs."""
163-
# pylint: disable=g-import-not-at-top
163+
164164
import tty
165-
# pylint: disable=g-import-not-at-top
165+
166166
import termios
167167

168168
def _GetRawKeyPosix():
@@ -223,7 +223,7 @@ def _GetKeyChar():
223223

224224
def _GetRawKeyFunctionWindows():
225225
"""_GetRawKeyFunction helper using Windows APIs."""
226-
# pylint: disable=g-import-not-at-top
226+
227227
import msvcrt
228228

229229
def _GetRawKeyWindows():

fire/console/platforms.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class Error(Exception):
3030
pass
3131

3232

33-
class InvalidEnumValue(Error): # pylint: disable=g-bad-exception-name
33+
class InvalidEnumValue(Error):
3434
"""Exception for when a string could not be parsed to a valid enum value."""
3535

3636
def __init__(self, given, enum_type, options):
@@ -53,7 +53,7 @@ class OperatingSystem(object):
5353
class _OS(object):
5454
"""A single operating system."""
5555

56-
# pylint: disable=redefined-builtin
56+
5757
def __init__(self, id, name, file_name):
5858
self.id = id
5959
self.name = name
@@ -169,7 +169,7 @@ class Architecture(object):
169169
class _ARCH(object):
170170
"""A single architecture."""
171171

172-
# pylint: disable=redefined-builtin
172+
173173
def __init__(self, id, name, file_name):
174174
self.id = id
175175
self.name = name

fire/core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ class FireError(Exception):
182182
"""
183183

184184

185-
class FireExit(SystemExit): # pylint: disable=g-bad-exception-name
185+
class FireExit(SystemExit):
186186
"""An exception raised by Fire to the client in the case of a FireError.
187187
188188
The trace of the Fire program is available on the `trace` property.

fire/core_test.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@
2525
class CoreTest(testutils.BaseTestCase):
2626

2727
def testOneLineResult(self):
28-
self.assertEqual(core._OneLineResult(1), '1') # pylint: disable=protected-access
29-
self.assertEqual(core._OneLineResult('hello'), 'hello') # pylint: disable=protected-access
30-
self.assertEqual(core._OneLineResult({}), '{}') # pylint: disable=protected-access
31-
self.assertEqual(core._OneLineResult({'x': 'y'}), '{"x": "y"}') # pylint: disable=protected-access
28+
self.assertEqual(core._OneLineResult(1), '1')
29+
self.assertEqual(core._OneLineResult('hello'), 'hello')
30+
self.assertEqual(core._OneLineResult({}), '{}')
31+
self.assertEqual(core._OneLineResult({'x': 'y'}), '{"x": "y"}')
3232

3333
def testOneLineResultCircularRef(self):
3434
circular_reference = tc.CircularReference()
35-
self.assertEqual(core._OneLineResult(circular_reference.create()), # pylint: disable=protected-access
35+
self.assertEqual(core._OneLineResult(circular_reference.create()),
3636
"{'y': {...}}")
3737

3838
@mock.patch('fire.interact.Embed')

fire/decorators_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ def example6(self, **kwargs):
8282
class WithVarArgs:
8383

8484
@decorators.SetParseFn(str)
85-
def example7(self, arg1, arg2=None, *varargs, **kwargs): # pylint: disable=keyword-arg-before-vararg
85+
def example7(self, arg1, arg2=None, *varargs, **kwargs):
8686
return arg1, arg2, varargs, kwargs
8787

8888

fire/docstrings_test.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@
1717
from fire import docstrings
1818
from fire import testutils
1919

20-
# pylint: disable=invalid-name
20+
2121
DocstringInfo = docstrings.DocstringInfo
2222
ArgInfo = docstrings.ArgInfo
2323
KwargInfo = docstrings.KwargInfo
24-
# pylint: enable=invalid-name
24+
2525

2626

2727
class DocstringsTest(testutils.BaseTestCase):
@@ -45,12 +45,12 @@ def test_one_line_simple_whitespace(self):
4545
self.assertEqual(expected_docstring_info, docstring_info)
4646

4747
def test_one_line_too_long(self):
48-
# pylint: disable=line-too-long
48+
4949
docstring = """A one line docstring that is both a little too verbose
5050
and a little too long so it keeps going well beyond a reasonable length
5151
for a one-liner.
5252
"""
53-
# pylint: enable=line-too-long
53+
5454
docstring_info = docstrings.parse(docstring)
5555
expected_docstring_info = DocstringInfo(
5656
summary='A one line docstring that is both a little too verbose and '
@@ -60,11 +60,11 @@ def test_one_line_too_long(self):
6060
self.assertEqual(expected_docstring_info, docstring_info)
6161

6262
def test_one_line_runs_over(self):
63-
# pylint: disable=line-too-long
63+
6464
docstring = """A one line docstring that is both a little too verbose
6565
and a little too long so it runs onto a second line.
6666
"""
67-
# pylint: enable=line-too-long
67+
6868
docstring_info = docstrings.parse(docstring)
6969
expected_docstring_info = DocstringInfo(
7070
summary='A one line docstring that is both a little too verbose and '
@@ -306,7 +306,7 @@ def test_strip_blank_lines(self):
306306
lines = [' ', ' foo ', ' ']
307307
expected_output = [' foo ']
308308

309-
self.assertEqual(expected_output, docstrings._strip_blank_lines(lines)) # pylint: disable=protected-access
309+
self.assertEqual(expected_output, docstrings._strip_blank_lines(lines))
310310

311311
def test_numpy_colon_in_description(self):
312312
docstring = """

fire/helptext.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ def _CreateFlagItem(flag, docstring_info, spec, required=False,
463463
Returns:
464464
A string to be used in constructing the help screen for the function.
465465
"""
466-
# pylint: disable=g-bad-todo
466+
467467
# TODO(MichaelCG8): Get type and default information from docstrings if it is
468468
# not available in FullArgSpec. This will require updating
469469
# fire.docstrings.parser().

0 commit comments

Comments
 (0)