Bug 1401309 - Add python/mozversioncontrol to flake8 linter, r?gps
MozReview-Commit-ID: KuyEYa3Mbgd
--- a/python/mozversioncontrol/mozversioncontrol/__init__.py
+++ b/python/mozversioncontrol/mozversioncontrol/__init__.py
@@ -28,17 +28,17 @@ def get_tool_path(tool):
# "hg.bat," and "hg" (a Python script). "which" will happily return the
# Python script, which will cause subprocess to choke. Explicitly favor
# the Windows version over the plain script.
try:
return which.which(tool + '.exe')
except which.WhichError:
try:
return which.which(tool)
- except which.WhichError as e:
+ except which.WhichError:
pass
raise MissingVCSTool('Unable to obtain %s path. Try running '
'|mach bootstrap| to ensure your environment is up to '
'date.' % tool)
class Repository(object):
--- a/python/mozversioncontrol/mozversioncontrol/repoupdate.py
+++ b/python/mozversioncontrol/mozversioncontrol/repoupdate.py
@@ -4,28 +4,29 @@
from __future__ import unicode_literals
import os
import subprocess
# The logic here is far from robust. Improvements are welcome.
+
def update_mercurial_repo(hg, repo, path, revision='default',
hostfingerprints=None, global_args=None):
"""Ensure a HG repository exists at a path and is up to date."""
hostfingerprints = hostfingerprints or {}
args = [hg]
if global_args:
args.extend(global_args)
for host, fingerprint in sorted(hostfingerprints.items()):
args.extend(['--config', 'hostfingerprints.%s=%s' % (host,
- fingerprint)])
+ fingerprint)])
if os.path.exists(path):
subprocess.check_call(args + ['pull', repo], cwd=path)
else:
subprocess.check_call(args + ['clone', repo, path])
subprocess.check_call([hg, 'update', '-r', revision], cwd=path)
--- a/tools/lint/flake8.yml
+++ b/tools/lint/flake8.yml
@@ -2,16 +2,17 @@
flake8:
description: Python linter
include:
- config/mozunit.py
- layout/tools/reftest
- python/mach
- python/mach_commands.py
- python/mozlint
+ - python/mozversioncontrol
- security/manager
- taskcluster
- testing/firefox-ui
- testing/mach_commands.py
- testing/marionette/client
- testing/marionette/harness
- testing/marionette/puppeteer
- testing/mozbase