mirror of https://github.com/Textualize/rich.git
update black
This commit is contained in:
parent
4639772763
commit
5dc797e1be
|
@ -26,7 +26,7 @@ repos:
|
||||||
- id: rst-directive-colons
|
- id: rst-directive-colons
|
||||||
- id: rst-inline-touching-normal
|
- id: rst-inline-touching-normal
|
||||||
- repo: https://github.com/psf/black
|
- repo: https://github.com/psf/black
|
||||||
rev: 21.12b0
|
rev: 22.1.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: black
|
- id: black
|
||||||
- repo: https://github.com/PyCQA/isort
|
- repo: https://github.com/PyCQA/isort
|
||||||
|
|
|
@ -35,7 +35,7 @@ DIVIDES = [
|
||||||
(0, 1000000),
|
(0, 1000000),
|
||||||
(3.1427, 2),
|
(3.1427, 2),
|
||||||
(888, 0),
|
(888, 0),
|
||||||
(2 ** 32, 2 ** 16),
|
(2**32, 2**16),
|
||||||
]
|
]
|
||||||
|
|
||||||
divide_all(DIVIDES)
|
divide_all(DIVIDES)
|
||||||
|
|
|
@ -30,7 +30,7 @@ def _to_str(
|
||||||
return "{:,} bytes".format(size)
|
return "{:,} bytes".format(size)
|
||||||
|
|
||||||
for i, suffix in enumerate(suffixes, 2): # noqa: B007
|
for i, suffix in enumerate(suffixes, 2): # noqa: B007
|
||||||
unit = base ** i
|
unit = base**i
|
||||||
if size < unit:
|
if size < unit:
|
||||||
break
|
break
|
||||||
return "{:,.{precision}f}{separator}{}".format(
|
return "{:,.{precision}f}{separator}{}".format(
|
||||||
|
@ -44,7 +44,7 @@ def _to_str(
|
||||||
def pick_unit_and_suffix(size: int, suffixes: List[str], base: int) -> Tuple[int, str]:
|
def pick_unit_and_suffix(size: int, suffixes: List[str], base: int) -> Tuple[int, str]:
|
||||||
"""Pick a suffix and base for the given size."""
|
"""Pick a suffix and base for the given size."""
|
||||||
for i, suffix in enumerate(suffixes):
|
for i, suffix in enumerate(suffixes):
|
||||||
unit = base ** i
|
unit = base**i
|
||||||
if size < unit * base:
|
if size < unit * base:
|
||||||
break
|
break
|
||||||
return unit, suffix
|
return unit, suffix
|
||||||
|
|
Loading…
Reference in New Issue