Skip to content

Commit b5d9bbf

Browse files
Thomas Polasekfacebook-github-bot
Thomas Polasek
authored andcommitted
Convert directory fbcode/opensource to use the Ruff Formatter
Summary: X-link: facebook/wangle#239 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
1 parent 6d7dcb2 commit b5d9bbf

File tree

6 files changed

+3
-15
lines changed

6 files changed

+3
-15
lines changed

build/fbcode_builder/CMake/fb_py_test_main.py

-4
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
This file contains the main module code for Python test programs.
77
"""
88

9-
109
import contextlib
1110
import ctypes
1211
import fnmatch
@@ -50,7 +49,6 @@ def read(self):
5049

5150

5251
class TestStatus(object):
53-
5452
ABORTED = "FAILURE"
5553
PASSED = "SUCCESS"
5654
FAILED = "FAILURE"
@@ -230,7 +228,6 @@ def _find_next_test(self, suite):
230228
"""
231229

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

430427

431428
class Loader(object):
432-
433429
suiteClass = unittest.TestSuite
434430

435431
def __init__(self, modules, regex=None):

build/fbcode_builder/CMake/make_fbpy_archive.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -156,9 +156,7 @@ def create_main_module(args, inst_dir, path_map):
156156
if __name__ == "__main__":
157157
import {main_module}
158158
{main_module}.{main_fn}()
159-
""".format(
160-
python=args.python, main_module=main_module, main_fn=main_fn
161-
)
159+
""".format(python=args.python, main_module=main_module, main_fn=main_fn)
162160
with open(dest_path, "w") as f:
163161
f.write(main_contents)
164162
os.chmod(dest_path, 0o755)

build/fbcode_builder/getdeps/builder.py

-1
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,6 @@ def _get_prefix(self):
286286
return ["PREFIX=" + self.inst_dir, "prefix=" + self.inst_dir]
287287

288288
def _build(self, reconfigure) -> None:
289-
290289
env = self._compute_env()
291290

292291
# Need to ensure that PREFIX is set prior to install because

build/fbcode_builder/getdeps/buildopts.py

-1
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,6 @@ def __init__(
128128
self.lib_path = lib_path
129129

130130
if vcvars_path is None and is_windows():
131-
132131
try:
133132
# Allow a site-specific vcvarsall path.
134133
from .facebook.vcvarsall import build_default_vcvarsall

build/fbcode_builder/getdeps/cargo.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,7 @@ def _create_cargo_config(self):
112112
[profile.dev]
113113
debug = false
114114
incremental = false
115-
""".format(
116-
self.build_dir.replace("\\", "\\\\")
117-
)
115+
""".format(self.build_dir.replace("\\", "\\\\"))
118116

119117
# Point to vendored sources from getdeps manifests
120118
for _dep, git_conf in dep_to_git.items():

build/fbcode_builder/getdeps/dyndeps.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -328,9 +328,7 @@ def _get_dev_run_script_contents(self, path_dirs) -> str:
328328
}} finally {{
329329
$env:PATH = $orig_env
330330
}}
331-
""".format(
332-
path_str=path_str
333-
)
331+
""".format(path_str=path_str)
334332

335333

336334
class ElfDeps(DepBase):

0 commit comments

Comments
 (0)