Skip to content

Commit fd5480d

Browse files
author
Scott Long
committed
fixes inlined string enums
1 parent bc93d7b commit fd5480d

420 files changed

Lines changed: 1949 additions & 1129 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,6 @@ __pycache__
4949
.coverage
5050
.coverage.*
5151
.tox
52-
.venv/
52+
.venv/
53+
54+
coverage.xml

README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,35 @@ pytest -q
144144
- No editable install (`pip install -e .`) is required just to run tests, but you can still use it for development if preferred.
145145
- Add new generator tests in `tests/` following existing patterns; prefer focused assertions on generated code snippets.
146146

147+
#### Coverage Testing
148+
149+
The project includes code coverage measurement to ensure test quality:
150+
151+
```bash
152+
# Run tests with coverage report
153+
pytest --cov=src --cov-report=term
154+
155+
# Generate HTML coverage report
156+
pytest --cov=src --cov-report=html
157+
158+
# Generate XML coverage report (for CI/CD)
159+
pytest --cov=src --cov-report=xml
160+
```
161+
162+
Coverage reports help identify:
163+
164+
- **Untested code paths**: Functions or branches not executed during tests
165+
- **Test effectiveness**: Areas where additional test cases might be valuable
166+
- **Regression prevention**: Ensuring new code includes appropriate tests
167+
168+
The HTML report (in `coverage_html/index.html`) provides an interactive view showing:
169+
170+
- Overall coverage percentage by file and line
171+
- Missing coverage highlighted in red
172+
- Branch coverage for conditional logic
173+
174+
**Current coverage target**: Aim for >80% line coverage on generator modules, >60% overall.
175+
147176
#### Troubleshooting
148177

149178
- If imports fail, ensure `src/` is present and you launched pytest from the project root.

__init__.py

Lines changed: 0 additions & 7 deletions
This file was deleted.

pyproject.toml

Lines changed: 11 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -2,73 +2,39 @@
22
requires = ["setuptools>=42", "wheel"]
33
build-backend = "setuptools.build_meta"
44

5-
[tool.setuptools]
6-
packages = {find = {where = ["src"]}}
7-
package-dir = {"" = "src"}
8-
9-
[tool.setuptools.dynamic]
10-
version = {attr = "__version__.__version__"}
11-
dependencies = {file = ["requirements.txt"]}
12-
13-
[tool.setuptools.package-data]
14-
"*" = ["py.typed"]kend = "setuptools.build_meta"
15-
165
[project]
176
name = "schema2code"
18-
dynamic = ["version", "dependencies"]
7+
version = "0.1.0"
198
description = "A tool for converting JSON schema files to type definitions in various programming languages"
209
authors = [
2110
{name = "Scott Long", email = "longstoryscott@gmail.com"},
2211
]
2312
readme = "README.md"
24-
license = {file = "LICENSE"}
25-
requires-python = ">=3.8"
26-
keywords = ["json-schema", "code-generation", "typescript", "go", "python", "csharp", "protobuf"]
13+
requires-python = ">=3.6"
2714
classifiers = [
28-
"Development Status :: 4 - Beta",
15+
"Development Status :: 3 - Alpha",
2916
"Intended Audience :: Developers",
30-
"License :: OSI Approved :: MIT License",
3117
"Programming Language :: Python :: 3",
18+
"Programming Language :: Python :: 3.6",
19+
"Programming Language :: Python :: 3.7",
3220
"Programming Language :: Python :: 3.8",
3321
"Programming Language :: Python :: 3.9",
34-
"Programming Language :: Python :: 3.10",
35-
"Programming Language :: Python :: 3.11",
36-
"Programming Language :: Python :: 3.12",
37-
"Topic :: Software Development :: Code Generators",
38-
"Topic :: Software Development :: Libraries :: Python Modules",
3922
]
23+
dynamic = ["dependencies"]
4024

4125
[project.optional-dependencies]
4226
dev = [
43-
"pytest>=7.0",
44-
"pytest-cov>=4.0",
45-
"black>=22.0",
46-
"flake8>=5.0",
47-
"mypy>=1.0",
48-
"twine>=4.0",
49-
"build>=0.10",
50-
]
51-
test = [
52-
"pytest>=7.0",
53-
"pytest-cov>=4.0",
27+
"pytest",
28+
"pytest-cov",
29+
"black",
30+
"flake8",
5431
]
5532

5633
[project.scripts]
5734
schema2code = "schema2code.main:main"
5835

59-
[project.urls]
60-
"Homepage" = "https://github.com/LongStoryMedia/schema2code"
61-
"Bug Reports" = "https://github.com/LongStoryMedia/schema2code/issues"
62-
"Source" = "https://github.com/LongStoryMedia/schema2code"
63-
"Documentation" = "https://github.com/LongStoryMedia/schema2code#readme"
64-
6536
[tool.setuptools]
66-
packages = {find = {where = ["src"], exclude = ["tests*"]}}
67-
package-dir = {"", "src"}
37+
packages = {find = {}}
6838

6939
[tool.setuptools.dynamic]
70-
version = {attr = "__version__.__version__"}
7140
dependencies = {file = ["requirements.txt"]}
72-
73-
[tool.setuptools.package-data]
74-
"*" = ["py.typed"]

sample_code/dotnet/AnalysisDepth.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Code generated by schema2code at 2025-09-18 14:55:40. DO NOT EDIT.
1+
// Code generated by schema2code at 2025-10-27 18:24:37. DO NOT EDIT.
22

33
using System;
44
using System.Collections.Generic;

sample_code/dotnet/AuthConfig.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Code generated by schema2code at 2025-09-18 14:55:32. DO NOT EDIT.
1+
// Code generated by schema2code at 2025-10-27 18:24:23. DO NOT EDIT.
22

33
using System;
44
using System.Collections.Generic;

sample_code/dotnet/AvailableTool.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Code generated by schema2code at 2025-09-18 14:55:31. DO NOT EDIT.
1+
// Code generated by schema2code at 2025-10-27 18:24:21. DO NOT EDIT.
22

33
using System;
44
using System.Collections.Generic;

sample_code/dotnet/ChatReq.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Code generated by schema2code at 2025-09-18 14:55:31. DO NOT EDIT.
1+
// Code generated by schema2code at 2025-10-27 18:24:22. DO NOT EDIT.
22

33
using System;
44
using System.Collections.Generic;

sample_code/dotnet/ChatResponse.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Code generated by schema2code at 2025-09-18 14:55:31. DO NOT EDIT.
1+
// Code generated by schema2code at 2025-10-27 18:24:22. DO NOT EDIT.
22

33
using System;
44
using System.Collections.Generic;

sample_code/dotnet/CircuitBreakerConfig.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Code generated by schema2code at 2025-09-18 14:55:40. DO NOT EDIT.
1+
// Code generated by schema2code at 2025-10-27 18:24:39. DO NOT EDIT.
22

33
using System;
44
using System.Collections.Generic;

0 commit comments

Comments
 (0)