domd 2.2.2__tar.gz → 2.2.3__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.2 → domd-2.2.3}/PKG-INFO +1 -1
- {domd-2.2.2 → domd-2.2.3}/pyproject.toml +1 -1
- {domd-2.2.2 → domd-2.2.3}/src/domd/core/project_detection/detector.py +52 -43
- {domd-2.2.2 → domd-2.2.3}/LICENSE +0 -0
- {domd-2.2.2 → domd-2.2.3}/README.md +0 -0
- {domd-2.2.2 → domd-2.2.3}/src/domd/__init__.py +0 -0
- {domd-2.2.2 → domd-2.2.3}/src/domd/adapters/__init__.py +0 -0
- {domd-2.2.2 → domd-2.2.3}/src/domd/adapters/api/__init__.py +0 -0
- {domd-2.2.2 → domd-2.2.3}/src/domd/adapters/api/flask_api.py +0 -0
- {domd-2.2.2 → domd-2.2.3}/src/domd/adapters/cli/__init__.py +0 -0
- {domd-2.2.2 → domd-2.2.3}/src/domd/adapters/cli/command_presenter.py +0 -0
- {domd-2.2.2 → domd-2.2.3}/src/domd/adapters/formatters/__init__.py +0 -0
- {domd-2.2.2 → domd-2.2.3}/src/domd/adapters/formatters/markdown_formatter.py +0 -0
- {domd-2.2.2 → domd-2.2.3}/src/domd/adapters/persistence/__init__.py +0 -0
- {domd-2.2.2 → domd-2.2.3}/src/domd/adapters/persistence/in_memory_command_repository.py +0 -0
- {domd-2.2.2 → domd-2.2.3}/src/domd/adapters/persistence/shell_command_executor.py +0 -0
- {domd-2.2.2 → domd-2.2.3}/src/domd/api.py +0 -0
- {domd-2.2.2 → domd-2.2.3}/src/domd/application/__init__.py +0 -0
- {domd-2.2.2 → domd-2.2.3}/src/domd/application/factory.py +0 -0
- {domd-2.2.2 → domd-2.2.3}/src/domd/cli.py +0 -0
- {domd-2.2.2 → domd-2.2.3}/src/domd/command_execution/__init__.py +0 -0
- {domd-2.2.2 → domd-2.2.3}/src/domd/core/__init__.py +0 -0
- {domd-2.2.2 → domd-2.2.3}/src/domd/core/command_execution/__init__.py +0 -0
- {domd-2.2.2 → domd-2.2.3}/src/domd/core/command_execution/command_executor.py +0 -0
- {domd-2.2.2 → domd-2.2.3}/src/domd/core/command_execution/command_recorder.py +0 -0
- {domd-2.2.2 → domd-2.2.3}/src/domd/core/command_execution/command_runner.py +0 -0
- {domd-2.2.2 → domd-2.2.3}/src/domd/core/command_execution/environment_detector.py +0 -0
- {domd-2.2.2 → domd-2.2.3}/src/domd/core/command_execution/executor.py +0 -0
- {domd-2.2.2 → domd-2.2.3}/src/domd/core/commands/__init__.py +0 -0
- {domd-2.2.2 → domd-2.2.3}/src/domd/core/commands/command.py +0 -0
- {domd-2.2.2 → domd-2.2.3}/src/domd/core/commands/executor.py +0 -0
- {domd-2.2.2 → domd-2.2.3}/src/domd/core/detector.py +0 -0
- {domd-2.2.2 → domd-2.2.3}/src/domd/core/domain/__init__.py +0 -0
- {domd-2.2.2 → domd-2.2.3}/src/domd/core/domain/command.py +0 -0
- {domd-2.2.2 → domd-2.2.3}/src/domd/core/parsers/__init__.py +0 -0
- {domd-2.2.2 → domd-2.2.3}/src/domd/core/parsers/ansible_galaxy.py +0 -0
- {domd-2.2.2 → domd-2.2.3}/src/domd/core/parsers/ansible_inventory.py +0 -0
- {domd-2.2.2 → domd-2.2.3}/src/domd/core/parsers/ansible_playbook.py +0 -0
- {domd-2.2.2 → domd-2.2.3}/src/domd/core/parsers/ansible_role.py +0 -0
- {domd-2.2.2 → domd-2.2.3}/src/domd/core/parsers/ansible_vault.py +0 -0
- {domd-2.2.2 → domd-2.2.3}/src/domd/core/parsers/base.py +0 -0
- {domd-2.2.2 → domd-2.2.3}/src/domd/core/parsers/cargo_toml.py +0 -0
- {domd-2.2.2 → domd-2.2.3}/src/domd/core/parsers/composer_json.py +0 -0
- {domd-2.2.2 → domd-2.2.3}/src/domd/core/parsers/go_mod.py +0 -0
- {domd-2.2.2 → domd-2.2.3}/src/domd/core/parsers/makefile.py +0 -0
- {domd-2.2.2 → domd-2.2.3}/src/domd/core/parsers/package_json.py +0 -0
- {domd-2.2.2 → domd-2.2.3}/src/domd/core/parsers/pyproject_toml.py +0 -0
- {domd-2.2.2 → domd-2.2.3}/src/domd/core/parsers/tox_ini.py +0 -0
- {domd-2.2.2 → domd-2.2.3}/src/domd/core/parsing/__init__.py +0 -0
- {domd-2.2.2 → domd-2.2.3}/src/domd/core/parsing/base.py +0 -0
- {domd-2.2.2 → domd-2.2.3}/src/domd/core/parsing/file_processor.py +0 -0
- {domd-2.2.2 → domd-2.2.3}/src/domd/core/parsing/parser_registry.py +0 -0
- {domd-2.2.2 → domd-2.2.3}/src/domd/core/parsing/pattern_matcher.py +0 -0
- {domd-2.2.2 → domd-2.2.3}/src/domd/core/ports/__init__.py +0 -0
- {domd-2.2.2 → domd-2.2.3}/src/domd/core/ports/command_executor.py +0 -0
- {domd-2.2.2 → domd-2.2.3}/src/domd/core/ports/command_repository.py +0 -0
- {domd-2.2.2 → domd-2.2.3}/src/domd/core/ports/report_formatter.py +0 -0
- {domd-2.2.2 → domd-2.2.3}/src/domd/core/project_detection/__init__.py +0 -0
- {domd-2.2.2 → domd-2.2.3}/src/domd/core/project_detection/command_handling.py +0 -0
- {domd-2.2.2 → domd-2.2.3}/src/domd/core/project_detection/config_files.py +0 -0
- {domd-2.2.2 → domd-2.2.3}/src/domd/core/project_detection/virtualenv.py +0 -0
- {domd-2.2.2 → domd-2.2.3}/src/domd/core/reporters/__init__.py +0 -0
- {domd-2.2.2 → domd-2.2.3}/src/domd/core/reporters/base.py +0 -0
- {domd-2.2.2 → domd-2.2.3}/src/domd/core/reporters/done_md.py +0 -0
- {domd-2.2.2 → domd-2.2.3}/src/domd/core/reporters/todo_md.py +0 -0
- {domd-2.2.2 → domd-2.2.3}/src/domd/core/reporting/__init__.py +0 -0
- {domd-2.2.2 → domd-2.2.3}/src/domd/core/reporting/formatters.py +0 -0
- {domd-2.2.2 → domd-2.2.3}/src/domd/core/reporting/reporter.py +0 -0
- {domd-2.2.2 → domd-2.2.3}/src/domd/core/services/__init__.py +0 -0
- {domd-2.2.2 → domd-2.2.3}/src/domd/core/services/command_service.py +0 -0
- {domd-2.2.2 → domd-2.2.3}/src/domd/core/services/report_service.py +0 -0
- {domd-2.2.2 → domd-2.2.3}/src/domd/core/utils/__init__.py +0 -0
- {domd-2.2.2 → domd-2.2.3}/src/domd/core/utils/command_utils.py +0 -0
- {domd-2.2.2 → domd-2.2.3}/src/domd/core/utils/environment.py +0 -0
- {domd-2.2.2 → domd-2.2.3}/src/domd/core/utils/file_utils.py +0 -0
- {domd-2.2.2 → domd-2.2.3}/src/domd/core/utils/logging_utils.py +0 -0
- {domd-2.2.2 → domd-2.2.3}/src/domd/core/utils/virtualenv.py +0 -0
- {domd-2.2.2 → domd-2.2.3}/src/domd/parsers/__init__.py +0 -0
- {domd-2.2.2 → domd-2.2.3}/src/domd/parsers/ansible.py +0 -0
- {domd-2.2.2 → domd-2.2.3}/src/domd/parsers/base.py +0 -0
- {domd-2.2.2 → domd-2.2.3}/src/domd/parsers/build_systems.py +0 -0
- {domd-2.2.2 → domd-2.2.3}/src/domd/parsers/ci_cd.py +0 -0
- {domd-2.2.2 → domd-2.2.3}/src/domd/parsers/docker/__init__.py +0 -0
- {domd-2.2.2 → domd-2.2.3}/src/domd/parsers/docker/docker_compose.py +0 -0
- {domd-2.2.2 → domd-2.2.3}/src/domd/parsers/docker/dockerfile.py +0 -0
- {domd-2.2.2 → domd-2.2.3}/src/domd/parsers/docker.py +0 -0
- {domd-2.2.2 → domd-2.2.3}/src/domd/parsers/javascript/__init__.py +0 -0
- {domd-2.2.2 → domd-2.2.3}/src/domd/parsers/javascript.py +0 -0
- {domd-2.2.2 → domd-2.2.3}/src/domd/parsers/package_json.py +0 -0
- {domd-2.2.2 → domd-2.2.3}/src/domd/parsers/python.py +0 -0
- {domd-2.2.2 → domd-2.2.3}/src/domd/parsers/test_build_systems.py +0 -0
- {domd-2.2.2 → domd-2.2.3}/src/domd/parsers/test_ci_cd.py +0 -0
- {domd-2.2.2 → domd-2.2.3}/src/domd/parsers/test_docker.py +0 -0
- {domd-2.2.2 → domd-2.2.3}/src/domd/parsers/test_javascript.py +0 -0
- {domd-2.2.2 → domd-2.2.3}/src/domd/parsers/test_python.py +0 -0
- {domd-2.2.2 → domd-2.2.3}/src/domd/parsing/__init__.py +0 -0
- {domd-2.2.2 → domd-2.2.3}/src/domd/parsing/base.py +0 -0
- {domd-2.2.2 → domd-2.2.3}/src/domd/reporters/__init__.py +0 -0
- {domd-2.2.2 → domd-2.2.3}/src/domd/reporters/console.py +0 -0
- {domd-2.2.2 → domd-2.2.3}/src/domd/reporters/json_reporter.py +0 -0
- {domd-2.2.2 → domd-2.2.3}/src/domd/reporters/test_console.py +0 -0
- {domd-2.2.2 → domd-2.2.3}/src/domd/reporters/test_json_reporter.py +0 -0
- {domd-2.2.2 → domd-2.2.3}/src/domd/reporters/test_todo_md.py +0 -0
- {domd-2.2.2 → domd-2.2.3}/src/domd/reporters/todo_md.py +0 -0
- {domd-2.2.2 → domd-2.2.3}/src/domd/reporting/__init__.py +0 -0
- {domd-2.2.2 → domd-2.2.3}/src/domd/utils/__init__.py +0 -0
- {domd-2.2.2 → domd-2.2.3}/src/domd/utils/command_runner.py +0 -0
- {domd-2.2.2 → domd-2.2.3}/src/domd/utils/file_utils.py +0 -0
- {domd-2.2.2 → domd-2.2.3}/src/domd/utils/test_command_runner.py +0 -0
- {domd-2.2.2 → domd-2.2.3}/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.3"
|
|
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"]
|
|
@@ -223,10 +223,19 @@ class ProjectCommandDetector:
|
|
|
223
223
|
all_commands: List to append found commands to
|
|
224
224
|
parent_dir: Name of parent directory (for second-level directories)
|
|
225
225
|
"""
|
|
226
|
+
logger.debug(f"Checking for README.md in: {directory}")
|
|
226
227
|
readme_path = directory / "README.md"
|
|
227
|
-
|
|
228
|
+
|
|
229
|
+
if not readme_path.exists():
|
|
230
|
+
logger.debug(f" README.md not found in {directory}")
|
|
231
|
+
return
|
|
232
|
+
|
|
233
|
+
if not readme_path.is_file():
|
|
234
|
+
logger.debug(f" README.md exists but is not a file in {directory}")
|
|
228
235
|
return
|
|
229
236
|
|
|
237
|
+
logger.info(f"Found README.md in directory: {directory}")
|
|
238
|
+
|
|
230
239
|
# Determine display path for logging and source
|
|
231
240
|
if parent_dir:
|
|
232
241
|
display_path = f"{parent_dir}/{directory.name}/README.md"
|
|
@@ -261,54 +270,41 @@ class ProjectCommandDetector:
|
|
|
261
270
|
file_path: Path to the file to process
|
|
262
271
|
|
|
263
272
|
Returns:
|
|
264
|
-
List of command dictionaries
|
|
273
|
+
List of command dictionaries with metadata
|
|
265
274
|
"""
|
|
275
|
+
logger.debug(f"Processing file: {file_path}")
|
|
266
276
|
commands = []
|
|
267
|
-
try:
|
|
268
|
-
# Try to get parser from registry first
|
|
269
|
-
parser = self.parser_registry.get_parser_for_file(file_path)
|
|
270
277
|
|
|
271
|
-
|
|
272
|
-
if not
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
if not parser:
|
|
276
|
-
logger.warning(f"No parser found for {file_path}")
|
|
278
|
+
try:
|
|
279
|
+
if not file_path.exists():
|
|
280
|
+
logger.warning(f"File not found: {file_path}")
|
|
277
281
|
return commands
|
|
278
282
|
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
with open(file_path, "r", encoding="utf-8") as f:
|
|
284
|
-
content = f.read()
|
|
285
|
-
except Exception as e:
|
|
286
|
-
logger.error(f"Error reading file {file_path}: {e}")
|
|
283
|
+
# Get the appropriate parser for the file
|
|
284
|
+
parser = self._get_parser_for_file(file_path)
|
|
285
|
+
if not parser:
|
|
286
|
+
logger.debug(f"No parser found for file: {file_path}")
|
|
287
287
|
return commands
|
|
288
288
|
|
|
289
|
-
# Set the file_path on the parser if it has that attribute
|
|
290
|
-
if hasattr(parser, "file_path"):
|
|
291
|
-
parser.file_path = file_path
|
|
292
|
-
|
|
293
|
-
# Try different ways to call the parse method
|
|
294
289
|
try:
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
290
|
+
# Read file content
|
|
291
|
+
content = file_path.read_text(encoding="utf-8")
|
|
292
|
+
|
|
293
|
+
# Parse commands from file content
|
|
294
|
+
file_commands = []
|
|
295
|
+
if hasattr(parser, "parse_file") and callable(parser.parse_file):
|
|
296
|
+
file_commands = parser.parse_file(file_path)
|
|
297
|
+
elif hasattr(parser, "parse") and callable(parser.parse):
|
|
298
|
+
# Try with content as string
|
|
299
|
+
try:
|
|
300
|
+
file_commands = parser.parse(content)
|
|
301
|
+
except TypeError:
|
|
302
|
+
# Last resort - try passing content as the first argument
|
|
303
|
+
file_commands = parser.parse(content)
|
|
308
304
|
|
|
309
305
|
# Add file path to commands if not already present
|
|
310
306
|
for cmd in file_commands:
|
|
311
|
-
if isinstance(cmd, dict)
|
|
307
|
+
if isinstance(cmd, dict):
|
|
312
308
|
cmd["file"] = str(file_path)
|
|
313
309
|
# Add relative path as source if not present
|
|
314
310
|
if "source" not in cmd:
|
|
@@ -352,20 +348,31 @@ class ProjectCommandDetector:
|
|
|
352
348
|
|
|
353
349
|
# 2. Scan first and second level subdirectories for README.md files
|
|
354
350
|
try:
|
|
351
|
+
logger.debug(f"Starting directory scan in: {self.project_path}")
|
|
355
352
|
# First level directories
|
|
356
|
-
for level1_item in self.project_path.iterdir():
|
|
353
|
+
for level1_item in sorted(self.project_path.iterdir()):
|
|
354
|
+
logger.debug(f"Checking first level item: {level1_item}")
|
|
357
355
|
if not level1_item.is_dir() or level1_item.name.startswith("."):
|
|
356
|
+
logger.debug(f"Skipping (not a directory or hidden): {level1_item}")
|
|
358
357
|
continue
|
|
359
358
|
|
|
359
|
+
logger.info(f"Processing first level directory: {level1_item.name}")
|
|
360
360
|
# Process level 1 README
|
|
361
361
|
self._process_directory_readme(level1_item, all_commands)
|
|
362
362
|
|
|
363
363
|
# Scan second level
|
|
364
364
|
try:
|
|
365
|
-
for level2_item in level1_item.iterdir():
|
|
365
|
+
for level2_item in sorted(level1_item.iterdir()):
|
|
366
|
+
logger.debug(f" Checking second level item: {level2_item}")
|
|
366
367
|
if not level2_item.is_dir() or level2_item.name.startswith("."):
|
|
368
|
+
logger.debug(
|
|
369
|
+
f" Skipping (not a directory or hidden): {level2_item}"
|
|
370
|
+
)
|
|
367
371
|
continue
|
|
368
372
|
|
|
373
|
+
logger.info(
|
|
374
|
+
f" Processing second level directory: {level1_item.name}/{level2_item.name}"
|
|
375
|
+
)
|
|
369
376
|
# Process level 2 README
|
|
370
377
|
self._process_directory_readme(
|
|
371
378
|
level2_item, all_commands, level1_item.name
|
|
@@ -377,6 +384,10 @@ class ProjectCommandDetector:
|
|
|
377
384
|
except Exception as e:
|
|
378
385
|
logger.error(f"Error scanning directories: {e}", exc_info=True)
|
|
379
386
|
|
|
387
|
+
logger.debug(
|
|
388
|
+
f"Finished directory scan. Found {len(all_commands)} commands total."
|
|
389
|
+
)
|
|
390
|
+
|
|
380
391
|
logger.info(f"Found {len(all_commands)} commands in total")
|
|
381
392
|
|
|
382
393
|
# Konwertuj wszystkie słowniki na obiekty Command
|
|
@@ -690,9 +701,7 @@ class ProjectCommandDetector:
|
|
|
690
701
|
source = cmd_dict.get("source", "Unknown")
|
|
691
702
|
|
|
692
703
|
f.write(f"### 🔧 Fix: {command}\n") # noqa: E231
|
|
693
|
-
f.write(
|
|
694
|
-
f"- [ ] **Command**: `{command}` \n"
|
|
695
|
-
) # noqa: E201,E231
|
|
704
|
+
f.write(f"- [ ] **Command**: `{command}` \n") # noqa: E201,E231
|
|
696
705
|
f.write(f"- **Error**: {error} \n") # noqa: E231
|
|
697
706
|
f.write(f"- **Source**: `{source}`\n") # noqa: E231
|
|
698
707
|
f.write("- **Fix Suggestion**: \n\n") # noqa: E231
|
|
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
|
|
File without changes
|