mirror of
https://github.com/beautifier/js-beautify.git
synced 2024-11-26 22:20:56 +00:00
latest version of black doesn't support py27
This commit is contained in:
parent
fce2471d9e
commit
54e524cf39
@ -1462,16 +1462,12 @@ class Beautifier:
|
||||
elif self._flags.last_token.type == TOKEN.OPERATOR:
|
||||
# a++ + ++b
|
||||
# a - -b
|
||||
space_before = (
|
||||
current_token.text
|
||||
in [
|
||||
"--",
|
||||
"-",
|
||||
"++",
|
||||
"+",
|
||||
]
|
||||
and self._flags.last_token.text in ["--", "-", "++", "+"]
|
||||
)
|
||||
space_before = current_token.text in [
|
||||
"--",
|
||||
"-",
|
||||
"++",
|
||||
"+",
|
||||
] and self._flags.last_token.text in ["--", "-", "++", "+"]
|
||||
# + and - are not unary when preceeded by -- or ++ operator
|
||||
# a-- + b
|
||||
# a * +b
|
||||
@ -1591,6 +1587,9 @@ class Beautifier:
|
||||
else:
|
||||
self.handle_whitespace_and_comments(current_token, True)
|
||||
|
||||
if re.search(self._flags.last_token.text, "^[0-9]+$"):
|
||||
self._flags.whitespace_before = True
|
||||
|
||||
if reserved_array(self._flags.last_token, _special_word_set):
|
||||
self._output.space_before_token = False
|
||||
else:
|
||||
|
@ -157,5 +157,5 @@ class Unbaser(object):
|
||||
"""Decodes a value to an integer."""
|
||||
ret = 0
|
||||
for index, cipher in enumerate(string[::-1]):
|
||||
ret += (self.base ** index) * self.dictionary[cipher]
|
||||
ret += (self.base**index) * self.dictionary[cipher]
|
||||
return ret
|
||||
|
@ -1,5 +1,5 @@
|
||||
[tool.black]
|
||||
target-version = ['py27', 'py36', 'py37', 'py38']
|
||||
target-version = ['py36', 'py37', 'py38']
|
||||
exclude = '''
|
||||
/(
|
||||
\.eggs
|
||||
|
Loading…
Reference in New Issue
Block a user