mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-27 23:02:20 +00:00
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:
parent
48a0396380
commit
2b0d90e3ad
2
.flake8
2
.flake8
@ -93,7 +93,7 @@ exclude =
|
||||
# - http://pep8.readthedocs.io/en/latest/intro.html#configuration
|
||||
ignore =
|
||||
# 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).
|
||||
# F723: syntax error in type comment
|
||||
# text contains quotes which breaks our custom JSON formatter
|
||||
|
@ -498,7 +498,7 @@ class x64UnwinderState(UnwinderState):
|
||||
data = sp.dereference()
|
||||
sp = sp + 1
|
||||
unwind_info.add_saved_register(reg, data)
|
||||
if reg is "rbp":
|
||||
if reg == "rbp":
|
||||
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)
|
||||
else:
|
||||
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)
|
||||
feature_args = shlex.split(options.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'])):
|
||||
# If both had esr string or neither, then cmp() was accurate
|
||||
return val
|
||||
elif val is not 0:
|
||||
elif val != 0:
|
||||
# cmp is accurate here even if esr is present in only 1 compare, since
|
||||
# versions are not equal
|
||||
return val
|
||||
|
@ -55,7 +55,7 @@ class TestCreate(unittest.TestCase):
|
||||
self.assertEqual(task['schedulerId'], 'domain-level-4')
|
||||
# make sure the dependencies exist, at least
|
||||
for depid in task.get('dependencies', []):
|
||||
if depid is 'decisiontask':
|
||||
if depid == 'decisiontask':
|
||||
# Don't look for decisiontask here
|
||||
continue
|
||||
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
|
||||
scroll_back = scroll_back or False
|
||||
current = 0
|
||||
if axis is "x":
|
||||
if axis == "x":
|
||||
if direction is -1:
|
||||
offset = [-increments, 0]
|
||||
else:
|
||||
|
@ -224,7 +224,7 @@ def uninstall(install_folder):
|
||||
try:
|
||||
cmdArgs = ['%s\\uninstall\helper.exe' % install_folder, '/S']
|
||||
result = subprocess.call(cmdArgs)
|
||||
if result is not 0:
|
||||
if result != 0:
|
||||
raise Exception('Execution of uninstaller failed.')
|
||||
|
||||
# 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
|
||||
# TODO: consider doing this for all counters
|
||||
if 'responsiveness' is name:
|
||||
if 'responsiveness' == name:
|
||||
subtest = {
|
||||
'name': name,
|
||||
'value': filter.responsiveness_Metric(vals)
|
||||
|
@ -105,7 +105,7 @@ class PullRequestImporter(MachCommandBase):
|
||||
patch_cmd.stdin.write(patch['diff'])
|
||||
patch_cmd.stdin.close()
|
||||
patch_cmd.wait()
|
||||
if patch_cmd.returncode is not 0:
|
||||
if patch_cmd.returncode != 0:
|
||||
self.log(logging.ERROR, 'commit_fail', {},
|
||||
'Error applying diff from commit via "patch -p1 -s". Aborting...')
|
||||
sys.exit(patch_cmd.returncode)
|
||||
|
@ -679,7 +679,7 @@ class Interface(object):
|
||||
if self.attributes.function:
|
||||
has_method = False
|
||||
for member in self.members:
|
||||
if member.kind is 'method':
|
||||
if member.kind == 'method':
|
||||
if has_method:
|
||||
raise IDLError(
|
||||
"interface '%s' has multiple methods, but marked 'function'" %
|
||||
|
Loading…
Reference in New Issue
Block a user