Commit 62c4eb40 authored by John Reese's avatar John Reese Committed by Facebook GitHub Bot

apply upgraded black 21.4b2 formatting to fbsource

Summary:
This applies the formatting changes from black v21.4b2 to all covered
projects in fbsource. Most changes are to single line docstrings, as black
will now remove leading and trailing whitespace to match PEP8. Any other
formatting changes are likely due to files that landed without formatting,
or files that previously triggered errors in black.

Any changes to code should be AST identical. Any test failures are likely
due to bad tests, or testing against the output of pyfmt.

Reviewed By: thatch

Differential Revision: D28204910

fbshipit-source-id: 804725bcd14f763e90c5ddff1d0418117c15809a
parent 0383893a
......@@ -235,7 +235,7 @@ class CachedProject(object):
)
def is_cacheable(self):
""" We only cache third party projects """
"""We only cache third party projects"""
return self.cache and self.m.shipit_project is None
def was_cached(self):
......
......@@ -148,7 +148,7 @@ class BuildOptions(object):
return self.host_type.is_linux()
def get_context_generator(self, host_tuple=None, facebook_internal=None):
""" Create a manifest ContextGenerator for the specified target platform. """
"""Create a manifest ContextGenerator for the specified target platform."""
if host_tuple is None:
host_type = self.host_type
elif isinstance(host_tuple, HostType):
......@@ -364,7 +364,7 @@ def _check_host_type(args, host_type):
def setup_build_options(args, host_type=None):
""" Create a BuildOptions object based on the arguments """
"""Create a BuildOptions object based on the arguments"""
fbcode_builder_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
scratch_dir = args.scratch_path
......
......@@ -690,7 +690,7 @@ class ArchiveFetcher(Fetcher):
)
def _download_dir(self):
""" returns the download dir, creating it if it doesn't already exist """
"""returns the download dir, creating it if it doesn't already exist"""
download_dir = os.path.dirname(self.file_name)
if not os.path.exists(download_dir):
os.makedirs(download_dir)
......
......@@ -16,10 +16,10 @@ from .manifest import ManifestParser
class Loader(object):
""" The loader allows our tests to patch the load operation """
"""The loader allows our tests to patch the load operation"""
def _list_manifests(self, build_opts):
""" Returns a generator that iterates all the available manifests """
"""Returns a generator that iterates all the available manifests"""
for (path, _, files) in os.walk(build_opts.manifests_dir):
for name in files:
# skip hidden files
......
......@@ -330,11 +330,11 @@ class ManifestParser(object):
hasher.update(value.encode("utf-8"))
def is_first_party_project(self):
""" returns true if this is an FB first-party project """
"""returns true if this is an FB first-party project"""
return self.shipit_project is not None
def get_required_system_packages(self, ctx):
""" Returns dictionary of packager system -> list of packages """
"""Returns dictionary of packager system -> list of packages"""
return {
"rpm": self.get_section_as_args("rpms", ctx),
"deb": self.get_section_as_args("debs", ctx),
......
......@@ -11,7 +11,7 @@ class SubCmd(object):
HELP = None
def run(self, args):
""" perform the command """
"""perform the command"""
return 0
def setup_parser(self, parser):
......@@ -24,7 +24,7 @@ CmdTable = []
def add_subcommands(parser, common_args, cmd_table=CmdTable):
""" Register parsers for the defined commands with the provided parser """
"""Register parsers for the defined commands with the provided parser"""
for cls in cmd_table:
command = cls()
command_parser = parser.add_parser(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment