Skip to content

Commit a16a0fe

Browse files
committed
tools: python: activate more flake8 rules
PR-URL: #25614 Reviewed-By: Sakthipriyan Vairamani <[email protected]>
1 parent 0befda6 commit a16a0fe

File tree

5 files changed

+9
-8
lines changed

5 files changed

+9
-8
lines changed

.flake8

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[flake8]
22
exclude=.git,deps,lib,src,tools/gyp,tools/inspector_protocol,tools/pip,tools/v8_gypfiles/broken
3-
select=E9,F82
3+
select=E9,F63,F72,F82

tools/configure.d/nodedownload.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ def parse(opt):
107107
if not anOpt or anOpt == "":
108108
# ignore stray commas, etc.
109109
continue
110-
elif anOpt is 'all':
110+
elif anOpt == 'all':
111111
# all on
112112
theRet = dict((key, True) for (key) in download_types)
113113
else:

tools/icu/icutrim.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@
110110
print("Unknown endianness: %s" % options.endian)
111111
sys.exit(1)
112112

113-
if options.endian is "host":
113+
if options.endian == "host":
114114
options.endian = endian
115115

116116
if not os.path.isdir(options.tmpdir):
@@ -153,7 +153,7 @@ def runcmd(tool, cmd, doContinue=False):
153153
print("# " + cmd)
154154

155155
rc = os.system(cmd)
156-
if rc is not 0 and not doContinue:
156+
if rc != 0 and not doContinue:
157157
print("FAILED: %s" % cmd)
158158
sys.exit(1)
159159
return rc
@@ -320,7 +320,7 @@ def removeList(count=0):
320320
print(i, file=fi)
321321
fi.close()
322322
rc = runcmd("icupkg","-r %s %s 2> %s" % (removefile,outfile,hackerrfile),True)
323-
if rc is not 0:
323+
if rc != 0:
324324
if(options.verbose>5):
325325
print("## Damage control, trying to parse stderr from icupkg..")
326326
fi = open(hackerrfile, 'rb')

tools/js2c.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,8 @@ def ReadMacros(lines):
149149
hash = line.find('#')
150150
if hash != -1: line = line[:hash]
151151
line = line.strip()
152-
if len(line) is 0: continue
152+
if len(line) == 0:
153+
continue
153154
const_match = CONST_PATTERN.match(line)
154155
if const_match:
155156
name = const_match.group(1)

tools/test.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ def HasRun(self, output):
355355
logger.info(' ---')
356356
logger.info(' duration_ms: %d.%d' %
357357
(total_seconds, duration.microseconds / 1000))
358-
if self.severity is not 'ok' or self.traceback is not '':
358+
if self.severity != 'ok' or self.traceback != '':
359359
if output.HasTimedOut():
360360
self.traceback = 'timeout\n' + output.output.stdout + output.output.stderr
361361
self._printDiagnostic()
@@ -1641,7 +1641,7 @@ def Main():
16411641
continue
16421642
archEngineContext = Execute([vm, "-p", "process.arch"], context)
16431643
vmArch = archEngineContext.stdout.rstrip()
1644-
if archEngineContext.exit_code is not 0 or vmArch == "undefined":
1644+
if archEngineContext.exit_code != 0 or vmArch == "undefined":
16451645
print("Can't determine the arch of: '%s'" % vm)
16461646
print(archEngineContext.stderr.rstrip())
16471647
continue

0 commit comments

Comments
 (0)