domd 2.2.28__tar.gz → 2.2.30__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.
Files changed (125) hide show
  1. {domd-2.2.28 → domd-2.2.30}/PKG-INFO +1 -1
  2. {domd-2.2.28 → domd-2.2.30}/pyproject.toml +1 -1
  3. {domd-2.2.28 → domd-2.2.30}/src/domd/adapters/persistence/shell_command_executor.py +50 -0
  4. {domd-2.2.28 → domd-2.2.30}/src/domd/cli.py +1 -1
  5. {domd-2.2.28 → domd-2.2.30}/src/domd/core/command_detection/handlers/command_handler.py +36 -6
  6. {domd-2.2.28 → domd-2.2.30}/LICENSE +0 -0
  7. {domd-2.2.28 → domd-2.2.30}/README.md +0 -0
  8. {domd-2.2.28 → domd-2.2.30}/src/domd/__init__.py +0 -0
  9. {domd-2.2.28 → domd-2.2.30}/src/domd/adapters/__init__.py +0 -0
  10. {domd-2.2.28 → domd-2.2.30}/src/domd/adapters/api/__init__.py +0 -0
  11. {domd-2.2.28 → domd-2.2.30}/src/domd/adapters/api/flask_api.py +0 -0
  12. {domd-2.2.28 → domd-2.2.30}/src/domd/adapters/cli/__init__.py +0 -0
  13. {domd-2.2.28 → domd-2.2.30}/src/domd/adapters/cli/command_presenter.py +0 -0
  14. {domd-2.2.28 → domd-2.2.30}/src/domd/adapters/formatters/__init__.py +0 -0
  15. {domd-2.2.28 → domd-2.2.30}/src/domd/adapters/formatters/markdown_formatter.py +0 -0
  16. {domd-2.2.28 → domd-2.2.30}/src/domd/adapters/persistence/__init__.py +0 -0
  17. {domd-2.2.28 → domd-2.2.30}/src/domd/adapters/persistence/in_memory_command_repository.py +0 -0
  18. {domd-2.2.28 → domd-2.2.30}/src/domd/api.py +0 -0
  19. {domd-2.2.28 → domd-2.2.30}/src/domd/application/__init__.py +0 -0
  20. {domd-2.2.28 → domd-2.2.30}/src/domd/application/factory.py +0 -0
  21. {domd-2.2.28 → domd-2.2.30}/src/domd/command_execution/__init__.py +0 -0
  22. {domd-2.2.28 → domd-2.2.30}/src/domd/core/__init__.py +0 -0
  23. {domd-2.2.28 → domd-2.2.30}/src/domd/core/command_detection/__init__.py +0 -0
  24. {domd-2.2.28 → domd-2.2.30}/src/domd/core/command_detection/base_detector.py +0 -0
  25. {domd-2.2.28 → domd-2.2.30}/src/domd/core/command_detection/handlers/__init__.py +0 -0
  26. {domd-2.2.28 → domd-2.2.30}/src/domd/core/command_detection/handlers/config_handler.py +0 -0
  27. {domd-2.2.28 → domd-2.2.30}/src/domd/core/command_detection/models.py +0 -0
  28. {domd-2.2.28 → domd-2.2.30}/src/domd/core/command_detection/parsers/__init__.py +0 -0
  29. {domd-2.2.28 → domd-2.2.30}/src/domd/core/command_detection/parsers/base_parser.py +0 -0
  30. {domd-2.2.28 → domd-2.2.30}/src/domd/core/command_detection/parsers/parser_registry.py +0 -0
  31. {domd-2.2.28 → domd-2.2.30}/src/domd/core/command_detection/project_detector.py +0 -0
  32. {domd-2.2.28 → domd-2.2.30}/src/domd/core/command_detection/utils/__init__.py +0 -0
  33. {domd-2.2.28 → domd-2.2.30}/src/domd/core/command_detection/utils/file_utils.py +0 -0
  34. {domd-2.2.28 → domd-2.2.30}/src/domd/core/command_detection/utils/virtualenv.py +0 -0
  35. {domd-2.2.28 → domd-2.2.30}/src/domd/core/command_execution/__init__.py +0 -0
  36. {domd-2.2.28 → domd-2.2.30}/src/domd/core/command_execution/command_executor.py +0 -0
  37. {domd-2.2.28 → domd-2.2.30}/src/domd/core/command_execution/command_recorder.py +0 -0
  38. {domd-2.2.28 → domd-2.2.30}/src/domd/core/command_execution/command_runner.py +0 -0
  39. {domd-2.2.28 → domd-2.2.30}/src/domd/core/command_execution/environment_detector.py +0 -0
  40. {domd-2.2.28 → domd-2.2.30}/src/domd/core/command_execution/executor.py +0 -0
  41. {domd-2.2.28 → domd-2.2.30}/src/domd/core/commands/__init__.py +0 -0
  42. {domd-2.2.28 → domd-2.2.30}/src/domd/core/commands/command.py +0 -0
  43. {domd-2.2.28 → domd-2.2.30}/src/domd/core/commands/executor.py +0 -0
  44. {domd-2.2.28 → domd-2.2.30}/src/domd/core/detector.py +0 -0
  45. {domd-2.2.28 → domd-2.2.30}/src/domd/core/domain/__init__.py +0 -0
  46. {domd-2.2.28 → domd-2.2.30}/src/domd/core/domain/command.py +0 -0
  47. {domd-2.2.28 → domd-2.2.30}/src/domd/core/parsers/__init__.py +0 -0
  48. {domd-2.2.28 → domd-2.2.30}/src/domd/core/parsers/ansible_galaxy.py +0 -0
  49. {domd-2.2.28 → domd-2.2.30}/src/domd/core/parsers/ansible_inventory.py +0 -0
  50. {domd-2.2.28 → domd-2.2.30}/src/domd/core/parsers/ansible_playbook.py +0 -0
  51. {domd-2.2.28 → domd-2.2.30}/src/domd/core/parsers/ansible_role.py +0 -0
  52. {domd-2.2.28 → domd-2.2.30}/src/domd/core/parsers/ansible_vault.py +0 -0
  53. {domd-2.2.28 → domd-2.2.30}/src/domd/core/parsers/base.py +0 -0
  54. {domd-2.2.28 → domd-2.2.30}/src/domd/core/parsers/cargo_toml.py +0 -0
  55. {domd-2.2.28 → domd-2.2.30}/src/domd/core/parsers/composer_json.py +0 -0
  56. {domd-2.2.28 → domd-2.2.30}/src/domd/core/parsers/go_mod.py +0 -0
  57. {domd-2.2.28 → domd-2.2.30}/src/domd/core/parsers/makefile.py +0 -0
  58. {domd-2.2.28 → domd-2.2.30}/src/domd/core/parsers/package_json.py +0 -0
  59. {domd-2.2.28 → domd-2.2.30}/src/domd/core/parsers/pyproject_toml.py +0 -0
  60. {domd-2.2.28 → domd-2.2.30}/src/domd/core/parsers/tox_ini.py +0 -0
  61. {domd-2.2.28 → domd-2.2.30}/src/domd/core/parsing/__init__.py +0 -0
  62. {domd-2.2.28 → domd-2.2.30}/src/domd/core/parsing/base.py +0 -0
  63. {domd-2.2.28 → domd-2.2.30}/src/domd/core/parsing/file_processor.py +0 -0
  64. {domd-2.2.28 → domd-2.2.30}/src/domd/core/parsing/parser_registry.py +0 -0
  65. {domd-2.2.28 → domd-2.2.30}/src/domd/core/parsing/pattern_matcher.py +0 -0
  66. {domd-2.2.28 → domd-2.2.30}/src/domd/core/ports/__init__.py +0 -0
  67. {domd-2.2.28 → domd-2.2.30}/src/domd/core/ports/command_executor.py +0 -0
  68. {domd-2.2.28 → domd-2.2.30}/src/domd/core/ports/command_repository.py +0 -0
  69. {domd-2.2.28 → domd-2.2.30}/src/domd/core/ports/report_formatter.py +0 -0
  70. {domd-2.2.28 → domd-2.2.30}/src/domd/core/project_detection/__init__.py +0 -0
  71. {domd-2.2.28 → domd-2.2.30}/src/domd/core/project_detection/command_handling.py +0 -0
  72. {domd-2.2.28 → domd-2.2.30}/src/domd/core/project_detection/config_files.py +0 -0
  73. {domd-2.2.28 → domd-2.2.30}/src/domd/core/project_detection/detector.py +0 -0
  74. {domd-2.2.28 → domd-2.2.30}/src/domd/core/project_detection/virtualenv.py +0 -0
  75. {domd-2.2.28 → domd-2.2.30}/src/domd/core/reporters/__init__.py +0 -0
  76. {domd-2.2.28 → domd-2.2.30}/src/domd/core/reporters/base.py +0 -0
  77. {domd-2.2.28 → domd-2.2.30}/src/domd/core/reporters/done_md.py +0 -0
  78. {domd-2.2.28 → domd-2.2.30}/src/domd/core/reporters/todo_md.py +0 -0
  79. {domd-2.2.28 → domd-2.2.30}/src/domd/core/reporting/__init__.py +0 -0
  80. {domd-2.2.28 → domd-2.2.30}/src/domd/core/reporting/formatters.py +0 -0
  81. {domd-2.2.28 → domd-2.2.30}/src/domd/core/reporting/reporter.py +0 -0
  82. {domd-2.2.28 → domd-2.2.30}/src/domd/core/services/__init__.py +0 -0
  83. {domd-2.2.28 → domd-2.2.30}/src/domd/core/services/command_service.py +0 -0
  84. {domd-2.2.28 → domd-2.2.30}/src/domd/core/services/report_service.py +0 -0
  85. {domd-2.2.28 → domd-2.2.30}/src/domd/core/utils/__init__.py +0 -0
  86. {domd-2.2.28 → domd-2.2.30}/src/domd/core/utils/command_utils.py +0 -0
  87. {domd-2.2.28 → domd-2.2.30}/src/domd/core/utils/environment.py +0 -0
  88. {domd-2.2.28 → domd-2.2.30}/src/domd/core/utils/file_utils.py +0 -0
  89. {domd-2.2.28 → domd-2.2.30}/src/domd/core/utils/logging_utils.py +0 -0
  90. {domd-2.2.28 → domd-2.2.30}/src/domd/core/utils/virtualenv.py +0 -0
  91. {domd-2.2.28 → domd-2.2.30}/src/domd/parsers/__init__.py +0 -0
  92. {domd-2.2.28 → domd-2.2.30}/src/domd/parsers/ansible.py +0 -0
  93. {domd-2.2.28 → domd-2.2.30}/src/domd/parsers/base.py +0 -0
  94. {domd-2.2.28 → domd-2.2.30}/src/domd/parsers/build_systems.py +0 -0
  95. {domd-2.2.28 → domd-2.2.30}/src/domd/parsers/ci_cd.py +0 -0
  96. {domd-2.2.28 → domd-2.2.30}/src/domd/parsers/docker/__init__.py +0 -0
  97. {domd-2.2.28 → domd-2.2.30}/src/domd/parsers/docker/docker_compose.py +0 -0
  98. {domd-2.2.28 → domd-2.2.30}/src/domd/parsers/docker/dockerfile.py +0 -0
  99. {domd-2.2.28 → domd-2.2.30}/src/domd/parsers/docker.py +0 -0
  100. {domd-2.2.28 → domd-2.2.30}/src/domd/parsers/javascript/__init__.py +0 -0
  101. {domd-2.2.28 → domd-2.2.30}/src/domd/parsers/javascript.py +0 -0
  102. {domd-2.2.28 → domd-2.2.30}/src/domd/parsers/markdown_parser.py +0 -0
  103. {domd-2.2.28 → domd-2.2.30}/src/domd/parsers/package_json.py +0 -0
  104. {domd-2.2.28 → domd-2.2.30}/src/domd/parsers/python.py +0 -0
  105. {domd-2.2.28 → domd-2.2.30}/src/domd/parsers/test_build_systems.py +0 -0
  106. {domd-2.2.28 → domd-2.2.30}/src/domd/parsers/test_ci_cd.py +0 -0
  107. {domd-2.2.28 → domd-2.2.30}/src/domd/parsers/test_docker.py +0 -0
  108. {domd-2.2.28 → domd-2.2.30}/src/domd/parsers/test_javascript.py +0 -0
  109. {domd-2.2.28 → domd-2.2.30}/src/domd/parsers/test_python.py +0 -0
  110. {domd-2.2.28 → domd-2.2.30}/src/domd/parsing/__init__.py +0 -0
  111. {domd-2.2.28 → domd-2.2.30}/src/domd/parsing/base.py +0 -0
  112. {domd-2.2.28 → domd-2.2.30}/src/domd/reporters/__init__.py +0 -0
  113. {domd-2.2.28 → domd-2.2.30}/src/domd/reporters/console.py +0 -0
  114. {domd-2.2.28 → domd-2.2.30}/src/domd/reporters/json_reporter.py +0 -0
  115. {domd-2.2.28 → domd-2.2.30}/src/domd/reporters/test_console.py +0 -0
  116. {domd-2.2.28 → domd-2.2.30}/src/domd/reporters/test_json_reporter.py +0 -0
  117. {domd-2.2.28 → domd-2.2.30}/src/domd/reporters/test_todo_md.py +0 -0
  118. {domd-2.2.28 → domd-2.2.30}/src/domd/reporters/todo_md.py +0 -0
  119. {domd-2.2.28 → domd-2.2.30}/src/domd/reporting/__init__.py +0 -0
  120. {domd-2.2.28 → domd-2.2.30}/src/domd/utils/__init__.py +0 -0
  121. {domd-2.2.28 → domd-2.2.30}/src/domd/utils/command_runner.py +0 -0
  122. {domd-2.2.28 → domd-2.2.30}/src/domd/utils/file_utils.py +0 -0
  123. {domd-2.2.28 → domd-2.2.30}/src/domd/utils/path_utils.py +0 -0
  124. {domd-2.2.28 → domd-2.2.30}/src/domd/utils/test_command_runner.py +0 -0
  125. {domd-2.2.28 → domd-2.2.30}/src/domd/utils/test_file_utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: domd
