Skip to content

Commit 7dc4509

Browse files
committed
added pre commits and ran on all files
1 parent 1c2c0bc commit 7dc4509

6 files changed

Lines changed: 174 additions & 7 deletions

File tree

.pre-commit-config.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
repos:
2+
- repo: https://github.com/astral-sh/ruff-pre-commit
3+
# Ruff version.
4+
rev: v0.12.3
5+
hooks:
6+
# Run the linter.
7+
- id: ruff
8+
types_or: [ python, pyi ]
9+
args: [ --fix ]
10+
# Run the formatter.
11+
- id: ruff-format
12+
types_or: [ python, pyi ]

pyproject.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,7 @@ build-backend = "hatchling.build"
1515

1616
[dependency-groups]
1717
dev = [
18+
"pre-commit>=4.2.0",
1819
"pytest>=8.4.1",
20+
"ruff>=0.12.3",
1921
]

src/eed_basic_utils/time/sleep_random.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@
33

44

55
def sleep_random(
6-
minimum_seconds: float = 0, maximum_seconds: float = 1, seed: int = None, ndigits: int = None
6+
minimum_seconds: float = 0,
7+
maximum_seconds: float = 1,
8+
seed: int = None,
9+
ndigits: int = None,
710
) -> float:
811
"""
912
Pauses the program execution for a random duration between minimum_seconds and maximum_seconds.

tests/conftest.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@
66
import pytest
77

88

9-
10-
11-
12-
139
@pytest.fixture(scope="session")
1410
def cfg_test() -> Iterator[dict]:
1511
home_dir = os.path.expanduser("~")

tests/time/test_sleep_random.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@
1515
],
1616
)
1717
def test_sleep(
18-
minimum_seconds, maximum_seconds, seed, minimum_seconds_expected, maximum_seconds_expected
18+
minimum_seconds,
19+
maximum_seconds,
20+
seed,
21+
minimum_seconds_expected,
22+
maximum_seconds_expected,
1923
):
2024
result = sleep_random(minimum_seconds, maximum_seconds, seed)
2125
assert minimum_seconds_expected <= result <= maximum_seconds_expected

0 commit comments

Comments
 (0)