зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1587206 - [lint.flake8] Enable F632 across the tree, r=sylvestre
This ensures we use ==/!= to strings and ints (instead of is/is not). Differential Revision: https://phabricator.services.mozilla.com/D48609 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
48a0396380
Коммит
2b0d90e3ad
2
.flake8
2
.flake8
|
@ -93,7 +93,7 @@ exclude =
|
||||||
# - http://pep8.readthedocs.io/en/latest/intro.html#configuration
|
# - http://pep8.readthedocs.io/en/latest/intro.html#configuration
|
||||||
ignore =
|
ignore =
|
||||||
# These should be triaged and either fixed or moved to the list below.
|
# These should be triaged and either fixed or moved to the list below.
|
||||||
F632, F633, F811, E117, W504, W605, W606,
|
F633, F811, E117, W504, W605, W606,
|
||||||
# These are intentionally disabled (not necessarily for good reason).
|
# These are intentionally disabled (not necessarily for good reason).
|
||||||
# F723: syntax error in type comment
|
# F723: syntax error in type comment
|
||||||
# text contains quotes which breaks our custom JSON formatter
|
# text contains quotes which breaks our custom JSON formatter
|
||||||
|
|
|
@ -498,7 +498,7 @@ class x64UnwinderState(UnwinderState):
|
||||||
data = sp.dereference()
|
data = sp.dereference()
|
||||||
sp = sp + 1
|
sp = sp + 1
|
||||||
unwind_info.add_saved_register(reg, data)
|
unwind_info.add_saved_register(reg, data)
|
||||||
if reg is "rbp":
|
if reg == "rbp":
|
||||||
unwind_info.add_saved_register(self.SP_REGISTER, sp)
|
unwind_info.add_saved_register(self.SP_REGISTER, sp)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -445,7 +445,7 @@ def load_tests(options, requested_paths, excluded_paths):
|
||||||
xul_info = manifest.XULInfo.create(options.js_shell)
|
xul_info = manifest.XULInfo.create(options.js_shell)
|
||||||
else:
|
else:
|
||||||
xul_abi, xul_os, xul_debug = options.xul_info_src.split(r':')
|
xul_abi, xul_os, xul_debug = options.xul_info_src.split(r':')
|
||||||
xul_debug = xul_debug.lower() is 'true'
|
xul_debug = xul_debug.lower() == 'true'
|
||||||
xul_info = manifest.XULInfo(xul_abi, xul_os, xul_debug)
|
xul_info = manifest.XULInfo(xul_abi, xul_os, xul_debug)
|
||||||
feature_args = shlex.split(options.feature_args)
|
feature_args = shlex.split(options.feature_args)
|
||||||
xul_tester = manifest.XULInfoTester(xul_info, options.js_shell, feature_args)
|
xul_tester = manifest.XULInfoTester(xul_info, options.js_shell, feature_args)
|
||||||
|
|
|
@ -31,7 +31,7 @@ class MozillaVersionCompareMixin():
|
||||||
has_esr.issuperset(set(['other', 'self'])):
|
has_esr.issuperset(set(['other', 'self'])):
|
||||||
# If both had esr string or neither, then cmp() was accurate
|
# If both had esr string or neither, then cmp() was accurate
|
||||||
return val
|
return val
|
||||||
elif val is not 0:
|
elif val != 0:
|
||||||
# cmp is accurate here even if esr is present in only 1 compare, since
|
# cmp is accurate here even if esr is present in only 1 compare, since
|
||||||
# versions are not equal
|
# versions are not equal
|
||||||
return val
|
return val
|
||||||
|
|
|
@ -55,7 +55,7 @@ class TestCreate(unittest.TestCase):
|
||||||
self.assertEqual(task['schedulerId'], 'domain-level-4')
|
self.assertEqual(task['schedulerId'], 'domain-level-4')
|
||||||
# make sure the dependencies exist, at least
|
# make sure the dependencies exist, at least
|
||||||
for depid in task.get('dependencies', []):
|
for depid in task.get('dependencies', []):
|
||||||
if depid is 'decisiontask':
|
if depid == 'decisiontask':
|
||||||
# Don't look for decisiontask here
|
# Don't look for decisiontask here
|
||||||
continue
|
continue
|
||||||
self.assertIn(depid, self.created_tasks)
|
self.assertIn(depid, self.created_tasks)
|
||||||
|
|
|
@ -25,7 +25,7 @@ def smooth_scroll(marionette_session, start_element, axis, direction,
|
||||||
wait_period = wait_period or 0.05
|
wait_period = wait_period or 0.05
|
||||||
scroll_back = scroll_back or False
|
scroll_back = scroll_back or False
|
||||||
current = 0
|
current = 0
|
||||||
if axis is "x":
|
if axis == "x":
|
||||||
if direction is -1:
|
if direction is -1:
|
||||||
offset = [-increments, 0]
|
offset = [-increments, 0]
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -224,7 +224,7 @@ def uninstall(install_folder):
|
||||||
try:
|
try:
|
||||||
cmdArgs = ['%s\\uninstall\helper.exe' % install_folder, '/S']
|
cmdArgs = ['%s\\uninstall\helper.exe' % install_folder, '/S']
|
||||||
result = subprocess.call(cmdArgs)
|
result = subprocess.call(cmdArgs)
|
||||||
if result is not 0:
|
if result != 0:
|
||||||
raise Exception('Execution of uninstaller failed.')
|
raise Exception('Execution of uninstaller failed.')
|
||||||
|
|
||||||
# The uninstaller spawns another process so the subprocess call
|
# The uninstaller spawns another process so the subprocess call
|
||||||
|
|
|
@ -157,7 +157,7 @@ class Output(object):
|
||||||
|
|
||||||
# responsiveness has it's own metric, not the mean
|
# responsiveness has it's own metric, not the mean
|
||||||
# TODO: consider doing this for all counters
|
# TODO: consider doing this for all counters
|
||||||
if 'responsiveness' is name:
|
if 'responsiveness' == name:
|
||||||
subtest = {
|
subtest = {
|
||||||
'name': name,
|
'name': name,
|
||||||
'value': filter.responsiveness_Metric(vals)
|
'value': filter.responsiveness_Metric(vals)
|
||||||
|
|
|
@ -105,7 +105,7 @@ class PullRequestImporter(MachCommandBase):
|
||||||
patch_cmd.stdin.write(patch['diff'])
|
patch_cmd.stdin.write(patch['diff'])
|
||||||
patch_cmd.stdin.close()
|
patch_cmd.stdin.close()
|
||||||
patch_cmd.wait()
|
patch_cmd.wait()
|
||||||
if patch_cmd.returncode is not 0:
|
if patch_cmd.returncode != 0:
|
||||||
self.log(logging.ERROR, 'commit_fail', {},
|
self.log(logging.ERROR, 'commit_fail', {},
|
||||||
'Error applying diff from commit via "patch -p1 -s". Aborting...')
|
'Error applying diff from commit via "patch -p1 -s". Aborting...')
|
||||||
sys.exit(patch_cmd.returncode)
|
sys.exit(patch_cmd.returncode)
|
||||||
|
|
|
@ -679,7 +679,7 @@ class Interface(object):
|
||||||
if self.attributes.function:
|
if self.attributes.function:
|
||||||
has_method = False
|
has_method = False
|
||||||
for member in self.members:
|
for member in self.members:
|
||||||
if member.kind is 'method':
|
if member.kind == 'method':
|
||||||
if has_method:
|
if has_method:
|
||||||
raise IDLError(
|
raise IDLError(
|
||||||
"interface '%s' has multiple methods, but marked 'function'" %
|
"interface '%s' has multiple methods, but marked 'function'" %
|
||||||
|
|
Загрузка…
Ссылка в новой задаче