Bug 1401309 - Add python/mozversioncontrol to flake8 linter, r=gps
authorAndrew Halberstadt <ahalberstadt@mozilla.com>
Wed, 20 Sep 2017 10:02:26 -0400
changeset 383482 f2cb38633e49f8bb1f1e8c05ce92b12a7223c2cd
parent 383481 442abdab3a1c24dcc61adb0252706a0c79a56062
child 383483 bb1af5a946f9dac8caae4998a6dbd67e7454f8f5
push id32594
push userkwierso@gmail.com
push dateThu, 28 Sep 2017 22:49:33 +0000
treeherdermozilla-central@6dea0ee45b66 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgps
bugs1401309
milestone58.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1401309 - Add python/mozversioncontrol to flake8 linter, r=gps MozReview-Commit-ID: KuyEYa3Mbgd
python/mozversioncontrol/mozversioncontrol/__init__.py
python/mozversioncontrol/mozversioncontrol/repoupdate.py
tools/lint/flake8.yml
--- 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