Skip to content

Commit 728ba5b

Browse files
committed
Update formatting rules, expand pre-commit hooks, and refine test workflow
1 parent ddf2aca commit 728ba5b

File tree

4 files changed

+18
-2
lines changed

4 files changed

+18
-2
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ jobs:
2222
- name: 🦾 Install dependencies
2323
run: uv sync --dev
2424
- name: 🧪 Test
25-
run: uv run pytest test/
25+
run: uv run pytest test/ src/

.pre-commit-config.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ repos:
77
- id: check-yaml
88
- id: check-toml
99
- id: check-added-large-files
10+
- id: check-ast
11+
- id: check-docstring-first
12+
- id: detect-private-key
13+
- id: check-symlinks
1014
- repo: https://github.com/astral-sh/ruff-pre-commit
1115
rev: v0.14.10
1216
hooks:

pyproject.toml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ where = [ "src" ]
4747
target-version = "py39"
4848

4949
line-length = 120
50+
format.indent-style = "space"
51+
format.quote-style = "double"
5052
lint.select = [
5153
"B", # flake8-bugbear - https://docs.astral.sh/ruff/rules/#flake8-bugbear-b
5254
"D", # pydocstyle - https://docs.astral.sh/ruff/rules/#pydocstyle-d
@@ -59,3 +61,9 @@ lint.select = [
5961
"W", # pycodestyle warnings - https://docs.astral.sh/ruff/rules/#pycodestyle-e-w
6062
]
6163
lint.isort.known-first-party = [ "sandbox" ]
64+
65+
[tool.pytest.ini_options]
66+
addopts = [
67+
"--color=yes",
68+
"--doctest-modules",
69+
]

src/sandbox/hello.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,9 @@
22

33

44
def hello() -> str:
5-
"""Return the string "World"."""
5+
"""Return the string "World".
6+
7+
>>> hello()
8+
'World'
9+
"""
610
return "World"

0 commit comments

Comments
 (0)