Skip to content

Commit fb61d5a

Browse files
Update pre-commit (#226)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
1 parent fd230cf commit fb61d5a

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/astral-sh/ruff-pre-commit
3-
rev: v0.7.0
3+
rev: v0.8.6
44
hooks:
55
- id: ruff
66
args: [--exit-non-zero-on-fix]
@@ -32,12 +32,12 @@ repos:
3232
- id: check-renovate
3333

3434
- repo: https://github.com/rhysd/actionlint
35-
rev: v1.7.4
35+
rev: v1.7.6
3636
hooks:
3737
- id: actionlint
3838

3939
- repo: https://github.com/woodruffw/zizmor-pre-commit
40-
rev: v0.9.1
40+
rev: v1.0.0
4141
hooks:
4242
- id: zizmor
4343

src/humanize/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@
3636
"intcomma",
3737
"intword",
3838
"metric",
39+
"natural_list",
3940
"naturaldate",
4041
"naturalday",
4142
"naturaldelta",
42-
"natural_list",
4343
"naturalsize",
4444
"naturaltime",
4545
"ordinal",

src/humanize/filesize.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,10 @@ def naturalsize(
9191
abs_bytes = abs(bytes_)
9292

9393
if abs_bytes == 1 and not gnu:
94-
return "%d Byte" % bytes_
94+
return f"{bytes_} Byte"
9595

9696
if abs_bytes < base:
97-
return ("%dB" if gnu else "%d Bytes") % bytes_
97+
return f"{bytes_}B" if gnu else f"{bytes_} Bytes"
9898

9999
for i, s in enumerate(suffix, 2):
100100
unit = base**i

src/humanize/number.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,7 @@ def metric(value: float, unit: str = "", precision: int = 3) -> str:
564564
ordinal_ = "mμnpfazyrq"[(-exponent - 1) // 3]
565565
else:
566566
ordinal_ = ""
567-
value_ = format(value, ".%if" % max(0, precision - (exponent % 3) - 1))
567+
value_ = format(value, f".{int(max(0, precision - exponent % 3 - 1))}f")
568568
if not (unit or ordinal_) or unit in ("°", "′", "″"):
569569
space = ""
570570
else:

src/humanize/time.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@
1818
from .number import intcomma
1919

2020
__all__ = [
21+
"naturaldate",
22+
"naturalday",
2123
"naturaldelta",
2224
"naturaltime",
23-
"naturalday",
24-
"naturaldate",
2525
"precisedelta",
2626
]
2727

0 commit comments

Comments
 (0)