3
- Version: 2.2.28
3
+ Version: 2.2.30
4
4
  Summary: ✓ DoMD - Do Markdown Docs - automatically detect, run and show working commands in DONE.md and errors in TODO.md markdown files
5
5
  License: Apache-2.0
6
6
  Author: Tom Sapletta
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "domd"
3
- version = "2.2.28"
3
+ version = "2.2.30"
4
4
  description = " ✓ DoMD - Do Markdown Docs - automatically detect, run and show working commands in DONE.md and errors in TODO.md markdown files"
5
5
  authors = ["Tom Sapletta <info@softreck.dev>"]
6
6
  maintainers = ["WRONAI Team"]
@@ -5,6 +5,7 @@ Implementacja wykonawcy komend powłoki systemowej.
5
5
  # Standard library imports
6
6
  import logging
7
7
  import os
8
+ import re
8
9
  import shlex
9
10
  import subprocess
10
11
  import time
@@ -279,6 +280,50 @@ class ShellCommandExecutor(CommandExecutor):
279
280
 
280
281
  return False
281
282
 
283
+ def _is_markdown_content(self, command_str: str) -> bool:
284
+ """
285
+ Check if the given string appears to be markdown content.
286
+
287
+ Args:
288
+ command_str: The string to check
289
+
290
+ Returns:
291
+ bool: True if the string appears to be markdown content
292
+ """
293
+ # Common markdown patterns that shouldn't be executed as commands
294
+ markdown_indicators = [
295
+ # Headers
296
+ r"^#+\s",
297
+ # Lists
298
+ r"^\s*[-*+]\s+",
299
+ r"^\s*\d+\.\s+",
300
+ # Code blocks
301
+ r"^\s*```",
302
+ # Tables
303
+ r"\|.*\|",
304
+ # Links and images
305
+ r"\[.*\]\(.*\)",
306
+ # Blockquotes
307
+ r"^>",
308
+ # Horizontal rules
309
+ r"^[-*_]{3,}$",
310
+ # Box-drawing characters (used in tree views)
311
+ r"[├└│]",
312
+ # Common markdown file extensions
313
+ r"\.md$",
314
+ ]
315
+
316
+ # Check for markdown indicators
317
+ for pattern in markdown_indicators:
318
+ if re.search(pattern, command_str):
319
+ return True
320
+
321
+ # Check if this looks like a documentation line (e.g., starts with a word and colon)
322
+ if re.match(r"^\s*[A-Za-z][A-Za-z0-9_\s-]*:", command_str):
323
+ return True
324
+
325
+ return False
326
+
282
327
  def _parse_command(self, command_str: str) -> Tuple[List[str], bool]:
