gd-tools-cli 0.1.1__tar.gz → 0.1.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {gd_tools_cli-0.1.1 → gd_tools_cli-0.1.2}/PKG-INFO +1 -1
- {gd_tools_cli-0.1.1 → gd_tools_cli-0.1.2}/pyproject.toml +2 -2
- {gd_tools_cli-0.1.1 → gd_tools_cli-0.1.2}/src/gd_tools/addons/gd-tools-coverage/post_run_hook.gd +4 -2
- {gd_tools_cli-0.1.1 → gd_tools_cli-0.1.2}/src/gd_tools/cli.py +23 -0
- {gd_tools_cli-0.1.1 → gd_tools_cli-0.1.2}/src/gd_tools/config.py +2 -6
- {gd_tools_cli-0.1.1 → gd_tools_cli-0.1.2}/src/gd_tools/coverage/html_reporter.py +1 -1
- {gd_tools_cli-0.1.1 → gd_tools_cli-0.1.2}/src/gd_tools/coverage/lcov_reporter.py +1 -1
- {gd_tools_cli-0.1.1 → gd_tools_cli-0.1.2}/src/gd_tools/coverage/orchestrator.py +2 -7
- {gd_tools_cli-0.1.1 → gd_tools_cli-0.1.2}/src/gd_tools/init.py +2 -2
- {gd_tools_cli-0.1.1 → gd_tools_cli-0.1.2}/src/gd_tools_cli.egg-info/PKG-INFO +1 -1
- {gd_tools_cli-0.1.1 → gd_tools_cli-0.1.2}/README.md +0 -0
- {gd_tools_cli-0.1.1 → gd_tools_cli-0.1.2}/setup.cfg +0 -0
- {gd_tools_cli-0.1.1 → gd_tools_cli-0.1.2}/src/gd_tools/__init__.py +0 -0
- {gd_tools_cli-0.1.1 → gd_tools_cli-0.1.2}/src/gd_tools/__main__.py +0 -0
- {gd_tools_cli-0.1.1 → gd_tools_cli-0.1.2}/src/gd_tools/addons/__init__.py +0 -0
- {gd_tools_cli-0.1.1 → gd_tools_cli-0.1.2}/src/gd_tools/addons/gd-tools-coverage/coverage.gd +0 -0
- {gd_tools_cli-0.1.1 → gd_tools_cli-0.1.2}/src/gd_tools/addons/gd-tools-coverage/pre_run_hook.gd +0 -0
- {gd_tools_cli-0.1.1 → gd_tools_cli-0.1.2}/src/gd_tools/coverage/__init__.py +0 -0
- {gd_tools_cli-0.1.1 → gd_tools_cli-0.1.2}/src/gd_tools/coverage/cobertura_reporter.py +0 -0
- {gd_tools_cli-0.1.1 → gd_tools_cli-0.1.2}/src/gd_tools/coverage/plan_generator.py +0 -0
- {gd_tools_cli-0.1.1 → gd_tools_cli-0.1.2}/src/gd_tools/coverage/reporter.py +0 -0
- {gd_tools_cli-0.1.1 → gd_tools_cli-0.1.2}/src/gd_tools/coverage/templates/file.html +0 -0
- {gd_tools_cli-0.1.1 → gd_tools_cli-0.1.2}/src/gd_tools/coverage/templates/index.html +0 -0
- {gd_tools_cli-0.1.1 → gd_tools_cli-0.1.2}/src/gd_tools/coverage/terminal_reporter.py +0 -0
- {gd_tools_cli-0.1.1 → gd_tools_cli-0.1.2}/src/gd_tools/doctor.py +0 -0
- {gd_tools_cli-0.1.1 → gd_tools_cli-0.1.2}/src/gd_tools/errors.py +0 -0
- {gd_tools_cli-0.1.1 → gd_tools_cli-0.1.2}/src/gd_tools/file_discovery.py +0 -0
- {gd_tools_cli-0.1.1 → gd_tools_cli-0.1.2}/src/gd_tools/format_runner.py +0 -0
- {gd_tools_cli-0.1.1 → gd_tools_cli-0.1.2}/src/gd_tools/godot.py +0 -0
- {gd_tools_cli-0.1.1 → gd_tools_cli-0.1.2}/src/gd_tools/lint_runner.py +0 -0
- {gd_tools_cli-0.1.1 → gd_tools_cli-0.1.2}/src/gd_tools/test_runner.py +0 -0
- {gd_tools_cli-0.1.1 → gd_tools_cli-0.1.2}/src/gd_tools_cli.egg-info/SOURCES.txt +0 -0
- {gd_tools_cli-0.1.1 → gd_tools_cli-0.1.2}/src/gd_tools_cli.egg-info/dependency_links.txt +0 -0
- {gd_tools_cli-0.1.1 → gd_tools_cli-0.1.2}/src/gd_tools_cli.egg-info/entry_points.txt +0 -0
- {gd_tools_cli-0.1.1 → gd_tools_cli-0.1.2}/src/gd_tools_cli.egg-info/requires.txt +0 -0
- {gd_tools_cli-0.1.1 → gd_tools_cli-0.1.2}/src/gd_tools_cli.egg-info/top_level.txt +0 -0
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "gd-tools-cli"
|
|
7
|
-
version = "0.1.
|
|
7
|
+
version = "0.1.2"
|
|
8
8
|
description = "A modern development workflow CLI for GDScript projects in Godot 4.5+"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = {text = "MIT"}
|
|
@@ -98,7 +98,7 @@ target-version = ["py310"]
|
|
|
98
98
|
|
|
99
99
|
[tool.commitizen]
|
|
100
100
|
name = "cz_conventional_commits"
|
|
101
|
-
version = "0.1.
|
|
101
|
+
version = "0.1.2"
|
|
102
102
|
version_files = ["pyproject.toml:version"]
|
|
103
103
|
changelog_file = "CHANGELOG.md"
|
|
104
104
|
tag_format = "v$version"
|
{gd_tools_cli-0.1.1 → gd_tools_cli-0.1.2}/src/gd_tools/addons/gd-tools-coverage/post_run_hook.gd
RENAMED
|
@@ -96,15 +96,17 @@ func _write_json(path: String, data: Dictionary) -> bool:
|
|
|
96
96
|
return true
|
|
97
97
|
|
|
98
98
|
|
|
99
|
-
func _log_summary(hits: Dictionary, output_path: String) ->
|
|
99
|
+
func _log_summary(hits: Dictionary, output_path: String) -> String:
|
|
100
100
|
var total_files: int = hits.size()
|
|
101
101
|
var total_lines: int = 0
|
|
102
102
|
for file_id in hits:
|
|
103
103
|
total_lines += hits[file_id].size()
|
|
104
|
-
|
|
104
|
+
var summary = (
|
|
105
105
|
"[gd-tools] Coverage summary: %d files, %d lines tracked, output: %s"
|
|
106
106
|
% [total_files, total_lines, output_path]
|
|
107
107
|
)
|
|
108
|
+
print(summary)
|
|
109
|
+
return summary
|
|
108
110
|
|
|
109
111
|
|
|
110
112
|
func _log_error(what: String, cause: String, fix: String) -> void:
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"""CLI entry point for gd-tools."""
|
|
2
2
|
|
|
3
|
+
import sys
|
|
3
4
|
from pathlib import Path
|
|
4
5
|
from typing import Any
|
|
5
6
|
|
|
@@ -28,6 +29,28 @@ from .lint_runner import format_lint_json, format_lint_text, run_lint
|
|
|
28
29
|
from .test_runner import run_tests
|
|
29
30
|
|
|
30
31
|
|
|
32
|
+
def _configure_windows_utf8() -> None:
|
|
33
|
+
"""Reconfigure stdout/stderr to UTF-8 on Windows.
|
|
34
|
+
|
|
35
|
+
Windows defaults to the system codepage (e.g. cp1252) for console
|
|
36
|
+
output, which cannot encode Unicode characters used by Rich (✓, ✗,
|
|
37
|
+
⚠). This reconfigures the standard streams to UTF-8, matching the
|
|
38
|
+
effect of setting PYTHONUTF8=1.
|
|
39
|
+
"""
|
|
40
|
+
if sys.platform != "win32":
|
|
41
|
+
return
|
|
42
|
+
for stream in (sys.stdout, sys.stderr):
|
|
43
|
+
reconfigure = getattr(stream, "reconfigure", None)
|
|
44
|
+
if reconfigure is not None:
|
|
45
|
+
try:
|
|
46
|
+
reconfigure(encoding="utf-8")
|
|
47
|
+
except (ValueError, OSError):
|
|
48
|
+
pass
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
_configure_windows_utf8()
|
|
52
|
+
|
|
53
|
+
|
|
31
54
|
class GdToolsGroup(click.Group):
|
|
32
55
|
"""Custom Click group that converts NotImplementedError to exit code 2.
|
|
33
56
|
|
|
@@ -267,9 +267,7 @@ def generate_gdlintrc(
|
|
|
267
267
|
project_root: Path to the project root directory.
|
|
268
268
|
"""
|
|
269
269
|
rc_file = project_root / "gdlintrc"
|
|
270
|
-
rc_file.write_text(
|
|
271
|
-
gdlintrc_content(config), encoding="utf-8"
|
|
272
|
-
)
|
|
270
|
+
rc_file.write_text(gdlintrc_content(config), encoding="utf-8")
|
|
273
271
|
|
|
274
272
|
|
|
275
273
|
def gdlintrc_content(config: GdToolsConfig) -> str:
|
|
@@ -300,9 +298,7 @@ def generate_gdformatrc(
|
|
|
300
298
|
project_root: Path to the project root directory.
|
|
301
299
|
"""
|
|
302
300
|
rc_file = project_root / "gdformatrc"
|
|
303
|
-
rc_file.write_text(
|
|
304
|
-
gdformatrc_content(config), encoding="utf-8"
|
|
305
|
-
)
|
|
301
|
+
rc_file.write_text(gdformatrc_content(config), encoding="utf-8")
|
|
306
302
|
|
|
307
303
|
|
|
308
304
|
def gdformatrc_content(config: GdToolsConfig) -> str:
|
|
@@ -38,7 +38,7 @@ def _read_source_lines(res_path: str) -> list[str]:
|
|
|
38
38
|
or an empty list if the file is not accessible.
|
|
39
39
|
"""
|
|
40
40
|
if res_path.startswith("res://"):
|
|
41
|
-
res_path = res_path[len("res://"):]
|
|
41
|
+
res_path = res_path[len("res://") :]
|
|
42
42
|
fs_path = Path(res_path)
|
|
43
43
|
if not fs_path.exists():
|
|
44
44
|
return []
|
|
@@ -61,7 +61,7 @@ def _generate_file_records(
|
|
|
61
61
|
# Convert res:// path to relative filesystem path for genhtml compat
|
|
62
62
|
sf_path = file_plan.path
|
|
63
63
|
if sf_path.startswith("res://"):
|
|
64
|
-
sf_path = sf_path[len("res://"):]
|
|
64
|
+
sf_path = sf_path[len("res://") :]
|
|
65
65
|
|
|
66
66
|
records: list[str] = [f"SF:{sf_path}"]
|
|
67
67
|
|
|
@@ -76,7 +76,6 @@ def run_coverage_test(
|
|
|
76
76
|
# Generate and write instrumentation plan.
|
|
77
77
|
plan = plan_generator.generate_plan(
|
|
78
78
|
str(project_root),
|
|
79
|
-
None,
|
|
80
79
|
config.coverage.exclude,
|
|
81
80
|
config.coverage.test_dirs,
|
|
82
81
|
)
|
|
@@ -105,12 +104,8 @@ def run_coverage_test(
|
|
|
105
104
|
# instead of the CoveragePlanError — the test failure is the root
|
|
106
105
|
# cause and the missing file is just a side effect.
|
|
107
106
|
try:
|
|
108
|
-
data = reporter.read_coverage_json(
|
|
109
|
-
|
|
110
|
-
)
|
|
111
|
-
plan = plan_generator.read_plan_json(
|
|
112
|
-
str(output_dir / "plan.json")
|
|
113
|
-
)
|
|
107
|
+
data = reporter.read_coverage_json(output_dir / "coverage.json")
|
|
108
|
+
plan = plan_generator.read_plan_json(str(output_dir / "plan.json"))
|
|
114
109
|
except CoveragePlanError:
|
|
115
110
|
if test_error is not None:
|
|
116
111
|
raise test_error
|
|
@@ -274,7 +274,7 @@ def enable_gut_plugin(project_root: Path) -> None:
|
|
|
274
274
|
# Use regex to match only within enabled=PackedStringArray(...),
|
|
275
275
|
# not in comments or other contexts.
|
|
276
276
|
if re.search(
|
|
277
|
-
rf
|
|
277
|
+
rf"enabled=PackedStringArray\([^\)]*{re.escape(gut_entry)}",
|
|
278
278
|
content,
|
|
279
279
|
):
|
|
280
280
|
return
|
|
@@ -358,7 +358,7 @@ def register_coverage_autoload(project_root: Path) -> None:
|
|
|
358
358
|
# Use regex to match only at start of line (after optional
|
|
359
359
|
# whitespace), not in comments.
|
|
360
360
|
if re.search(
|
|
361
|
-
rf
|
|
361
|
+
rf"^\s*{re.escape(autoload_entry)}",
|
|
362
362
|
content,
|
|
363
363
|
re.MULTILINE,
|
|
364
364
|
):
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{gd_tools_cli-0.1.1 → gd_tools_cli-0.1.2}/src/gd_tools/addons/gd-tools-coverage/pre_run_hook.gd
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|