Skip to content

Commit

Permalink
Convert directory fbcode/opensource to use the Ruff Formatter
Browse files Browse the repository at this point in the history
Summary:
X-link: facebook/sapling#968

X-link: facebook/proxygen#523

X-link: facebook/openr#156

X-link: facebook/mvfst#358

X-link: facebook/hhvm#9522

X-link: facebook/folly#2318

X-link: facebook/fboss#277

X-link: facebook/fb303#59

Converts the directory specified to use the Ruff formatter in pyfmt

ruff_dog

If this diff causes merge conflicts when rebasing, please run
`hg status -n -0 --change . -I '**/*.{py,pyi}' | xargs -0 arc pyfmt`
on your diff, and amend any changes before rebasing onto latest.
That should help reduce or eliminate any merge conflicts.

allow-large-files

Reviewed By: amyreese

Differential Revision: D64265365
  • Loading branch information
Thomas Polasek authored and facebook-github-bot committed Oct 18, 2024
1 parent d07f867 commit f4bd0d4
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 15 deletions.
4 changes: 0 additions & 4 deletions build/fbcode_builder/CMake/fb_py_test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
This file contains the main module code for Python test programs.
"""


import contextlib
import ctypes
import fnmatch
Expand Down Expand Up @@ -50,7 +49,6 @@ def read(self):


class TestStatus(object):

ABORTED = "FAILURE"
PASSED = "SUCCESS"
FAILED = "FAILURE"
Expand Down Expand Up @@ -230,7 +228,6 @@ def _find_next_test(self, suite):
"""

for test in suite:

# We identify test suites by test that are iterable (as is done in
# the builtin python test harness). If we see one, recurse on it.
if hasattr(test, "__iter__"):
Expand Down Expand Up @@ -429,7 +426,6 @@ def getTestCaseNames(self, testCaseClass):


class Loader(object):

suiteClass = unittest.TestSuite

def __init__(self, modules, regex=None):
Expand Down
4 changes: 1 addition & 3 deletions build/fbcode_builder/CMake/make_fbpy_archive.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,7 @@ def create_main_module(args, inst_dir, path_map):
if __name__ == "__main__":
import {main_module}
{main_module}.{main_fn}()
""".format(
python=args.python, main_module=main_module, main_fn=main_fn
)
""".format(python=args.python, main_module=main_module, main_fn=main_fn)
with open(dest_path, "w") as f:
f.write(main_contents)
os.chmod(dest_path, 0o755)
Expand Down
1 change: 0 additions & 1 deletion build/fbcode_builder/getdeps/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,6 @@ def _get_prefix(self):
return ["PREFIX=" + self.inst_dir, "prefix=" + self.inst_dir]

def _build(self, reconfigure) -> None:

env = self._compute_env()

# Need to ensure that PREFIX is set prior to install because
Expand Down
1 change: 0 additions & 1 deletion build/fbcode_builder/getdeps/buildopts.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ def __init__(
self.lib_path = lib_path

if vcvars_path is None and is_windows():

try:
# Allow a site-specific vcvarsall path.
from .facebook.vcvarsall import build_default_vcvarsall
Expand Down
4 changes: 1 addition & 3 deletions build/fbcode_builder/getdeps/cargo.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,7 @@ def _create_cargo_config(self):
[profile.dev]
debug = false
incremental = false
""".format(
self.build_dir.replace("\\", "\\\\")
)
""".format(self.build_dir.replace("\\", "\\\\"))

# Point to vendored sources from getdeps manifests
for _dep, git_conf in dep_to_git.items():
Expand Down
4 changes: 1 addition & 3 deletions build/fbcode_builder/getdeps/dyndeps.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,9 +328,7 @@ def _get_dev_run_script_contents(self, path_dirs) -> str:
}} finally {{
$env:PATH = $orig_env
}}
""".format(
path_str=path_str
)
""".format(path_str=path_str)


class ElfDeps(DepBase):
Expand Down

0 comments on commit f4bd0d4

Please sign in to comment.