283
328
  """
284
329
  Parses a command string into a list of arguments and determines if it needs a shell.
@@ -292,6 +337,11 @@ class ShellCommandExecutor(CommandExecutor):
292
337
  if not command_str.strip():
293
338
  return [], False
294
339
 
340
+ # Check if this is markdown content that shouldn't be executed
341
+ if self._is_markdown_content(command_str):
342
+ logger.debug(f"Ignoring markdown content: {command_str[:100]}...")
343
+ return [], False
344
+
295
345
  # Check if this is a shell built-in or needs shell features
296
346
  needs_shell = self._needs_shell(command_str)
297
347
 
@@ -549,7 +549,7 @@ def main() -> int:
549
549
  return 0
550
550
 
551
551
  # Test commands with real-time updates
552
- if not getattr(args, 'quiet', False):
552
+ if not getattr(args, "quiet", False):
553
553
  print(f"\n🧪 Testing {len(commands)} commands...")
554
554
  print(
555
555
  f"📊 Progress will be updated in {getattr(args, 'todo_file', 'TODO.md')}"
@@ -159,7 +159,7 @@ class CommandHandler:
159
159
  "execution_time": 0,
160
160
  }
161
161
 
162
- def is_valid_command(self, command: Union[str, Dict, Command]) -> bool:
162
+ def is_valid_command(self, command: Union[str, Dict, Command]) -> tuple[bool, str]:
163
163
  """Check if a command is valid and should be executed.
