Skip to content

Commit

Permalink
Format black source with new formatting change
Browse files Browse the repository at this point in the history
  • Loading branch information
Shivansh-007 committed Jan 14, 2022
1 parent 92cab7e commit be542db
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/black/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1050,7 +1050,7 @@ def format_ipynb_string(src_contents: str, *, fast: bool, mode: Mode) -> FileCon
Operate cell-by-cell, only on code cells, only for Python notebooks.
If the ``.ipynb`` originally had a trailing newline, it'll be preserved.
"""
trailing_newline = src_contents[-1] == "\n"
trailing_newline = (src_contents[-1] == "\n")
modified = False
nb = json.loads(src_contents)
validate_metadata(nb)
Expand Down
2 changes: 1 addition & 1 deletion src/black/parsing.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

ast3: Any

_IS_PYPY = platform.python_implementation() == "PyPy"
_IS_PYPY = (platform.python_implementation() == "PyPy")

try:
from typed_ast import ast3
Expand Down
2 changes: 1 addition & 1 deletion src/black/trans.py
Original file line number Diff line number Diff line change
Expand Up @@ -1397,7 +1397,7 @@ def passes_all_checks(i: Index) -> bool:
True iff ALL of the conditions listed in the 'Transformations'
section of this classes' docstring would be be met by returning @i.
"""
is_space = string[i] == " "
is_space = (string[i] == " ")

is_not_escaped = True
j = i - 1
Expand Down
6 changes: 3 additions & 3 deletions src/black_primer/lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@


TEN_MINUTES_SECONDS = 600
WINDOWS = system() == "Windows"
WINDOWS = (system() == "Windows")
BLACK_BINARY = "black.exe" if WINDOWS else "black"
GIT_BINARY = "git.exe" if WINDOWS else "git"
LOG = logging.getLogger(__name__)
Expand Down Expand Up @@ -158,7 +158,7 @@ async def black_run(
)
return

stdin_test = project_name.upper() == "STDIN"
stdin_test = (project_name.upper() == "STDIN")
cmd = [str(which(BLACK_BINARY))]
if "cli_arguments" in project_config and project_config["cli_arguments"]:
cmd.extend(_flatten_cli_args(project_config["cli_arguments"]))
Expand Down Expand Up @@ -348,7 +348,7 @@ async def project_runner(
continue

repo_path: Optional[Path] = Path(__file__)
stdin_project = project_name.upper() == "STDIN"
stdin_project = (project_name.upper() == "STDIN")
if not stdin_project:
repo_path = await git_checkout_or_rebase(work_path, project_config, rebase)
if not repo_path:
Expand Down
2 changes: 1 addition & 1 deletion src/blackd/middlewares.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
def cors(allow_headers: Iterable[str]) -> Middleware:
@middleware
async def impl(request: Request, handler: Handler) -> StreamResponse:
is_options = request.method == "OPTIONS"
is_options = (request.method == "OPTIONS")
is_preflight = is_options and "Access-Control-Request-Method" in request.headers
if is_preflight:
resp = StreamResponse()
Expand Down
1 change: 1 addition & 0 deletions tests/test_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
"function2",
"function_trailing_comma",
"import_spacing",
"parenthesized_context_managers",
"remove_parens",
"slices",
"string_prefixes",
Expand Down

0 comments on commit be542db

Please sign in to comment.