Skip to content

Commit

Permalink
Merge f7cbe30 into d9e71a7
Browse files Browse the repository at this point in the history
  • Loading branch information
dyus committed Oct 7, 2019
2 parents d9e71a7 + f7cbe30 commit 6680c89
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 6 deletions.
1 change: 1 addition & 0 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ toml = ">=0.9.4"
black = {path = ".",extras = ["d"],editable = true}
aiohttp-cors = "*"
typed-ast = ">=1.3.1"
regex = "==2019.8.19"

[dev-packages]
pre-commit = "*"
Expand Down
2 changes: 1 addition & 1 deletion black.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import os
from pathlib import Path
import pickle
import re
import regex as re
import signal
import sys
import tempfile
Expand Down
2 changes: 1 addition & 1 deletion blib2to3/pgen2/conv.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"""

# Python imports
import re
import regex as re

# Local imports
from pgen2 import grammar, token
Expand Down
2 changes: 1 addition & 1 deletion blib2to3/pgen2/literals.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

"""Safely evaluate Python string literals without using eval()."""

import re
import regex as re

simple_escapes = {"a": "\a",
"b": "\b",
Expand Down
2 changes: 1 addition & 1 deletion blib2to3/pgen2/tokenize.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
__credits__ = \
'GvR, ESR, Tim Peters, Thomas Wouters, Fred Drake, Skip Montanaro'

import re
import regex as re
from codecs import BOM_UTF8, lookup
from blib2to3.pgen2.token import *

Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
from pathlib import Path
import re
import regex as re
import shutil
import string

Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ click = "^6.5"
toml = "^0.9.4"
appdirs = "^1.4"
aiohttp = { version = "^3.4", optional = true }
regex = "^2019.8"

[tool.poetry.extras]
d = ["aiohttp"]
Expand Down
6 changes: 6 additions & 0 deletions tests/data/tricky_unicode_symbols.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
ä = 1
µ = 2
= 3
x󠄀 = 4
មុ = 1
Q̇_per_meter = 4
9 changes: 8 additions & 1 deletion tests/test_black.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from io import BytesIO, TextIOWrapper
import os
from pathlib import Path
import re
import regex as re
import sys
from tempfile import TemporaryDirectory
from typing import Any, BinaryIO, Generator, List, Tuple, Iterator, TypeVar
Expand Down Expand Up @@ -1245,6 +1245,13 @@ def test_read_cache_line_lengths(self) -> None:
two = black.read_cache(short_mode)
self.assertNotIn(path, two)

def test_tricky_unicode_symbols(self) -> None:
source, expected = read_data("tricky_unicode_symbols")
actual = fs(source)
self.assertFormatEqual(expected, actual)
black.assert_equivalent(source, actual)
black.assert_stable(source, actual, black.FileMode())

def test_single_file_force_pyi(self) -> None:
reg_mode = black.FileMode()
pyi_mode = black.FileMode(is_pyi=True)
Expand Down

0 comments on commit 6680c89

Please sign in to comment.