Skip to content

Commit 8aea9b4

Browse files
committed
🔧 Upgrade ruff-pre-commit to v0.11.0 and add copywrite hook
1 parent 40ca62b commit 8aea9b4

File tree

4 files changed

+12
-13
lines changed

4 files changed

+12
-13
lines changed

.pre-commit-config.yaml

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,14 @@ repos:
2121
exclude: \.(po|pot|yml|yaml)$
2222
- repo: https://github.com/astral-sh/ruff-pre-commit
2323
# Ruff version.
24-
rev: v0.9.10
24+
rev: v0.11.0
2525
hooks:
2626
# Run the linter.
2727
- id: ruff
2828
args: [ --fix ]
2929
# Run the formatter.
3030
- id: ruff-format
31-
- repo: local
32-
hooks:
33-
- id: copywrite
34-
name: copywrite
35-
entry: copywrite headers
36-
language: system
37-
pass_filenames: false
38-
files: .
31+
- repo: https://github.com/bhundven/copywrite # waiting for https://github.com/hashicorp/copywrite/pull/120 to be merged
32+
rev: 937f17f09c46992447dfa8977bb96eda512588c4
33+
hooks:
34+
- id: add-headers

readme.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -521,9 +521,12 @@ dependencies using `pdm install -d` if you haven't already.
521521

522522
## Copyright Headers Management
523523

524-
This project uses HashiCorp's [Copywrite](https://github.com/hashicorp/copywrite) tool to manage copyright headers across all source files. Copywrite automatically ensures consistent copyright headers and license information across the codebase.
524+
This project uses HashiCorp's [Copywrite](https://github.com/hashicorp/copywrite) tool
525+
to manage copyright headers across all source files. Copywrite automatically ensures
526+
consistent copyright headers and license information across the codebase.
525527

526-
The project includes a `.copywrite.hcl` file that configures how copyright headers are managed:
528+
The project includes a `.copywrite.hcl` file that configures how copyright headers are
529+
managed:
527530

528531
### Usage
529532

src/start.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ def load_extensions() -> tuple[
121121
logger.debug("", exc_info=e)
122122
continue
123123

124-
its_config = its_config or cast(Extension, module.default)
124+
its_config = its_config or cast("Extension", module.default)
125125
if not its_config.get("enabled"):
126126
del module
127127
continue

src/utils/cooldown.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ async def wrapper(self: C, *args: P.args, **kwargs: P.kwargs) -> None:
104104
full_key = get_bucket_key(ctx, key_value, bucket_type_value)
105105

106106
now = time.time()
107-
time_stamps = cast(tuple[float, ...], await cache.get(full_key, default=(), namespace="cooldown"))
107+
time_stamps = cast("tuple[float, ...]", await cache.get(full_key, default=(), namespace="cooldown"))
108108
time_stamps = tuple(filter(lambda x: x > now - per_value, time_stamps))
109109
time_stamps = time_stamps[-limit_value:]
110110

0 commit comments

Comments
 (0)