Skip to content

Commit 69da81b

Browse files
committed
test
1 parent ef26feb commit 69da81b

7 files changed

Lines changed: 28 additions & 33 deletions

File tree

.github/workflows/lint.yaml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,19 @@ name: Lint
33

44
on: [push]
55
jobs:
6-
uv-example:
7-
name: python
6+
lint:
87
runs-on: ubuntu-latest
9-
108
steps:
119
- uses: actions/checkout@v4
12-
1310
- name: Install uv
1411
uses: astral-sh/setup-uv@v5
15-
1612
- name: "Set up Python"
1713
uses: actions/setup-python@v5
1814
with:
1915
python-version-file: "pyproject.toml"
20-
2116
- name: Install the project
2217
run: uv sync --all-extras --dev
23-
2418
- name: Lint with Ruff
25-
run: uv run ruff check .
19+
run: uv run ruff check .
20+
- name: Run tests
21+
run

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ lint:
1212
uv run ruff check . --fix --unsafe-fixes
1313

1414
test:
15-
uv run pytest tests -s
15+
uv run pytest tests -s -v

fastapi_forge/forge.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,10 @@
33
from pathlib import Path
44
from time import perf_counter
55

6-
7-
from fastapi_forge.project_io import ProjectBuilder
8-
9-
10-
from fastapi_forge.project_io import ProjectBuilder
11-
126
from cookiecutter.main import cookiecutter
137

148
from fastapi_forge.dtos import ProjectSpec
159
from fastapi_forge.logger import logger
16-
17-
1810
from fastapi_forge.project_io import ProjectBuilder
1911

2012

fastapi_forge/template/{{cookiecutter.project_name}}/pyproject.toml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ exclude = ["migrations"]
4545
target-version = "py312"
4646
line-length = 88
4747
indent-width = 4
48+
49+
[tool.ruff.lint]
4850
select = ["ALL"]
4951
ignore = [
5052
#### modules
@@ -57,10 +59,8 @@ ignore = [
5759
"TID", #
5860

5961
#### specific rules
60-
"A001",
6162
"A002",
6263
"BLE001",
63-
"B904",
6464
"D100",
6565
"D101",
6666
"D102",
@@ -70,11 +70,11 @@ ignore = [
7070
"D106",
7171
"D107",
7272
"D200",
73+
"D203",
7374
"D205",
7475
"D212",
7576
"D400",
7677
"D401",
77-
"D404",
7878
"D415",
7979
"E402",
8080
"E501",
@@ -87,14 +87,10 @@ ignore = [
8787
"TRY003",
8888
"TRY201",
8989
"TRY203",
90-
"TRY300",
9190
"TD002",
9291
"TD003",
9392
"FIX002",
9493
"PLR0913",
95-
"PLR2004",
96-
"PGH003",
97-
"RUF012",
9894
"S701",
9995
]
10096

@@ -106,3 +102,7 @@ line-ending = "auto"
106102

107103
[tool.ruff.lint.per-file-ignores]
108104
"tests/*" = ["S101", "PT006"]
105+
"__init__.py" = ["F401"]
106+
107+
[tool.pytest]
108+
testpaths = ["tests", "integration"]

pyproject.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ exclude = ["template", "__init__.py"]
2424
target-version = "py312"
2525
line-length = 88
2626
indent-width = 4
27+
28+
[tool.ruff.lint]
2729
select = ["ALL"]
2830
ignore = [
2931
#### modules
@@ -47,6 +49,7 @@ ignore = [
4749
"D106",
4850
"D107",
4951
"D200",
52+
"D203",
5053
"D205",
5154
"D212",
5255
"D400",
@@ -78,7 +81,7 @@ line-ending = "auto"
7881

7982
[tool.ruff.lint.per-file-ignores]
8083
"tests/*" = ["S101", "PT006"]
84+
"__init__.py" = ["F401"]
8185

8286
[tool.pytest]
8387
testpaths = ["tests", "integration"]
84-
"__init__.py" = ["F401"]

tests/test_dtos.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,10 @@ def test_invalid_field_name(invalid_name: str) -> None:
5858
[
5959
(FieldDataType.STRING, 'factory.Faker("text")'),
6060
(FieldDataType.INTEGER, 'factory.Faker("random_int")'),
61-
(FieldDataType.FLOAT, 'factory.Faker("random_float")'),
61+
(
62+
FieldDataType.FLOAT,
63+
'factory.Faker("pyfloat", positive=True, min_value=0.1, max_value=100)',
64+
),
6265
(FieldDataType.BOOLEAN, 'factory.Faker("boolean")'),
6366
(FieldDataType.DATETIME, 'factory.Faker("date_time")'),
6467
(FieldDataType.UUID, None),

uv.lock

Lines changed: 8 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)