Skip to content
This repository was archived by the owner on Jun 4, 2022. It is now read-only.

Commit d42e9b6

Browse files
amyreesefacebook-github-bot
authored andcommitted
apply import merging for fbcode (8 of 11)
Summary: Applies new import merging and sorting from µsort v1.0. When merging imports, µsort will make a best-effort to move associated comments to match merged elements, but there are known limitations due to the diynamic nature of Python and developer tooling. These changes should not produce any dangerous runtime changes, but may require touch-ups to satisfy linters and other tooling. Note that µsort uses case-insensitive, lexicographical sorting, which results in a different ordering compared to isort. This provides a more consistent sorting order, matching the case-insensitive order used when sorting import statements by module name, and ensures that "frog", "FROG", and "Frog" always sort next to each other. For details on µsort's sorting and merging semantics, see the user guide: https://usort.readthedocs.io/en/stable/guide.html#sorting Reviewed By: lisroach Differential Revision: D36402214 fbshipit-source-id: b641bfa9d46242188524d4ae2c44998922a62b4c
1 parent 09bd519 commit d42e9b6

File tree

7 files changed

+10
-10
lines changed

7 files changed

+10
-10
lines changed

build/fbcode_builder/docker_builder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import tempfile
2020

2121
from fbcode_builder import FBCodeBuilder
22-
from shell_quoting import raw_shell, shell_comment, shell_join, ShellQuoted, path_join
22+
from shell_quoting import path_join, raw_shell, shell_comment, shell_join, ShellQuoted
2323
from utils import recursively_flatten_list, run_command
2424

2525

build/fbcode_builder/getdeps.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@
2121
from getdeps.dyndeps import create_dyn_dep_munger
2222
from getdeps.errors import TransientFailure
2323
from getdeps.fetcher import (
24-
SystemPackageFetcher,
2524
file_name_is_cmake_file,
2625
list_files_under_dir_newer_than_timestamp,
26+
SystemPackageFetcher,
2727
)
2828
from getdeps.load import ManifestLoader
2929
from getdeps.manifest import ManifestParser
3030
from getdeps.platform import HostType
3131
from getdeps.runcmd import run_cmd
32-
from getdeps.subcmd import SubCmd, add_subcommands, cmd
32+
from getdeps.subcmd import add_subcommands, cmd, SubCmd
3333

3434

3535
try:

build/fbcode_builder/getdeps/builder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
import sys
1515

1616
from .dyndeps import create_dyn_dep_munger
17-
from .envfuncs import Env, add_path_entry, path_search
17+
from .envfuncs import add_path_entry, Env, path_search
1818
from .fetcher import copy_if_different
1919
from .runcmd import run_cmd
2020

build/fbcode_builder/getdeps/buildopts.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@
1010
import subprocess
1111
import sys
1212
import tempfile
13-
from typing import Optional, Mapping
13+
from typing import Mapping, Optional
1414

1515
from .copytree import containing_repo_type
16-
from .envfuncs import Env, add_flag, add_path_entry
16+
from .envfuncs import add_flag, add_path_entry, Env
1717
from .fetcher import get_fbsource_repo_data, homebrew_package_prefix
1818
from .manifest import ContextGenerator
19-
from .platform import HostType, is_windows, get_available_ram
19+
from .platform import get_available_ram, HostType, is_windows
2020

2121

2222
def detect_project(path):

build/fbcode_builder/getdeps/manifest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
from .builder import (
1212
AutoconfBuilder,
1313
Boost,
14+
CMakeBootStrapBuilder,
1415
CMakeBuilder,
1516
Iproute2Builder,
1617
MakeBuilder,
@@ -19,7 +20,6 @@
1920
OpenNSABuilder,
2021
OpenSSLBuilder,
2122
SqliteBuilder,
22-
CMakeBootStrapBuilder,
2323
)
2424
from .cargo import CargoBuilder
2525
from .expr import parse_expr

build/fbcode_builder/make_docker_context.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ def add_args(parser):
183183

184184

185185
if __name__ == "__main__":
186-
from utils import read_fbcode_builder_config, build_fbcode_builder_config
186+
from utils import build_fbcode_builder_config, read_fbcode_builder_config
187187

188188
# Load a spec from the current directory
189189
config = read_fbcode_builder_config("fbcode_builder_config.py")

build/fbcode_builder/shell_builder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def persistent_temp_dir(repo_root):
8888

8989

9090
if __name__ == "__main__":
91-
from utils import read_fbcode_builder_config, build_fbcode_builder_config
91+
from utils import build_fbcode_builder_config, read_fbcode_builder_config
9292

9393
repo_root = find_project_root()
9494
temp = persistent_temp_dir(repo_root)

0 commit comments

Comments
 (0)