Skip to content
This repository has been archived by the owner on Aug 4, 2022. It is now read-only.

Commit

Permalink
Bug 1587206 - [lint.flake8] Enable F632 across the tree, r=sylvestre
Browse files Browse the repository at this point in the history
This ensures we use ==/!= to strings and ints (instead of is/is not).

Differential Revision: https://phabricator.services.mozilla.com/D48609
  • Loading branch information
ahal committed Oct 10, 2019
1 parent e5d3247 commit 6ebda87
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion js/src/gdb/mozilla/unwind.py
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ def unwind_entry_frame_registers(self, sp, unwind_info):
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)


Expand Down
2 changes: 1 addition & 1 deletion js/src/tests/jstests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion python/mozrelease/mozrelease/versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def __cmp__(self, other):
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
Expand Down
2 changes: 1 addition & 1 deletion taskcluster/taskgraph/test/test_create.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def test_create_tasks(self):
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)
Expand Down
2 changes: 1 addition & 1 deletion testing/marionette/client/marionette_driver/gestures.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion testing/mozbase/mozinstall/mozinstall/mozinstall.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion testing/talos/talos/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def __call__(self):

# 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)
Expand Down
2 changes: 1 addition & 1 deletion tools/vcs/mach_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def import_pr(self, pull_request, bug_number=None, bugzilla_token=None, reviewer
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)
Expand Down
2 changes: 1 addition & 1 deletion xpcom/idl-parser/xpidl/xpidl.py
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,7 @@ def resolve(self, parent):
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'" %
Expand Down

0 comments on commit 6ebda87

Please sign in to comment.