164
164
 
165
165
  Args:
@@ -172,22 +172,52 @@ class CommandHandler:
172
172
  if not cmd_str or not cmd_str.strip():
173
173
  return False, "Empty command"
174
174
 
175
+ # Check if the command looks like a markdown header, list item, or other content
176
+ if any(markdown_indicator in cmd_str for markdown_indicator in [
177
+ "# ", # Headers
178
+ "- ", # List items
179
+ "* ", # List items
180
+ "1. ", # Numbered lists
181
+ "| ", # Tables
182
+ "```", # Code blocks
183
+ "**", # Bold text
184
+ "__", # Underlined text
185
+ "~~", # Strikethrough
186
+ "[]", # Links
187
+ "![", # Images
188
+ "<", # HTML tags
189
+ "> " # Blockquotes
190
+ ]):
191
+ return False, "Appears to be markdown content"
192
+
175
193
  # Check against non-command patterns
176
194
  for pattern in self._compiled_non_command_patterns:
177
195
  if pattern.search(cmd_str):
178
196
  return False, f"Matches non-command pattern: {pattern.pattern}"
179
197
 
180
198
  # Check for common error patterns
181
- if "error:" in cmd_str.lower() or "warning:" in cmd_str.lower():
182
- return False, "Command appears to be an error or warning message"
199
+ if any(s in cmd_str.lower() for s in ["error:", "warning:", "exception:", "traceback"]):
200
+ return False, "Appears to be an error or warning message"
201
+
202
+ # Check for documentation-style lines (e.g., "parameter: value")
203
+ if re.match(r'^\s*[A-Za-z][A-Za-z0-9_\s-]*:', cmd_str):
204
+ return False, "Appears to be documentation or configuration"
183
205
 
184
206
  # Check for suspicious patterns that might indicate internal errors
185
207
  if any(s in cmd_str.lower() for s in ["traceback", "exception", "stacktrace"]):
186
- return False, "Command appears to contain error output"
208
+ return False, "Appears to contain error output"
187
209
 
188
210
  # Check for internal tool paths that shouldn't be executed
189
- if any(s in cmd_str for s in ["/tmp/", "/var/", "/usr/local/", "~/.cache/"]):
190
- return False, "Command references internal tool paths"
211
+ if any(s in cmd_str for s in ["/tmp/", "/var/", "/usr/local/", "~/.cache/", "/dev/"]):
212
+ return False, "References internal tool paths"
213
+
214
+ # Check for commands that are just numbers or special characters
215
+ if re.match(r'^[\d\s\W]+$', cmd_str):
216
+ return False, "Contains only numbers or special characters"
217
+
218
+ # Check for very long commands that are likely not actual commands
219
+ if len(cmd_str) > 500: # Arbitrary length threshold
220
+ return False, "Command is too long to be a valid shell command"
191
221
 
192
222
  return True, ""
193
223
 
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