Bug 1587206 - [lint.flake8] Enable E117 across the tree, r=sylvestre
authorAndrew Halberstadt <ahalberstadt@mozilla.com>
Thu, 10 Oct 2019 18:51:45 +0000
changeset 497264 f3f4aa35d46eef4077f94447ee163b42f7670d9a
parent 497263 b4d2e6a7f790f58b6766686bc445332d53971052
child 497265 6f13ec193094a7c7507edd8df79fdb0e1c985c40
push id36681
push usercbrindusan@mozilla.com
push dateFri, 11 Oct 2019 21:50:12 +0000
treeherdermozilla-central@c5e6477c3a24 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssylvestre
bugs1587206
milestone71.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 1587206 - [lint.flake8] Enable E117 across the tree, r=sylvestre Prevents over-indentation. Depends on D48611 Differential Revision: https://phabricator.services.mozilla.com/D48612
.flake8
python/mozbuild/mozbuild/frontend/gyp_reader.py
taskcluster/taskgraph/target_tasks.py
testing/geckodriver/mach_commands.py
testing/mozharness/scripts/marionette.py
testing/raptor/test/test_raptor.py
--- a/.flake8
+++ b/.flake8
@@ -88,17 +88,17 @@ exclude =
     tools/crashreporter/*.configure,
     .ycm_extra_conf.py,
 
 # See:
 #   - http://flake8.pycqa.org/en/latest/user/error-codes.html
 #   - http://pep8.readthedocs.io/en/latest/intro.html#configuration
 ignore =
     # These should be triaged and either fixed or moved to the list below.
-    E117, W504, W605, W606,
+    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
     F723, E121, E123, E126, E129, E133, E226, E241, E242, E402, E704, E741, W503,
 
 per-file-ignores =
     # These paths are intentionally excluded.
     ipc/ipdl/*: F403, F405
--- a/python/mozbuild/mozbuild/frontend/gyp_reader.py
+++ b/python/mozbuild/mozbuild/frontend/gyp_reader.py
@@ -197,18 +197,18 @@ def process_gyp_result(gyp_result, gyp_d
                 l = os.path.basename(l)
                 if l not in use_libs:
                     use_libs.append(l)
 
         if spec['type'] == 'none':
             if not ('actions' in spec or 'copies' in spec):
                 continue
         elif spec['type'] in ('static_library', 'shared_library', 'executable'):
-                # Remove leading 'lib' from the target_name if any, and use as
-                # library name.
+            # Remove leading 'lib' from the target_name if any, and use as
+            # library name.
             name = spec['target_name']
             if spec['type'] in ('static_library', 'shared_library'):
                 if name.startswith('lib'):
                     name = name[3:]
                 # The context expects an unicode string.
                 context['LIBRARY_NAME'] = name.decode('utf-8')
             else:
                 context['PROGRAM'] = name.decode('utf-8')
--- a/taskcluster/taskgraph/target_tasks.py
+++ b/taskcluster/taskgraph/target_tasks.py
@@ -400,19 +400,19 @@ def target_tasks_ship_desktop(full_task_
         # Include promotion tasks; these will be optimized out
         if task.label in filtered_for_candidates:
             return True
         if task.attributes.get('shipping_product') != parameters['release_product'] or \
                 task.attributes.get('shipping_phase') != 'ship':
             return False
 
         if 'secondary' in task.kind:
-                return is_rc
+            return is_rc
         else:
-                return not is_rc
+            return not is_rc
 
     return [l for l, t in full_task_graph.tasks.iteritems() if filter(t)]
 
 
 @_target_task('promote_fennec')
 def target_tasks_promote_fennec(full_task_graph, parameters, graph_config):
     """Select the set of tasks required for a candidates build of fennec. The
     nightly build process involves a pipeline of builds, signing,
--- a/testing/geckodriver/mach_commands.py
+++ b/testing/geckodriver/mach_commands.py
@@ -37,22 +37,22 @@ class GeckoDriver(MachCommandBase):
     @CommandArgument("--debugger-args", default=None, metavar="params",
                      type=str, group="debugging",
                      help="Flags to pass to the debugger itself; "
                           "split as the Bourne shell would.")
     def run(self, binary, params, debug, debugger, debugger_args):
         try:
             binpath = self.get_binary_path("geckodriver")
         except Exception as e:
-                print("It looks like geckodriver isn't built. "
-                      "Add ac_add_options --enable-geckodriver to your "
-                      "mozconfig ",
-                      "and run |mach build| to build it.")
-                print(e)
-                return 1
+            print("It looks like geckodriver isn't built. "
+                  "Add ac_add_options --enable-geckodriver to your "
+                  "mozconfig ",
+                  "and run |mach build| to build it.")
+            print(e)
+            return 1
 
         args = [binpath]
 
         if params:
             args.extend(params)
 
         if binary is None:
             binary = self.get_binary_path("app")
--- a/testing/mozharness/scripts/marionette.py
+++ b/testing/mozharness/scripts/marionette.py
@@ -171,18 +171,18 @@ class MarionetteTest(TestingMixin, Mercu
         if c.get('structured_output'):
             self.parser_class = StructuredOutputParser
         else:
             self.parser_class = TestSummaryOutputParserHelper
 
     def _pre_config_lock(self, rw_config):
         super(MarionetteTest, self)._pre_config_lock(rw_config)
         if not self.config.get('emulator') and not self.config.get('marionette_address'):
-                self.fatal("You need to specify a --marionette-address for non-emulator tests! "
-                           "(Try --marionette-address localhost:2828 )")
+            self.fatal("You need to specify a --marionette-address for non-emulator tests! "
+                       "(Try --marionette-address localhost:2828 )")
 
     def _query_tests_dir(self):
         dirs = self.query_abs_dirs()
         test_dir = self.config["suite_definitions"][self.test_suite]["testsdir"]
 
         return os.path.join(dirs['abs_test_install_dir'], test_dir)
 
     def query_abs_dirs(self):
--- a/testing/raptor/test/test_raptor.py
+++ b/testing/raptor/test/test_raptor.py
@@ -15,28 +15,28 @@ from mozrunner.errors import RunnerNotSt
 
 # need this so raptor imports work both from /raptor and via mach
 here = os.path.abspath(os.path.dirname(__file__))
 
 from raptor.raptor import RaptorDesktopFirefox, RaptorDesktopChrome, RaptorAndroid
 
 
 class TestBrowserThread(threading.Thread):
-        def __init__(self, raptor_instance, tests, names):
-            super(TestBrowserThread, self).__init__()
-            self.raptor_instance = raptor_instance
-            self.tests = tests
-            self.names = names
-            self.exc = None
+    def __init__(self, raptor_instance, tests, names):
+        super(TestBrowserThread, self).__init__()
+        self.raptor_instance = raptor_instance
+        self.tests = tests
+        self.names = names
+        self.exc = None
 
-        def run(self):
-            try:
-                self.raptor_instance.run_tests(self.tests, self.names)
-            except BaseException:
-                self.exc = sys.exc_info()
+    def run(self):
+        try:
+            self.raptor_instance.run_tests(self.tests, self.names)
+        except BaseException:
+            self.exc = sys.exc_info()
 
 
 @pytest.mark.parametrize("raptor_class, app_name", [
                          [RaptorDesktopFirefox, "firefox"],
                          [RaptorDesktopChrome, "chrome"],
                          [RaptorDesktopChrome, "chromium"],
                          [RaptorAndroid, "fennec"],
                          [RaptorAndroid, "geckoview"],