Skip to content

Commit

Permalink
Merge 5cfcfca into 8ed3e3d
Browse files Browse the repository at this point in the history
  • Loading branch information
danpf committed Apr 24, 2022
2 parents 8ed3e3d + 5cfcfca commit a4e22db
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 19 deletions.
69 changes: 52 additions & 17 deletions src/black/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,29 +37,64 @@
from dataclasses import replace
from mypy_extensions import mypyc_attr

from black.const import DEFAULT_LINE_LENGTH, DEFAULT_INCLUDES, DEFAULT_EXCLUDES
from black.const import STDIN_PLACEHOLDER
from black.nodes import STARS, syms, is_simple_decorator_expression
from black.nodes import is_string_token
from . import const as const, mode as mode
from black.const import (
DEFAULT_LINE_LENGTH as DEFAULT_LINE_LENGTH,
DEFAULT_INCLUDES,
DEFAULT_EXCLUDES,
STDIN_PLACEHOLDER,
)
from black.nodes import STARS, syms, is_simple_decorator_expression, is_string_token
from black.lines import Line, EmptyLineTracker
from black.linegen import transform_line, LineGenerator, LN
from black.comments import normalize_fmt_off
from black.mode import FUTURE_FLAG_TO_FEATURE, Mode, TargetVersion
from black.mode import Feature, supports_feature, VERSION_TO_FEATURES
from black.cache import read_cache, write_cache, get_cache_info, filter_cached, Cache
from black.mode import (
FUTURE_FLAG_TO_FEATURE,
Mode as Mode,
TargetVersion as TargetVersion,
Feature,
supports_feature,
VERSION_TO_FEATURES,
)
from black.cache import (
read_cache as read_cache,
write_cache as write_cache,
get_cache_info as get_cache_info,
filter_cached as filter_cached,
Cache,
)
from black.concurrency import cancel, shutdown, maybe_install_uvloop
from black.output import dump_to_file, ipynb_diff, diff, color_diff, out, err
from black.report import Report, Changed, NothingChanged
from black.output import (
dump_to_file as dump_to_file,
ipynb_diff,
diff as diff,
color_diff,
out as out,
err as err,
)
from black.report import (
Report as Report,
Changed as Changed,
NothingChanged as NothingChanged,
)
from black.files import (
find_project_root as find_project_root,
find_pyproject_toml as find_pyproject_toml,
parse_pyproject_toml as parse_pyproject_toml,
find_user_pyproject_toml as find_user_pyproject_toml,
)
from black.files import (
find_project_root,
find_pyproject_toml,
parse_pyproject_toml,
find_user_pyproject_toml,
gen_python_files,
get_gitignore,
normalize_path_maybe_ignore,
wrap_stream_for_windows,
)
from black.parsing import (
InvalidInput as InvalidInput,
lib2to3_parse as lib2to3_parse,
parse_ast,
stringify_ast,
)
from black.files import gen_python_files, get_gitignore, normalize_path_maybe_ignore
from black.files import wrap_stream_for_windows
from black.parsing import InvalidInput # noqa F401
from black.parsing import lib2to3_parse, parse_ast, stringify_ast
from black.handle_ipynb_magics import (
mask_cell,
unmask_cell,
Expand Down
5 changes: 3 additions & 2 deletions tests/test_black.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,12 @@
)
from unittest.mock import MagicMock, patch

import click
import pytest
import re
import click
from click import unstyle
from click.testing import CliRunner
import click.testing
from pathspec import PathSpec

import black
Expand Down Expand Up @@ -1614,7 +1615,7 @@ def test_for_handled_unexpected_eof_error(self) -> None:
"""
Test that an unexpected EOF SyntaxError is nicely presented.
"""
with pytest.raises(black.parsing.InvalidInput) as exc_info:
with pytest.raises(black.InvalidInput) as exc_info:
black.lib2to3_parse("print(", {})

exc_info.match("Cannot parse: 2:0: EOF in multi-line statement")
Expand Down

0 comments on commit a4e22db

Please sign in to comment.