tools: python: activate more flake8 rules · nodejs/node@a16a0fe (original) (raw)
5 files changed
lines changed
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
1 | 1 | [flake8] |
2 | 2 | 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 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -107,7 +107,7 @@ def parse(opt): | ||
107 | 107 | if not anOpt or anOpt == "": |
108 | 108 | # ignore stray commas, etc. |
109 | 109 | continue |
110 | -elif anOpt is 'all': | |
110 | +elif anOpt == 'all': | |
111 | 111 | # all on |
112 | 112 | theRet = dict((key, True) for (key) in download_types) |
113 | 113 | else: |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -110,7 +110,7 @@ | ||
110 | 110 | print("Unknown endianness: %s" % options.endian) |
111 | 111 | sys.exit(1) |
112 | 112 | |
113 | -if options.endian is "host": | |
113 | +if options.endian == "host": | |
114 | 114 | options.endian = endian |
115 | 115 | |
116 | 116 | if not os.path.isdir(options.tmpdir): |
@@ -153,7 +153,7 @@ def runcmd(tool, cmd, doContinue=False): | ||
153 | 153 | print("# " + cmd) |
154 | 154 | |
155 | 155 | rc = os.system(cmd) |
156 | -if rc is not 0 and not doContinue: | |
156 | +if rc != 0 and not doContinue: | |
157 | 157 | print("FAILED: %s" % cmd) |
158 | 158 | sys.exit(1) |
159 | 159 | return rc |
@@ -320,7 +320,7 @@ def removeList(count=0): | ||
320 | 320 | print(i, file=fi) |
321 | 321 | fi.close() |
322 | 322 | rc = runcmd("icupkg","-r %s %s 2> %s" % (removefile,outfile,hackerrfile),True) |
323 | -if rc is not 0: | |
323 | +if rc != 0: | |
324 | 324 | if(options.verbose>5): |
325 | 325 | print("## Damage control, trying to parse stderr from icupkg..") |
326 | 326 | fi = open(hackerrfile, 'rb') |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -149,7 +149,8 @@ def ReadMacros(lines): | ||
149 | 149 | hash = line.find('#') |
150 | 150 | if hash != -1: line = line[:hash] |
151 | 151 | line = line.strip() |
152 | -if len(line) is 0: continue | |
152 | +if len(line) == 0: | |
153 | +continue | |
153 | 154 | const_match = CONST_PATTERN.match(line) |
154 | 155 | if const_match: |
155 | 156 | name = const_match.group(1) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -355,7 +355,7 @@ def HasRun(self, output): | ||
355 | 355 | logger.info(' ---') |
356 | 356 | logger.info(' duration_ms: %d.%d' % |
357 | 357 | (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 != '': | |
359 | 359 | if output.HasTimedOut(): |
360 | 360 | self.traceback = 'timeout\n' + output.output.stdout + output.output.stderr |
361 | 361 | self._printDiagnostic() |
@@ -1641,7 +1641,7 @@ def Main(): | ||
1641 | 1641 | continue |
1642 | 1642 | archEngineContext = Execute([vm, "-p", "process.arch"], context) |
1643 | 1643 | vmArch = archEngineContext.stdout.rstrip() |
1644 | -if archEngineContext.exit_code is not 0 or vmArch == "undefined": | |
1644 | +if archEngineContext.exit_code != 0 or vmArch == "undefined": | |
1645 | 1645 | print("Can't determine the arch of: '%s'" % vm) |
1646 | 1646 | print(archEngineContext.stderr.rstrip()) |
1647 | 1647 | continue |