domd 2.2.4__tar.gz → 2.2.5__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.
- {domd-2.2.4 → domd-2.2.5}/PKG-INFO +1 -1
- {domd-2.2.4 → domd-2.2.5}/pyproject.toml +1 -1
- {domd-2.2.4 → domd-2.2.5}/src/domd/core/project_detection/detector.py +21 -9
- {domd-2.2.4 → domd-2.2.5}/src/domd/parsers/package_json.py +20 -9
- {domd-2.2.4 → domd-2.2.5}/LICENSE +0 -0
- {domd-2.2.4 → domd-2.2.5}/README.md +0 -0
- {domd-2.2.4 → domd-2.2.5}/src/domd/__init__.py +0 -0
- {domd-2.2.4 → domd-2.2.5}/src/domd/adapters/__init__.py +0 -0
- {domd-2.2.4 → domd-2.2.5}/src/domd/adapters/api/__init__.py +0 -0
- {domd-2.2.4 → domd-2.2.5}/src/domd/adapters/api/flask_api.py +0 -0
- {domd-2.2.4 → domd-2.2.5}/src/domd/adapters/cli/__init__.py +0 -0
- {domd-2.2.4 → domd-2.2.5}/src/domd/adapters/cli/command_presenter.py +0 -0
- {domd-2.2.4 → domd-2.2.5}/src/domd/adapters/formatters/__init__.py +0 -0
- {domd-2.2.4 → domd-2.2.5}/src/domd/adapters/formatters/markdown_formatter.py +0 -0
- {domd-2.2.4 → domd-2.2.5}/src/domd/adapters/persistence/__init__.py +0 -0
- {domd-2.2.4 → domd-2.2.5}/src/domd/adapters/persistence/in_memory_command_repository.py +0 -0
- {domd-2.2.4 → domd-2.2.5}/src/domd/adapters/persistence/shell_command_executor.py +0 -0
- {domd-2.2.4 → domd-2.2.5}/src/domd/api.py +0 -0
- {domd-2.2.4 → domd-2.2.5}/src/domd/application/__init__.py +0 -0
- {domd-2.2.4 → domd-2.2.5}/src/domd/application/factory.py +0 -0
- {domd-2.2.4 → domd-2.2.5}/src/domd/cli.py +0 -0
- {domd-2.2.4 → domd-2.2.5}/src/domd/command_execution/__init__.py +0 -0
- {domd-2.2.4 → domd-2.2.5}/src/domd/core/__init__.py +0 -0
- {domd-2.2.4 → domd-2.2.5}/src/domd/core/command_execution/__init__.py +0 -0
- {domd-2.2.4 → domd-2.2.5}/src/domd/core/command_execution/command_executor.py +0 -0
- {domd-2.2.4 → domd-2.2.5}/src/domd/core/command_execution/command_recorder.py +0 -0
- {domd-2.2.4 → domd-2.2.5}/src/domd/core/command_execution/command_runner.py +0 -0
- {domd-2.2.4 → domd-2.2.5}/src/domd/core/command_execution/environment_detector.py +0 -0
- {domd-2.2.4 → domd-2.2.5}/src/domd/core/command_execution/executor.py +0 -0
- {domd-2.2.4 → domd-2.2.5}/src/domd/core/commands/__init__.py +0 -0
- {domd-2.2.4 → domd-2.2.5}/src/domd/core/commands/command.py +0 -0
- {domd-2.2.4 → domd-2.2.5}/src/domd/core/commands/executor.py +0 -0
- {domd-2.2.4 → domd-2.2.5}/src/domd/core/detector.py +0 -0
- {domd-2.2.4 → domd-2.2.5}/src/domd/core/domain/__init__.py +0 -0
- {domd-2.2.4 → domd-2.2.5}/src/domd/core/domain/command.py +0 -0
- {domd-2.2.4 → domd-2.2.5}/src/domd/core/parsers/__init__.py +0 -0
- {domd-2.2.4 → domd-2.2.5}/src/domd/core/parsers/ansible_galaxy.py +0 -0
- {domd-2.2.4 → domd-2.2.5}/src/domd/core/parsers/ansible_inventory.py +0 -0
- {domd-2.2.4 → domd-2.2.5}/src/domd/core/parsers/ansible_playbook.py +0 -0
- {domd-2.2.4 → domd-2.2.5}/src/domd/core/parsers/ansible_role.py +0 -0
- {domd-2.2.4 → domd-2.2.5}/src/domd/core/parsers/ansible_vault.py +0 -0
- {domd-2.2.4 → domd-2.2.5}/src/domd/core/parsers/base.py +0 -0
- {domd-2.2.4 → domd-2.2.5}/src/domd/core/parsers/cargo_toml.py +0 -0
- {domd-2.2.4 → domd-2.2.5}/src/domd/core/parsers/composer_json.py +0 -0
- {domd-2.2.4 → domd-2.2.5}/src/domd/core/parsers/go_mod.py +0 -0
- {domd-2.2.4 → domd-2.2.5}/src/domd/core/parsers/makefile.py +0 -0
- {domd-2.2.4 → domd-2.2.5}/src/domd/core/parsers/package_json.py +0 -0
- {domd-2.2.4 → domd-2.2.5}/src/domd/core/parsers/pyproject_toml.py +0 -0
- {domd-2.2.4 → domd-2.2.5}/src/domd/core/parsers/tox_ini.py +0 -0
- {domd-2.2.4 → domd-2.2.5}/src/domd/core/parsing/__init__.py +0 -0
- {domd-2.2.4 → domd-2.2.5}/src/domd/core/parsing/base.py +0 -0
- {domd-2.2.4 → domd-2.2.5}/src/domd/core/parsing/file_processor.py +0 -0
- {domd-2.2.4 → domd-2.2.5}/src/domd/core/parsing/parser_registry.py +0 -0
- {domd-2.2.4 → domd-2.2.5}/src/domd/core/parsing/pattern_matcher.py +0 -0
- {domd-2.2.4 → domd-2.2.5}/src/domd/core/ports/__init__.py +0 -0
- {domd-2.2.4 → domd-2.2.5}/src/domd/core/ports/command_executor.py +0 -0
- {domd-2.2.4 → domd-2.2.5}/src/domd/core/ports/command_repository.py +0 -0
- {domd-2.2.4 → domd-2.2.5}/src/domd/core/ports/report_formatter.py +0 -0
- {domd-2.2.4 → domd-2.2.5}/src/domd/core/project_detection/__init__.py +0 -0
- {domd-2.2.4 → domd-2.2.5}/src/domd/core/project_detection/command_handling.py +0 -0
- {domd-2.2.4 → domd-2.2.5}/src/domd/core/project_detection/config_files.py +0 -0
- {domd-2.2.4 → domd-2.2.5}/src/domd/core/project_detection/virtualenv.py +0 -0
- {domd-2.2.4 → domd-2.2.5}/src/domd/core/reporters/__init__.py +0 -0
- {domd-2.2.4 → domd-2.2.5}/src/domd/core/reporters/base.py +0 -0
- {domd-2.2.4 → domd-2.2.5}/src/domd/core/reporters/done_md.py +0 -0
- {domd-2.2.4 → domd-2.2.5}/src/domd/core/reporters/todo_md.py +0 -0
- {domd-2.2.4 → domd-2.2.5}/src/domd/core/reporting/__init__.py +0 -0
- {domd-2.2.4 → domd-2.2.5}/src/domd/core/reporting/formatters.py +0 -0
- {domd-2.2.4 → domd-2.2.5}/src/domd/core/reporting/reporter.py +0 -0
- {domd-2.2.4 → domd-2.2.5}/src/domd/core/services/__init__.py +0 -0
- {domd-2.2.4 → domd-2.2.5}/src/domd/core/services/command_service.py +0 -0
- {domd-2.2.4 → domd-2.2.5}/src/domd/core/services/report_service.py +0 -0
- {domd-2.2.4 → domd-2.2.5}/src/domd/core/utils/__init__.py +0 -0
- {domd-2.2.4 → domd-2.2.5}/src/domd/core/utils/command_utils.py +0 -0
- {domd-2.2.4 → domd-2.2.5}/src/domd/core/utils/environment.py +0 -0
- {domd-2.2.4 → domd-2.2.5}/src/domd/core/utils/file_utils.py +0 -0
- {domd-2.2.4 → domd-2.2.5}/src/domd/core/utils/logging_utils.py +0 -0
- {domd-2.2.4 → domd-2.2.5}/src/domd/core/utils/virtualenv.py +0 -0
- {domd-2.2.4 → domd-2.2.5}/src/domd/parsers/__init__.py +0 -0
- {domd-2.2.4 → domd-2.2.5}/src/domd/parsers/ansible.py +0 -0
- {domd-2.2.4 → domd-2.2.5}/src/domd/parsers/base.py +0 -0
- {domd-2.2.4 → domd-2.2.5}/src/domd/parsers/build_systems.py +0 -0
- {domd-2.2.4 → domd-2.2.5}/src/domd/parsers/ci_cd.py +0 -0
- {domd-2.2.4 → domd-2.2.5}/src/domd/parsers/docker/__init__.py +0 -0
- {domd-2.2.4 → domd-2.2.5}/src/domd/parsers/docker/docker_compose.py +0 -0
- {domd-2.2.4 → domd-2.2.5}/src/domd/parsers/docker/dockerfile.py +0 -0
- {domd-2.2.4 → domd-2.2.5}/src/domd/parsers/docker.py +0 -0
- {domd-2.2.4 → domd-2.2.5}/src/domd/parsers/javascript/__init__.py +0 -0
- {domd-2.2.4 → domd-2.2.5}/src/domd/parsers/javascript.py +0 -0
- {domd-2.2.4 → domd-2.2.5}/src/domd/parsers/python.py +0 -0
- {domd-2.2.4 → domd-2.2.5}/src/domd/parsers/test_build_systems.py +0 -0
- {domd-2.2.4 → domd-2.2.5}/src/domd/parsers/test_ci_cd.py +0 -0
- {domd-2.2.4 → domd-2.2.5}/src/domd/parsers/test_docker.py +0 -0
- {domd-2.2.4 → domd-2.2.5}/src/domd/parsers/test_javascript.py +0 -0
- {domd-2.2.4 → domd-2.2.5}/src/domd/parsers/test_python.py +0 -0
- {domd-2.2.4 → domd-2.2.5}/src/domd/parsing/__init__.py +0 -0
- {domd-2.2.4 → domd-2.2.5}/src/domd/parsing/base.py +0 -0
- {domd-2.2.4 → domd-2.2.5}/src/domd/reporters/__init__.py +0 -0
- {domd-2.2.4 → domd-2.2.5}/src/domd/reporters/console.py +0 -0
- {domd-2.2.4 → domd-2.2.5}/src/domd/reporters/json_reporter.py +0 -0
- {domd-2.2.4 → domd-2.2.5}/src/domd/reporters/test_console.py +0 -0
- {domd-2.2.4 → domd-2.2.5}/src/domd/reporters/test_json_reporter.py +0 -0
- {domd-2.2.4 → domd-2.2.5}/src/domd/reporters/test_todo_md.py +0 -0
- {domd-2.2.4 → domd-2.2.5}/src/domd/reporters/todo_md.py +0 -0
- {domd-2.2.4 → domd-2.2.5}/src/domd/reporting/__init__.py +0 -0
- {domd-2.2.4 → domd-2.2.5}/src/domd/utils/__init__.py +0 -0
- {domd-2.2.4 → domd-2.2.5}/src/domd/utils/command_runner.py +0 -0
- {domd-2.2.4 → domd-2.2.5}/src/domd/utils/file_utils.py +0 -0
- {domd-2.2.4 → domd-2.2.5}/src/domd/utils/test_command_runner.py +0 -0
- {domd-2.2.4 → domd-2.2.5}/src/domd/utils/test_file_utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "domd"
|
|
3
|
-
version = "2.2.
|
|
3
|
+
version = "2.2.5"
|
|
4
4
|
description = "Project Command Detector - Automatically detects and tests project commands, generates TODO.md for failed commands"
|
|
5
5
|
authors = ["Tom Sapletta <info@softreck.dev>"]
|
|
6
6
|
maintainers = ["WRONAI Team"]
|
|
@@ -287,20 +287,32 @@ class ProjectCommandDetector:
|
|
|
287
287
|
return commands
|
|
288
288
|
|
|
289
289
|
try:
|
|
290
|
-
#
|
|
291
|
-
|
|
290
|
+
# Set the file_path on the parser if it has that attribute
|
|
291
|
+
if hasattr(parser, "file_path"):
|
|
292
|
+
parser.file_path = str(file_path)
|
|
292
293
|
|
|
293
|
-
# Parse commands from file
|
|
294
|
+
# Parse commands from file
|
|
294
295
|
file_commands = []
|
|
295
296
|
if hasattr(parser, "parse_file") and callable(parser.parse_file):
|
|
296
|
-
file_commands = parser.parse_file(file_path)
|
|
297
|
+
file_commands = parser.parse_file(str(file_path))
|
|
297
298
|
elif hasattr(parser, "parse") and callable(parser.parse):
|
|
298
|
-
#
|
|
299
|
+
# First try without arguments (parser will handle file reading)
|
|
299
300
|
try:
|
|
300
|
-
file_commands = parser.parse(
|
|
301
|
-
except TypeError:
|
|
302
|
-
#
|
|
303
|
-
|
|
301
|
+
file_commands = parser.parse()
|
|
302
|
+
except (TypeError, AttributeError):
|
|
303
|
+
# If that fails, try with file path
|
|
304
|
+
try:
|
|
305
|
+
file_commands = parser.parse(str(file_path))
|
|
306
|
+
except (TypeError, AttributeError):
|
|
307
|
+
# As a last resort, try with file content
|
|
308
|
+
try:
|
|
309
|
+
content = file_path.read_text(encoding="utf-8")
|
|
310
|
+
file_commands = parser.parse(content)
|
|
311
|
+
except Exception as e:
|
|
312
|
+
logger.error(
|
|
313
|
+
f"Error parsing {file_path} with content: {e}"
|
|
314
|
+
)
|
|
315
|
+
return []
|
|
304
316
|
|
|
305
317
|
# Add file path to commands if not already present
|
|
306
318
|
for cmd in file_commands:
|
|
@@ -30,12 +30,15 @@ class PackageJsonParser(BaseParser):
|
|
|
30
30
|
supported_file_patterns = ["package.json"]
|
|
31
31
|
|
|
32
32
|
def parse(
|
|
33
|
-
self,
|
|
33
|
+
self,
|
|
34
|
+
file_path: Optional[Union[str, Path]] = None,
|
|
35
|
+
content: Optional[str] = None,
|
|
34
36
|
) -> List[Dict[str, Any]]:
|
|
35
37
|
"""Parse package.json and extract npm scripts.
|
|
36
38
|
|
|
37
39
|
Args:
|
|
38
40
|
file_path: Path to the file to parse (overrides self.file_path if provided)
|
|
41
|
+
content: Optional content to parse instead of reading from file
|
|
39
42
|
|
|
40
43
|
Returns:
|
|
41
44
|
List of command dictionaries with 'command', 'description', 'source', and 'type' keys
|
|
@@ -43,15 +46,24 @@ class PackageJsonParser(BaseParser):
|
|
|
43
46
|
if file_path is not None:
|
|
44
47
|
self.file_path = Path(file_path).resolve()
|
|
45
48
|
|
|
46
|
-
if
|
|
47
|
-
|
|
48
|
-
|
|
49
|
+
if content is None:
|
|
50
|
+
if self.file_path is None or not self.file_path.exists():
|
|
51
|
+
logging.warning(f"File not found: {self.file_path}")
|
|
52
|
+
return []
|
|
53
|
+
try:
|
|
54
|
+
content = self.file_path.read_text(encoding="utf-8")
|
|
55
|
+
except Exception as e:
|
|
56
|
+
logging.error(f"Error reading file {self.file_path}: {e}")
|
|
57
|
+
return []
|
|
49
58
|
|
|
50
59
|
self.initialize()
|
|
51
|
-
return self._parse_commands()
|
|
60
|
+
return self._parse_commands(content)
|
|
52
61
|
|
|
53
|
-
def _parse_commands(self) -> List[Dict[str, Any]]:
|
|
54
|
-
"""Parse commands from package.json.
|
|
62
|
+
def _parse_commands(self, content: str) -> List[Dict[str, Any]]:
|
|
63
|
+
"""Parse commands from package.json content.
|
|
64
|
+
|
|
65
|
+
Args:
|
|
66
|
+
content: The content of the package.json file
|
|
55
67
|
|
|
56
68
|
Returns:
|
|
57
69
|
List of command dictionaries with 'command', 'description', 'source', and 'type' keys
|
|
@@ -59,8 +71,7 @@ class PackageJsonParser(BaseParser):
|
|
|
59
71
|
commands = []
|
|
60
72
|
|
|
61
73
|
try:
|
|
62
|
-
|
|
63
|
-
data = json.load(f)
|
|
74
|
+
data = json.loads(content)
|
|
64
75
|
|
|
65
76
|
# Extract scripts
|
|
66
77
|
scripts = data.get("scripts", {})
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|