Skip to content

Commit 48506d4

Browse files
committed
pre-commit autoupdate
1 parent 8f2c855 commit 48506d4

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

.pre-commit-config.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
repos:
22
- repo: https://github.com/asottile/pyupgrade
3-
rev: v2.29.1
3+
rev: v2.31.0
44
hooks:
55
- id: pyupgrade
66
args: [--py37-plus]
77

88
- repo: https://github.com/psf/black
9-
rev: 21.11b1
9+
rev: 22.1.0
1010
hooks:
1111
- id: black
1212
args: [--target-version=py37]
@@ -42,7 +42,7 @@ repos:
4242
- id: python-check-blanket-noqa
4343

4444
- repo: https://github.com/pre-commit/pre-commit-hooks
45-
rev: v4.0.1
45+
rev: v4.1.0
4646
hooks:
4747
- id: check-merge-conflict
4848
- id: check-toml
@@ -57,7 +57,7 @@ repos:
5757
files: "src/"
5858

5959
- repo: https://github.com/tox-dev/tox-ini-fmt
60-
rev: 0.5.1
60+
rev: 0.5.2
6161
hooks:
6262
- id: tox-ini-fmt
6363

src/humanize/number.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,14 +129,14 @@ def intcomma(value, ndigits=None):
129129
else:
130130
orig = str(value)
131131

132-
new = re.sub(r"^(-?\d+)(\d{3})", fr"\g<1>{sep}\g<2>", orig)
132+
new = re.sub(r"^(-?\d+)(\d{3})", rf"\g<1>{sep}\g<2>", orig)
133133
if orig == new:
134134
return new
135135
else:
136136
return intcomma(new)
137137

138138

139-
powers = [10 ** x for x in (3, 6, 9, 12, 15, 18, 21, 24, 27, 30, 33, 100)]
139+
powers = [10**x for x in (3, 6, 9, 12, 15, 18, 21, 24, 27, 30, 33, 100)]
140140
human_powers = (
141141
NS_("thousand", "thousand"),
142142
NS_("million", "million"),
@@ -197,7 +197,7 @@ def intword(value, format="%.1f"):
197197
for ordinal, power in enumerate(powers[1:], 1):
198198
if value < power:
199199
chopped = value / float(powers[ordinal - 1])
200-
if float(format % chopped) == float(10 ** 3):
200+
if float(format % chopped) == float(10**3):
201201
chopped = value / float(powers[ordinal])
202202
singular, plural = human_powers[ordinal]
203203
return (

tests/test_filesize.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@
2222
([3000, False, True], "2.9K"),
2323
([3000000, False, True], "2.9M"),
2424
([1024, False, True], "1.0K"),
25-
([10 ** 26 * 30, False, True], "2481.5Y"),
26-
([10 ** 26 * 30, True], "2481.5 YiB"),
27-
([10 ** 26 * 30], "3000.0 YB"),
25+
([10**26 * 30, False, True], "2481.5Y"),
26+
([10**26 * 30, True], "2481.5 YiB"),
27+
([10**26 * 30], "3000.0 YB"),
2828
([1, False, False], "1 Byte"),
2929
([3141592, False, False, "%.2f"], "3.14 MB"),
3030
([3000, False, True, "%.3f"], "2.930K"),
3131
([3000000000, False, True, "%.0f"], "3G"),
32-
([10 ** 26 * 30, True, False, "%.3f"], "2481.542 YiB"),
32+
([10**26 * 30, True, False, "%.3f"], "2481.542 YiB"),
3333
],
3434
)
3535
def test_naturalsize(test_args, expected):

tests/test_number.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def test_intword_powers():
8989
(["8100000000000000000000000000000000"], "8.1 decillion"),
9090
([None], None),
9191
(["1230000", "%0.2f"], "1.23 million"),
92-
([10 ** 101], "1" + "0" * 101),
92+
([10**101], "1" + "0" * 101),
9393
],
9494
)
9595
def test_intword(test_args, expected):

0 commit comments

Comments
 (0)