Bug 1661514 - Reformat some python files with black 20.8b1 r=rstewart
☠☠ backed out by b901ea009ee8 ☠ ☠
authorSylvestre Ledru <sledru@mozilla.com>
Mon, 31 Aug 2020 17:06:22 +0000
changeset 547288 8e58c88f756b6dda6a061ca28929dc828a7cf425
parent 547287 0911c872a1f6f88eb4ee7d90d239fc7e363ef3ca
child 547289 b901ea009ee807d260e8404c6bf867a19d08b825
push id37748
push userapavel@mozilla.com
push dateWed, 02 Sep 2020 03:31:14 +0000
treeherdermozilla-central@00a15ff99b87 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrstewart
bugs1661514
milestone82.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 1661514 - Reformat some python files with black 20.8b1 r=rstewart # ignore-this-changeset Depends on D88711 Differential Revision: https://phabricator.services.mozilla.com/D88712
python/mozperftest/mozperftest/mach_commands.py
python/mozperftest/mozperftest/metrics/consoleoutput.py
python/mozperftest/mozperftest/metrics/notebook/constant.py
python/mozperftest/mozperftest/metrics/notebook/transformer.py
python/mozperftest/mozperftest/metrics/notebook/transforms/single_json.py
python/mozperftest/mozperftest/metrics/perfherder.py
python/mozperftest/mozperftest/metrics/visualmetrics.py
python/mozperftest/mozperftest/runner.py
python/mozperftest/mozperftest/system/__init__.py
python/mozperftest/mozperftest/system/android.py
python/mozperftest/mozperftest/system/android_perf_tuner.py
python/mozperftest/mozperftest/system/macos.py
python/mozperftest/mozperftest/system/proxy.py
python/mozperftest/mozperftest/test/androidlog.py
python/mozperftest/mozperftest/test/browsertime/runner.py
python/mozperftest/mozperftest/test/noderunner.py
python/mozperftest/mozperftest/test/xpcshell.py
python/mozperftest/mozperftest/tests/test_browsertime.py
python/mozperftest/mozperftest/utils.py
python/mozrelease/mozrelease/scriptworker_canary.py
taskcluster/taskgraph/test/conftest.py
taskcluster/test/conftest.py
testing/condprofile/condprof/check_install.py
testing/condprofile/condprof/client.py
testing/condprofile/condprof/helpers.py
testing/condprofile/condprof/metadata.py
testing/condprofile/condprof/runner.py
tools/lint/python/black.py
tools/lint/rust/__init__.py
tools/moztreedocs/mach_commands.py
tools/moztreedocs/upload.py
--- a/python/mozperftest/mozperftest/mach_commands.py
+++ b/python/mozperftest/mozperftest/mach_commands.py
@@ -101,30 +101,36 @@ class PerftestTests(MachCommandBase):
         except subprocess.CalledProcessError as e:
             for line in e.output.split(b"\n"):
                 sys.stdout.write(line.decode("utf8") + "\n")
             sys.stdout.write("[FAILED]\n")
             sys.stdout.flush()
             return False
 
     @Command(
-        "perftest-test", category="testing", description="Run perftest tests",
+        "perftest-test",
+        category="testing",
+        description="Run perftest tests",
     )
     @CommandArgument(
         "tests", default=None, nargs="*", help="Tests to run. By default will run all"
     )
     @CommandArgument(
         "-s",
         "--skip-linters",
         action="store_true",
         default=False,
         help="Skip flake8 and black",
     )
     @CommandArgument(
-        "-v", "--verbose", action="store_true", default=False, help="Verbose mode",
+        "-v",
+        "--verbose",
+        action="store_true",
+        default=False,
+        help="Verbose mode",
     )
     def run_tests(self, **kwargs):
         MachCommandBase.activate_virtualenv(self)
 
         from pathlib import Path
         from mozperftest.utils import temporary_env
 
         with temporary_env(
--- a/python/mozperftest/mozperftest/metrics/consoleoutput.py
+++ b/python/mozperftest/mozperftest/metrics/consoleoutput.py
@@ -12,18 +12,17 @@ RESULTS_TEMPLATE = """\
 ==========================================================
 
 {}
 
 """
 
 
 class ConsoleOutput(Layer):
-    """Output metrics in the console.
-    """
+    """Output metrics in the console."""
 
     name = "console"
     activated = False
     arguments = COMMON_ARGS
 
     def run(self, metadata):
         # Get filtered metrics
         results = filtered_metrics(
--- a/python/mozperftest/mozperftest/metrics/notebook/constant.py
+++ b/python/mozperftest/mozperftest/metrics/notebook/constant.py
@@ -4,18 +4,17 @@
 import os
 import pathlib
 from types import MappingProxyType
 
 from .transformer import get_transformers
 
 
 class Constant(object):
-    """A singleton class to store all constants.
-    """
+    """A singleton class to store all constants."""
 
     __instance = None
 
     def __new__(cls, *args, **kw):
         if cls.__instance is None:
             cls.__instance = object.__new__(cls, *args, **kw)
         return cls.__instance
 
--- a/python/mozperftest/mozperftest/metrics/notebook/transformer.py
+++ b/python/mozperftest/mozperftest/metrics/notebook/transformer.py
@@ -12,18 +12,17 @@ from mozperftest.metrics.exceptions impo
     NotebookInvalidTransformError,
     NotebookInvalidPathError,
     NotebookDuplicateTransformsError,
 )
 from mozperftest.runner import HERE
 
 
 class Transformer(object):
-    """Abstract class for data transformers.
-    """
+    """Abstract class for data transformers."""
 
     def __init__(self, files=None, custom_transformer=None, logger=None, prefix=None):
         """Initialize the transformer with files.
 
         :param list files: A list of files containing data to transform.
         :param object custom_transformer: A custom transformer instance.
             Must implement `transform` and `merge` methods.
         """
@@ -127,18 +126,17 @@ class Transformer(object):
             for e in merged:
                 e["name"] = name
 
         validate(instance=merged, schema=self.schema)
         return merged
 
 
 class SimplePerfherderTransformer:
-    """Transforms perfherder data into the standardized data format.
-    """
+    """Transforms perfherder data into the standardized data format."""
 
     entry_number = 0
 
     def transform(self, data):
         self.entry_number += 1
         return {
             "data": [{"value": data["suites"][0]["value"], "xaxis": self.entry_number}]
         }
--- a/python/mozperftest/mozperftest/metrics/notebook/transforms/single_json.py
+++ b/python/mozperftest/mozperftest/metrics/notebook/transforms/single_json.py
@@ -1,17 +1,16 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 from mozperftest.metrics.notebook.utilities import flat
 
 
 class SingleJsonRetriever:
-    """Transforms perfherder data into the standardized data format.
-    """
+    """Transforms perfherder data into the standardized data format."""
 
     entry_number = 0
 
     def transform(self, data):
         self.entry_number += 1
 
         # flat(data, ()) returns a dict that have one key per dictionary path
         # in the original data.
--- a/python/mozperftest/mozperftest/metrics/perfherder.py
+++ b/python/mozperftest/mozperftest/metrics/perfherder.py
@@ -15,18 +15,17 @@ from mozperftest.metrics.utils import wr
 
 
 PERFHERDER_SCHEMA = pathlib.Path(
     "testing", "mozharness", "external_tools", "performance-artifact-schema.json"
 )
 
 
 class Perfherder(Layer):
-    """Output data in the perfherder format.
-    """
+    """Output data in the perfherder format."""
 
     name = "perfherder"
     activated = False
 
     arguments = COMMON_ARGS
     arguments.update(
         {
             "app": {
--- a/python/mozperftest/mozperftest/metrics/visualmetrics.py
+++ b/python/mozperftest/mozperftest/metrics/visualmetrics.py
@@ -35,18 +35,17 @@ class VisualData:
 
     def transform(self, data):
         return data
 
     merge = transform
 
 
 class VisualMetrics(Layer):
-    """Wrapper around Browsertime's visualmetrics.py script
-    """
+    """Wrapper around Browsertime's visualmetrics.py script"""
 
     name = "visualmetrics"
     activated = False
     arguments = {}
 
     def setup(self):
         self.metrics = []
         self.metrics_fields = []
--- a/python/mozperftest/mozperftest/runner.py
+++ b/python/mozperftest/mozperftest/runner.py
@@ -150,18 +150,17 @@ def run_tests(mach_cmd, **kwargs):
             finally:
                 if tmp_dir is not None:
                     shutil.rmtree(tmp_dir)
     finally:
         hooks.cleanup()
 
 
 def main(argv=sys.argv[1:]):
-    """Used when the runner is directly called from the shell
-    """
+    """Used when the runner is directly called from the shell"""
     _setup_path()
 
     from mozbuild.mozconfig import MozconfigLoader
     from mozbuild.base import MachCommandBase, MozbuildObject
     from mozperftest import PerftestArgumentParser
     from mozboot.util import get_state_dir
     from mach.logging import LoggingManager
 
--- a/python/mozperftest/mozperftest/system/__init__.py
+++ b/python/mozperftest/mozperftest/system/__init__.py
@@ -9,12 +9,20 @@ from mozperftest.system.macos import Mac
 
 
 def get_layers():
     return Profile, ProxyRunner, AndroidDevice, MacosDevice
 
 
 def pick_system(env, flavor, mach_cmd):
     if flavor in ("desktop-browser", "xpcshell"):
-        return Layers(env, mach_cmd, (MacosDevice, Profile, ProxyRunner,))
+        return Layers(
+            env,
+            mach_cmd,
+            (
+                MacosDevice,
+                Profile,
+                ProxyRunner,
+            ),
+        )
     if flavor == "mobile-browser":
         return Layers(env, mach_cmd, (Profile, ProxyRunner, AndroidDevice))
     raise NotImplementedError(flavor)
--- a/python/mozperftest/mozperftest/system/android.py
+++ b/python/mozperftest/mozperftest/system/android.py
@@ -53,18 +53,17 @@ class ADBLoggedDevice(ADBDevice):
         self._provided_logger = kw.pop("logger")
         super(ADBLoggedDevice, self).__init__(*args, **kw)
 
     def _get_logger(self, logger_name, verbose):
         return self._provided_logger
 
 
 class AndroidDevice(Layer):
-    """Use an android device via ADB
-    """
+    """Use an android device via ADB"""
 
     name = "android"
     activated = False
 
     arguments = {
         "app-name": {
             "type": str,
             "default": "org.mozilla.firefox",
--- a/python/mozperftest/mozperftest/system/android_perf_tuner.py
+++ b/python/mozperftest/mozperftest/system/android_perf_tuner.py
@@ -34,17 +34,18 @@ class PerformanceTuner:
             self.set_gpu_performance_parameters(device_name)
             self.set_kernel_performance_parameters()
         self.device.clear_logcat(timeout=self.timeout)
         self.log.info("android device performance tuning complete")
 
     def _set_value_and_check_exitcode(self, file_name, value):
         self.log.info("setting {} to {}".format(file_name, value))
         if self.device.shell_bool(
-            " ".join(["echo", str(value), ">", str(file_name)]), timeout=self.timeout,
+            " ".join(["echo", str(value), ">", str(file_name)]),
+            timeout=self.timeout,
         ):
             self.log.info("successfully set {} to {}".format(file_name, value))
         else:
             self.log.warning("command failed")
 
     def set_svc_power_stayon(self):
         self.log.info("set device to stay awake on usb")
         self.device.shell_bool("svc power stayon usb", timeout=self.timeout)
--- a/python/mozperftest/mozperftest/system/macos.py
+++ b/python/mozperftest/mozperftest/system/macos.py
@@ -16,18 +16,17 @@ from mozperftest.layers import Layer
 # the option.
 POTENTIAL_DMGS = {
     "browsertime-binary": "Contents/MacOS/firefox",
     "xpcshell-xre-path": "Contents/MacOS",
 }
 
 
 class MacosDevice(Layer):
-    """Runs on macOS to mount DMGs if we see one.
-    """
+    """Runs on macOS to mount DMGs if we see one."""
 
     name = "macos"
     activated = platform.system() == "Darwin"
 
     def __init__(self, env, mach_cmd):
         super(MacosDevice, self).__init__(env, mach_cmd)
         self._tmp_dirs = []
 
--- a/python/mozperftest/mozperftest/system/proxy.py
+++ b/python/mozperftest/mozperftest/system/proxy.py
@@ -53,18 +53,17 @@ class OutputHandler(object):
         LOG.process_output(self.proc.pid, line)
 
     def wait_for_port(self):
         self.port_event.wait()
         return self.port
 
 
 class ProxyRunner(Layer):
-    """Use a proxy
-    """
+    """Use a proxy"""
 
     name = "proxy"
     activated = False
 
     arguments = {
         "record": {
             "type": str,
             "default": None,
--- a/python/mozperftest/mozperftest/test/androidlog.py
+++ b/python/mozperftest/mozperftest/test/androidlog.py
@@ -1,18 +1,17 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 from pathlib import Path
 from mozperftest.layers import Layer
 
 
 class AndroidLog(Layer):
-    """Runs an android log test.
-    """
+    """Runs an android log test."""
 
     name = "androidlog"
     activated = False
     arguments = {
         "first-timestamp": {
             "type": str,
             "default": None,
             "help": "First timestamp regexp",
--- a/python/mozperftest/mozperftest/test/browsertime/runner.py
+++ b/python/mozperftest/mozperftest/test/browsertime/runner.py
@@ -42,18 +42,17 @@ def extract_browser_name(args):
     return res[0][-1]
 
 
 class NodeException(Exception):
     pass
 
 
 class BrowsertimeRunner(NodeRunner):
-    """Runs a browsertime test.
-    """
+    """Runs a browsertime test."""
 
     name = "browsertime"
     activated = True
     user_exception = True
 
     arguments = {
         "cycles": {"type": int, "default": 1, "help": "Number of full cycles"},
         "iterations": {"type": int, "default": 1, "help": "Number of iterations"},
@@ -129,18 +128,17 @@ class BrowsertimeRunner(NodeRunner):
         path = Path(
             root, "node_modules", "browsertime", "browsertime", "visualmetrics.py"
         )
         if path.exists():
             os.environ["VISUALMETRICS_PY"] = str(path)
         return path
 
     def setup(self):
-        """Install browsertime and visualmetrics.py prerequisites and the Node.js package.
-        """
+        """Install browsertime and visualmetrics.py prerequisites and the Node.js package."""
         node = self.get_arg("node")
         if node is not None:
             os.environ["NODEJS"] = node
 
         super(BrowsertimeRunner, self).setup()
         install_url = self.get_arg("install-url")
 
         tests = self.get_arg("tests", [])
--- a/python/mozperftest/mozperftest/test/noderunner.py
+++ b/python/mozperftest/mozperftest/test/noderunner.py
@@ -19,18 +19,17 @@ class NodeRunner(Layer):
         self._mach_context = mach_cmd._mach_context
         self.python_path = mach_cmd.virtualenv_manager.python_path
 
         from mozbuild.nodeutil import find_node_executable
 
         self.node_path = os.path.abspath(find_node_executable()[0])
 
     def setup(self):
-        """Install the Node.js package.
-        """
+        """Install the Node.js package."""
         self.mach_cmd.activate_virtualenv()
         self.verify_node_install()
 
     def node(self, args):
         """Invoke node (interactively) with the given arguments."""
         return self.run_process(
             [self.node_path] + args,
             append_env=self.append_env(),
--- a/python/mozperftest/mozperftest/test/xpcshell.py
+++ b/python/mozperftest/mozperftest/test/xpcshell.py
@@ -27,18 +27,17 @@ class XPCShellData:
 
     def transform(self, data):
         return data
 
     merge = transform
 
 
 class XPCShell(Layer):
-    """Runs an xpcshell test.
-    """
+    """Runs an xpcshell test."""
 
     name = "xpcshell"
     activated = True
 
     arguments = {
         "cycles": {"type": int, "default": 13, "help": "Number of full cycles"},
         "binary": {
             "type": str,
--- a/python/mozperftest/mozperftest/tests/test_browsertime.py
+++ b/python/mozperftest/mozperftest/tests/test_browsertime.py
@@ -104,17 +104,18 @@ def test_browser_failed(*mocked):
 )
 @mock.patch("mozbuild.artifact_cache.ArtifactCache.fetch", new=fetch)
 @mock.patch(
     "mozperftest.test.browsertime.runner.BrowsertimeRunner._setup_node_packages",
     new=lambda x, y: None,
 )
 def test_browser_desktop(*mocked):
     mach_cmd, metadata, env = get_running_env(
-        browsertime_iterations=1, browsertime_extra_options="one=1,two=2",
+        browsertime_iterations=1,
+        browsertime_extra_options="one=1,two=2",
     )
     browser = env.layers[TEST]
     env.set_arg("tests", [EXAMPLE_TEST])
     sys = env.layers[SYSTEM]
 
     try:
         with sys as s, browser as b, silence():
             # just checking that the setup_helper property gets
--- a/python/mozperftest/mozperftest/utils.py
+++ b/python/mozperftest/mozperftest/utils.py
@@ -85,18 +85,17 @@ def host_platform():
             return "linux64"
     elif sys.platform.startswith("darwin"):
         return "darwin"
 
     raise ValueError("sys.platform is not yet supported: {}".format(sys.platform))
 
 
 class MachLogger:
-    """Wrapper around the mach logger to make logging simpler.
-    """
+    """Wrapper around the mach logger to make logging simpler."""
 
     def __init__(self, mach_cmd):
         self._logger = mach_cmd.log
 
     @property
     def log(self):
         return self._logger
 
@@ -237,18 +236,17 @@ def convert_day(day):
         # verify that the user provided string is in the expected format
         # if it can't parse it, it'll raise a value error
         datetime.strptime(day, "%Y.%m.%d")
 
     return day
 
 
 def get_revision_namespace_url(route, day="yesterday"):
-    """Builds a URL to obtain all the namespaces of a given build route for a single day.
-    """
+    """Builds a URL to obtain all the namespaces of a given build route for a single day."""
     day = convert_day(day)
     return f"""{MULTI_REVISION_ROOT}/{route}.{day}.revision"""
 
 
 def get_multi_tasks_url(route, revision, day="yesterday"):
     """Builds a URL to obtain all the tasks of a given build route for a single day.
 
     If previous is true, then we get builds from the previous day,
--- a/python/mozrelease/mozrelease/scriptworker_canary.py
+++ b/python/mozrelease/mozrelease/scriptworker_canary.py
@@ -107,10 +107,11 @@ def push_canary(scriptworkers, addresses
                 "notify.email.{}.on-exception".format(address),
             ]
         )
 
     with configure_ssh(ssh_key_secret):
         env = os.environ.copy()
         for task in tasks:
             subprocess.check_call(
-                base_command + [task], env=env,
+                base_command + [task],
+                env=env,
             )
--- a/taskcluster/taskgraph/test/conftest.py
+++ b/taskcluster/taskgraph/test/conftest.py
@@ -16,17 +16,18 @@ def responses():
 
 
 @pytest.fixture(scope="session", autouse=True)
 def patch_prefherder(request):
     from _pytest.monkeypatch import MonkeyPatch
 
     m = MonkeyPatch()
     m.setattr(
-        "taskgraph.util.bugbug._write_perfherder_data", lambda lower_is_better: None,
+        "taskgraph.util.bugbug._write_perfherder_data",
+        lambda lower_is_better: None,
     )
     yield
     m.undo()
 
 
 @pytest.fixture(scope="session", autouse=True)
 def enable_logging():
     """Ensure logs from taskgraph are displayed when a test fails."""
--- a/taskcluster/test/conftest.py
+++ b/taskcluster/test/conftest.py
@@ -63,17 +63,20 @@ def create_tgg(responses, datadir):
             push_id_start=int(tgg.parameters["pushlog_id"]) - 2,
             push_id_end=int(tgg.parameters["pushlog_id"]) - 1,
         )
         mock_requests[url] = "pushes.json"
 
         for url, filename in mock_requests.items():
             with open(os.path.join(datadir, filename)) as fh:
                 responses.add(
-                    responses.GET, url, json=json.load(fh), status=200,
+                    responses.GET,
+                    url,
+                    json=json.load(fh),
+                    status=200,
                 )
 
         # Still allow other real requests.
         responses.add_passthru("https://hg.mozilla.org")
         responses.add_passthru("https://firefox-ci-tc.services.mozilla.com")
         return tgg
 
     return inner
--- a/testing/condprofile/condprof/check_install.py
+++ b/testing/condprofile/condprof/check_install.py
@@ -11,18 +11,17 @@ import os
 import subprocess
 
 
 PY3 = sys.version_info.major == 3
 TOPDIR = os.path.join(os.path.dirname(__file__), "..")
 
 
 def install_reqs():
-    """ We install requirements one by one, with no cache, and in isolated mode.
-    """
+    """We install requirements one by one, with no cache, and in isolated mode."""
     try:
         import yaml  # NOQA
 
         return False
     except Exception:
         # we're detecting here that this is running in Taskcluster
         # by checking for the presence of the mozfile directory
         # that was decompressed from target.condprof.tests.tar.gz
@@ -58,16 +57,16 @@ def install_reqs():
                             req,
                         ]
                     )
 
         return True
 
 
 def check():
-    """ Called by the runner.
+    """Called by the runner.
 
     The check function will restart the app after
     all deps have been installed.
     """
     if install_reqs():
         os.execl(sys.executable, sys.executable, *sys.argv)
         os._exit(0)
--- a/testing/condprofile/condprof/client.py
+++ b/testing/condprofile/condprof/client.py
@@ -50,33 +50,31 @@ class ProfileNotFoundError(Exception):
     pass
 
 
 class RetriesError(Exception):
     pass
 
 
 def _check_service(url):
-    """Sanity check to see if we can reach the service root url.
-    """
+    """Sanity check to see if we can reach the service root url."""
 
     def _check():
         exists, _ = check_exists(url, all_types=True)
         if not exists:
             raise ServiceUnreachableError(url)
 
     try:
         return _retries(_check)
     except RetriesError:
         raise ServiceUnreachableError(url)
 
 
 def _check_profile(profile_dir):
-    """Checks for prefs we need to remove or set.
-    """
+    """Checks for prefs we need to remove or set."""
     to_remove = ("gfx.blacklist.", "marionette.")
 
     def _keep_pref(name, value):
         for item in to_remove:
             if not name.startswith(item):
                 continue
             logger.info("Removing pref %s: %s" % (name, value))
             return False
--- a/testing/condprofile/condprof/helpers.py
+++ b/testing/condprofile/condprof/helpers.py
@@ -8,18 +8,17 @@ from condprof.util import logger
 _SUPPORTED_MOBILE_BROWSERS = "fenix", "gecko", "firefox"
 
 
 def is_mobile(platform):
     return any(mobile in platform for mobile in _SUPPORTED_MOBILE_BROWSERS)
 
 
 class TabSwitcher:
-    """ Helper used to create tabs and circulate in them.
-    """
+    """Helper used to create tabs and circulate in them."""
 
     def __init__(self, session, options):
         self.handles = None
         self.current = 0
         self.session = session
         self._max = options.get("max_urls", 10)
         self.platform = options.get("platform", "")
         self.num_tabs = self._max >= 100 and 100 or self._max
--- a/testing/condprofile/condprof/metadata.py
+++ b/testing/condprofile/condprof/metadata.py
@@ -10,18 +10,17 @@ import json
 
 from condprof.util import logger
 
 
 METADATA_NAME = "condprofile.json"
 
 
 class Metadata(MutableMapping):
-    """ dict-like class that holds metadata for a profile.
-    """
+    """dict-like class that holds metadata for a profile."""
 
     def __init__(self, profile_dir):
         self.metadata_file = os.path.join(profile_dir, METADATA_NAME)
         logger.info("Reading existing metadata at %s" % self.metadata_file)
         if not os.path.exists(self.metadata_file):
             logger.info("Could not find the metadata file in that profile")
             self._data = {}
         else:
--- a/testing/condprofile/condprof/runner.py
+++ b/testing/condprofile/condprof/runner.py
@@ -125,18 +125,17 @@ class Runner:
         Create an instance of the environment and run the ProfileCreator.
         """
         env = self._create_env()
         return await ProfileCreator(
             scenario, customization, self.archive, self.changelog, self.force_new, env
         ).run(not self.visible)
 
     async def run_all(self):
-        """Runs the conditioned profile builders
-        """
+        """Runs the conditioned profile builders"""
         if self.scenario != "all":
             selected_scenario = [self.scenario]
         else:
             selected_scenario = scenarii.keys()
 
         # this is the loop that generates all combinations of profile
         # for the current platform when "all" is selected
         res = []
--- a/tools/lint/python/black.py
+++ b/tools/lint/python/black.py
@@ -36,17 +36,19 @@ else:
 
 
 def get_black_version(binary):
     """
     Returns found binary's version
     """
     try:
         output = subprocess.check_output(
-            [binary, "--version"], stderr=subprocess.STDOUT, universal_newlines=True,
+            [binary, "--version"],
+            stderr=subprocess.STDOUT,
+            universal_newlines=True,
         )
     except subprocess.CalledProcessError as e:
         output = e.output
 
     return re.match(r"black, version (.*)$", output)[1]
 
 
 def parse_issues(config, output, paths, *, log):
--- a/tools/lint/rust/__init__.py
+++ b/tools/lint/rust/__init__.py
@@ -112,17 +112,19 @@ def get_rustfmt_binary():
 
 
 def get_rustfmt_version(binary):
     """
     Returns found binary's version
     """
     try:
         output = subprocess.check_output(
-            [binary, "--version"], stderr=subprocess.STDOUT, universal_newlines=True,
+            [binary, "--version"],
+            stderr=subprocess.STDOUT,
+            universal_newlines=True,
         )
     except subprocess.CalledProcessError as e:
         output = e.output
 
     version = re.findall(r"\d.\d+.\d+", output)[0]
     return StrictVersion(version)
 
 
--- a/tools/moztreedocs/mach_commands.py
+++ b/tools/moztreedocs/mach_commands.py
@@ -210,19 +210,19 @@ class Documentation(MachCommandBase):
             host=host,
             port=port,
             root=savedir,
             open_url_delay=0.1 if auto_open else None,
         )
 
     def _dump_sphinx_backtrace(self):
         """
-            If there is a sphinx dump file, read and return
-            its content.
-            By default, it isn't displayed.
+        If there is a sphinx dump file, read and return
+        its content.
+        By default, it isn't displayed.
         """
         pattern = "sphinx-err-*"
         output = ""
         tmpdir = "/tmp"
 
         if not os.path.isdir(tmpdir):
             # Only run it on Linux
             return
@@ -258,17 +258,17 @@ class Documentation(MachCommandBase):
         if verbose:
             args.extend(["-v", "-v"])
         print("Run sphinx with:")
         print(args)
         return sphinx.cmd.build.build_main(args)
 
     def _post_process_html(self, savedir):
         """
-            Perform some operations on the generated html to fix some URL
+        Perform some operations on the generated html to fix some URL
         """
         MERMAID_VERSION = "8.4.4"
         for root, _, files in os.walk(savedir):
             for file in files:
                 if file.endswith(".html"):
                     p = os.path.join(root, file)
 
                     with open(p, "r") as file:
--- a/tools/moztreedocs/upload.py
+++ b/tools/moztreedocs/upload.py
@@ -86,17 +86,18 @@ def s3_set_redirects(redirects):
             "Redirect": {"ReplaceKeyPrefixWith": redirect},
         }
         if os.environ.get("MOZ_SCM_LEVEL") == "3":
             rule["Redirect"]["HostName"] = "firefox-source-docs.mozilla.org"
 
         configuration["RoutingRules"].append(rule)
 
     s3.put_bucket_website(
-        Bucket=bucket, WebsiteConfiguration=configuration,
+        Bucket=bucket,
+        WebsiteConfiguration=configuration,
     )
 
 
 def s3_delete_missing(files, key_prefix=None):
     """Delete files in the S3 bucket.
 
     Delete files on the S3 bucket that doesn't match the files
     given as the param. If the key_prefix is not specified, missing
@@ -115,17 +116,20 @@ def s3_delete_missing(files, key_prefix=
         ]
     files = [key_prefix + "/" + path if key_prefix else path for path, f in files]
     files_to_delete = [path for path in files_on_server if path not in files]
 
     query_size = 1000
     while files_to_delete:
         keys_to_remove = [{"Key": key} for key in files_to_delete[:query_size]]
         response = s3.delete_objects(
-            Bucket=bucket, Delete={"Objects": keys_to_remove,},  # NOQA
+            Bucket=bucket,
+            Delete={
+                "Objects": keys_to_remove,
+            },  # NOQA
         )
         pprint(response, indent=2)
         files_to_delete = files_to_delete[query_size:]
 
 
 def s3_upload(files, key_prefix=None):
     """Upload files to an S3 bucket.