troubadix 24.9.4__tar.gz → 24.10.1__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 (209) hide show
  1. {troubadix-24.9.4 → troubadix-24.10.1}/PKG-INFO +3 -2
  2. {troubadix-24.9.4 → troubadix-24.10.1}/pyproject.toml +3 -3
  3. troubadix-24.10.1/tests/plugins/test_spaces_before_dots.py +103 -0
  4. {troubadix-24.9.4 → troubadix-24.10.1}/tests/standalone_plugins/test_deprecate_vts.py +28 -22
  5. {troubadix-24.9.4 → troubadix-24.10.1}/troubadix/__version__.py +1 -1
  6. {troubadix-24.9.4 → troubadix-24.10.1}/troubadix/plugins/__init__.py +2 -0
  7. {troubadix-24.9.4 → troubadix-24.10.1}/troubadix/plugins/script_xref_url.py +1 -1
  8. troubadix-24.10.1/troubadix/plugins/spaces_before_dots.py +130 -0
  9. {troubadix-24.9.4 → troubadix-24.10.1}/troubadix/standalone_plugins/deprecate_vts.py +40 -29
  10. {troubadix-24.9.4 → troubadix-24.10.1}/LICENSE +0 -0
  11. {troubadix-24.9.4 → troubadix-24.10.1}/README.md +0 -0
  12. {troubadix-24.9.4 → troubadix-24.10.1}/tests/__init__.py +0 -0
  13. {troubadix-24.9.4 → troubadix-24.10.1}/tests/helper/__init__.py +0 -0
  14. {troubadix-24.9.4 → troubadix-24.10.1}/tests/helper/test_linguistic_exception_handler.py +0 -0
  15. {troubadix-24.9.4 → troubadix-24.10.1}/tests/helper/test_patterns.py +0 -0
  16. {troubadix-24.9.4 → troubadix-24.10.1}/tests/plugins/__init__.py +0 -0
  17. {troubadix-24.9.4 → troubadix-24.10.1}/tests/plugins/fail.nasl +0 -0
  18. {troubadix-24.9.4 → troubadix-24.10.1}/tests/plugins/fail2.nasl +0 -0
  19. {troubadix-24.9.4 → troubadix-24.10.1}/tests/plugins/test.nasl +0 -0
  20. {troubadix-24.9.4 → troubadix-24.10.1}/tests/plugins/test_badwords.py +0 -0
  21. {troubadix-24.9.4 → troubadix-24.10.1}/tests/plugins/test_copyright_text.py +0 -0
  22. {troubadix-24.9.4 → troubadix-24.10.1}/tests/plugins/test_copyright_year.py +0 -0
  23. {troubadix-24.9.4 → troubadix-24.10.1}/tests/plugins/test_creation_date.py +0 -0
  24. {troubadix-24.9.4 → troubadix-24.10.1}/tests/plugins/test_cve_format.py +0 -0
  25. {troubadix-24.9.4 → troubadix-24.10.1}/tests/plugins/test_cvss_format.py +0 -0
  26. {troubadix-24.9.4 → troubadix-24.10.1}/tests/plugins/test_dependencies.py +0 -0
  27. {troubadix-24.9.4 → troubadix-24.10.1}/tests/plugins/test_dependency_category_order.py +0 -0
  28. {troubadix-24.9.4 → troubadix-24.10.1}/tests/plugins/test_deprecated_dependency.py +0 -0
  29. {troubadix-24.9.4 → troubadix-24.10.1}/tests/plugins/test_deprecated_functions.py +0 -0
  30. {troubadix-24.9.4 → troubadix-24.10.1}/tests/plugins/test_double_end_points.py +0 -0
  31. {troubadix-24.9.4 → troubadix-24.10.1}/tests/plugins/test_duplicate_oid.py +0 -0
  32. {troubadix-24.9.4 → troubadix-24.10.1}/tests/plugins/test_duplicated_script_tags.py +0 -0
  33. {troubadix-24.9.4 → troubadix-24.10.1}/tests/plugins/test_encoding.py +0 -0
  34. {troubadix-24.9.4 → troubadix-24.10.1}/tests/plugins/test_files/fail_bad_new_line.nasl +0 -0
  35. {troubadix-24.9.4 → troubadix-24.10.1}/tests/plugins/test_files/fail_badwords.nasl +0 -0
  36. {troubadix-24.9.4 → troubadix-24.10.1}/tests/plugins/test_files/fail_name_and_copyright_newline.nasl +0 -0
  37. {troubadix-24.9.4 → troubadix-24.10.1}/tests/plugins/test_files/fail_name_newline.nasl +0 -0
  38. {troubadix-24.9.4 → troubadix-24.10.1}/tests/plugins/test_files/fail_permissions.nasl +0 -0
  39. {troubadix-24.9.4 → troubadix-24.10.1}/tests/plugins/test_files/fail_spelling.nasl +0 -0
  40. {troubadix-24.9.4 → troubadix-24.10.1}/tests/plugins/test_files/nasl/21.04/fail.nasl +0 -0
  41. {troubadix-24.9.4 → troubadix-24.10.1}/tests/plugins/test_files/nasl/21.04/fail_badwords.nasl +0 -0
  42. {troubadix-24.9.4 → troubadix-24.10.1}/tests/plugins/test_files/nasl/21.04/fail_name_and_copyright_newline.nasl +0 -0
  43. {troubadix-24.9.4 → troubadix-24.10.1}/tests/plugins/test_files/nasl/21.04/fail_name_newline.nasl +0 -0
  44. {troubadix-24.9.4 → troubadix-24.10.1}/tests/plugins/test_files/nasl/21.04/fail_solution_template.nasl +0 -0
  45. {troubadix-24.9.4 → troubadix-24.10.1}/tests/plugins/test_files/nasl/21.04/runner/fail.nasl +0 -0
  46. {troubadix-24.9.4 → troubadix-24.10.1}/tests/plugins/test_files/nasl/21.04/runner/fail2.nasl +0 -0
  47. {troubadix-24.9.4 → troubadix-24.10.1}/tests/plugins/test_files/nasl/21.04/runner/test.nasl +0 -0
  48. {troubadix-24.9.4 → troubadix-24.10.1}/tests/plugins/test_files/nasl/21.04/runner/test_valid_oid.nasl +0 -0
  49. {troubadix-24.9.4 → troubadix-24.10.1}/tests/plugins/test_files/nasl/21.04/test.inc +0 -0
  50. {troubadix-24.9.4 → troubadix-24.10.1}/tests/plugins/test_files/nasl/21.04/test.nasl +0 -0
  51. {troubadix-24.9.4 → troubadix-24.10.1}/tests/plugins/test_files/nasl/warning.nasl +0 -0
  52. {troubadix-24.9.4 → troubadix-24.10.1}/tests/plugins/test_files/ok_permissions.nasl +0 -0
  53. {troubadix-24.9.4 → troubadix-24.10.1}/tests/plugins/test_files/test_oid.nasl +0 -0
  54. {troubadix-24.9.4 → troubadix-24.10.1}/tests/plugins/test_forking_nasl_functions.py +0 -0
  55. {troubadix-24.9.4 → troubadix-24.10.1}/tests/plugins/test_get_kb_on_services.py +0 -0
  56. {troubadix-24.9.4 → troubadix-24.10.1}/tests/plugins/test_grammar.py +0 -0
  57. {troubadix-24.9.4 → troubadix-24.10.1}/tests/plugins/test_http_links_in_tags.py +0 -0
  58. {troubadix-24.9.4 → troubadix-24.10.1}/tests/plugins/test_illegal_characters.py +0 -0
  59. {troubadix-24.9.4 → troubadix-24.10.1}/tests/plugins/test_log_messages.py +0 -0
  60. {troubadix-24.9.4 → troubadix-24.10.1}/tests/plugins/test_malformed_dependencies.py +0 -0
  61. {troubadix-24.9.4 → troubadix-24.10.1}/tests/plugins/test_misplaced_compare_in_if.py +0 -0
  62. {troubadix-24.9.4 → troubadix-24.10.1}/tests/plugins/test_missing_desc_exit.py +0 -0
  63. {troubadix-24.9.4 → troubadix-24.10.1}/tests/plugins/test_missing_tag_solution.py +0 -0
  64. {troubadix-24.9.4 → troubadix-24.10.1}/tests/plugins/test_multiple_re_parameters.py +0 -0
  65. {troubadix-24.9.4 → troubadix-24.10.1}/tests/plugins/test_newlines.py +0 -0
  66. {troubadix-24.9.4 → troubadix-24.10.1}/tests/plugins/test_overlong_description_lines.py +0 -0
  67. {troubadix-24.9.4 → troubadix-24.10.1}/tests/plugins/test_overlong_script_tags.py +0 -0
  68. {troubadix-24.9.4 → troubadix-24.10.1}/tests/plugins/test_prod_svc_detect_in_vulnvt.py +0 -0
  69. {troubadix-24.9.4 → troubadix-24.10.1}/tests/plugins/test_qod.py +0 -0
  70. {troubadix-24.9.4 → troubadix-24.10.1}/tests/plugins/test_reporting_consistency.py +0 -0
  71. {troubadix-24.9.4 → troubadix-24.10.1}/tests/plugins/test_script_add_preference_type.py +0 -0
  72. {troubadix-24.9.4 → troubadix-24.10.1}/tests/plugins/test_script_calls_empty_values.py +0 -0
  73. {troubadix-24.9.4 → troubadix-24.10.1}/tests/plugins/test_script_calls_recommended.py +0 -0
  74. {troubadix-24.9.4 → troubadix-24.10.1}/tests/plugins/test_script_category.py +0 -0
  75. {troubadix-24.9.4 → troubadix-24.10.1}/tests/plugins/test_script_copyright.py +0 -0
  76. {troubadix-24.9.4 → troubadix-24.10.1}/tests/plugins/test_script_family.py +0 -0
  77. {troubadix-24.9.4 → troubadix-24.10.1}/tests/plugins/test_script_tag_form.py +0 -0
  78. {troubadix-24.9.4 → troubadix-24.10.1}/tests/plugins/test_script_tag_whitespaces.py +0 -0
  79. {troubadix-24.9.4 → troubadix-24.10.1}/tests/plugins/test_script_tags_mandatory.py +0 -0
  80. {troubadix-24.9.4 → troubadix-24.10.1}/tests/plugins/test_script_version_and_last_modification_tags.py +0 -0
  81. {troubadix-24.9.4 → troubadix-24.10.1}/tests/plugins/test_script_xref_form.py +0 -0
  82. {troubadix-24.9.4 → troubadix-24.10.1}/tests/plugins/test_script_xref_url.py +0 -0
  83. {troubadix-24.9.4 → troubadix-24.10.1}/tests/plugins/test_security_messages.py +0 -0
  84. {troubadix-24.9.4 → troubadix-24.10.1}/tests/plugins/test_set_get_kb_calls.py +0 -0
  85. {troubadix-24.9.4 → troubadix-24.10.1}/tests/plugins/test_solution_text.py +0 -0
  86. {troubadix-24.9.4 → troubadix-24.10.1}/tests/plugins/test_solution_type.py +0 -0
  87. {troubadix-24.9.4 → troubadix-24.10.1}/tests/plugins/test_spaces_in_filename.py +0 -0
  88. {troubadix-24.9.4 → troubadix-24.10.1}/tests/plugins/test_spelling.py +0 -0
  89. {troubadix-24.9.4 → troubadix-24.10.1}/tests/plugins/test_tabs.py +0 -0
  90. {troubadix-24.9.4 → troubadix-24.10.1}/tests/plugins/test_todo_tbd.py +0 -0
  91. {troubadix-24.9.4 → troubadix-24.10.1}/tests/plugins/test_trailing_spaces_tabs.py +0 -0
  92. {troubadix-24.9.4 → troubadix-24.10.1}/tests/plugins/test_using_display.py +0 -0
  93. {troubadix-24.9.4 → troubadix-24.10.1}/tests/plugins/test_valid_oid.py +0 -0
  94. {troubadix-24.9.4 → troubadix-24.10.1}/tests/plugins/test_valid_script_tag_names.py +0 -0
  95. {troubadix-24.9.4 → troubadix-24.10.1}/tests/plugins/test_variable_redefinition_in_foreach.py +0 -0
  96. {troubadix-24.9.4 → troubadix-24.10.1}/tests/plugins/test_vt_file_permissions.py +0 -0
  97. {troubadix-24.9.4 → troubadix-24.10.1}/tests/plugins/test_vt_placement.py +0 -0
  98. {troubadix-24.9.4 → troubadix-24.10.1}/tests/standalone_plugins/__init__.py +0 -0
  99. {troubadix-24.9.4 → troubadix-24.10.1}/tests/standalone_plugins/changed_packages/__init__.py +0 -0
  100. {troubadix-24.9.4 → troubadix-24.10.1}/tests/standalone_plugins/changed_packages/markers/__init__.py +0 -0
  101. {troubadix-24.9.4 → troubadix-24.10.1}/tests/standalone_plugins/changed_packages/markers/test_added_epoch.py +0 -0
  102. {troubadix-24.9.4 → troubadix-24.10.1}/tests/standalone_plugins/changed_packages/markers/test_added_release.py +0 -0
  103. {troubadix-24.9.4 → troubadix-24.10.1}/tests/standalone_plugins/changed_packages/markers/test_added_udeb.py +0 -0
  104. {troubadix-24.9.4 → troubadix-24.10.1}/tests/standalone_plugins/changed_packages/markers/test_changed_update.py +0 -0
  105. {troubadix-24.9.4 → troubadix-24.10.1}/tests/standalone_plugins/changed_packages/markers/test_dropped_architecture.py +0 -0
  106. {troubadix-24.9.4 → troubadix-24.10.1}/tests/standalone_plugins/changed_packages/test_changed_packages.py +0 -0
  107. {troubadix-24.9.4 → troubadix-24.10.1}/tests/standalone_plugins/changed_packages/test_package.py +0 -0
  108. {troubadix-24.9.4 → troubadix-24.10.1}/tests/standalone_plugins/test_changed_cves.py +0 -0
  109. {troubadix-24.9.4 → troubadix-24.10.1}/tests/standalone_plugins/test_changed_oid.py +0 -0
  110. {troubadix-24.9.4 → troubadix-24.10.1}/tests/standalone_plugins/test_file_extensions.py +0 -0
  111. {troubadix-24.9.4 → troubadix-24.10.1}/tests/standalone_plugins/test_last_modification.py +0 -0
  112. {troubadix-24.9.4 → troubadix-24.10.1}/tests/standalone_plugins/test_no_solution.py +0 -0
  113. {troubadix-24.9.4 → troubadix-24.10.1}/tests/standalone_plugins/test_version_updated.py +0 -0
  114. {troubadix-24.9.4 → troubadix-24.10.1}/tests/test_argparser.py +0 -0
  115. {troubadix-24.9.4 → troubadix-24.10.1}/tests/test_helper.py +0 -0
  116. {troubadix-24.9.4 → troubadix-24.10.1}/tests/test_naslinter.py +0 -0
  117. {troubadix-24.9.4 → troubadix-24.10.1}/tests/test_reporter.py +0 -0
  118. {troubadix-24.9.4 → troubadix-24.10.1}/tests/test_results.py +0 -0
  119. {troubadix-24.9.4 → troubadix-24.10.1}/tests/test_runner.py +0 -0
  120. {troubadix-24.9.4 → troubadix-24.10.1}/troubadix/__init__.py +0 -0
  121. {troubadix-24.9.4 → troubadix-24.10.1}/troubadix/argparser.py +0 -0
  122. {troubadix-24.9.4 → troubadix-24.10.1}/troubadix/codespell/codespell.additions +0 -0
  123. {troubadix-24.9.4 → troubadix-24.10.1}/troubadix/codespell/codespell.exclude +0 -0
  124. {troubadix-24.9.4 → troubadix-24.10.1}/troubadix/codespell/codespell.ignore +0 -0
  125. {troubadix-24.9.4 → troubadix-24.10.1}/troubadix/helper/__init__.py +0 -0
  126. {troubadix-24.9.4 → troubadix-24.10.1}/troubadix/helper/helper.py +0 -0
  127. {troubadix-24.9.4 → troubadix-24.10.1}/troubadix/helper/linguistic_exception_handler.py +0 -0
  128. {troubadix-24.9.4 → troubadix-24.10.1}/troubadix/helper/patterns.py +0 -0
  129. {troubadix-24.9.4 → troubadix-24.10.1}/troubadix/plugin.py +0 -0
  130. {troubadix-24.9.4 → troubadix-24.10.1}/troubadix/plugins/badwords.py +0 -0
  131. {troubadix-24.9.4 → troubadix-24.10.1}/troubadix/plugins/copyright_text.py +0 -0
  132. {troubadix-24.9.4 → troubadix-24.10.1}/troubadix/plugins/copyright_year.py +0 -0
  133. {troubadix-24.9.4 → troubadix-24.10.1}/troubadix/plugins/creation_date.py +0 -0
  134. {troubadix-24.9.4 → troubadix-24.10.1}/troubadix/plugins/cve_format.py +0 -0
  135. {troubadix-24.9.4 → troubadix-24.10.1}/troubadix/plugins/cvss_format.py +0 -0
  136. {troubadix-24.9.4 → troubadix-24.10.1}/troubadix/plugins/dependencies.py +0 -0
  137. {troubadix-24.9.4 → troubadix-24.10.1}/troubadix/plugins/dependency_category_order.py +0 -0
  138. {troubadix-24.9.4 → troubadix-24.10.1}/troubadix/plugins/deprecated_dependency.py +0 -0
  139. {troubadix-24.9.4 → troubadix-24.10.1}/troubadix/plugins/deprecated_functions.py +0 -0
  140. {troubadix-24.9.4 → troubadix-24.10.1}/troubadix/plugins/double_end_points.py +0 -0
  141. {troubadix-24.9.4 → troubadix-24.10.1}/troubadix/plugins/duplicate_oid.py +0 -0
  142. {troubadix-24.9.4 → troubadix-24.10.1}/troubadix/plugins/duplicated_script_tags.py +0 -0
  143. {troubadix-24.9.4 → troubadix-24.10.1}/troubadix/plugins/encoding.py +0 -0
  144. {troubadix-24.9.4 → troubadix-24.10.1}/troubadix/plugins/forking_nasl_functions.py +0 -0
  145. {troubadix-24.9.4 → troubadix-24.10.1}/troubadix/plugins/get_kb_on_services.py +0 -0
  146. {troubadix-24.9.4 → troubadix-24.10.1}/troubadix/plugins/grammar.py +0 -0
  147. {troubadix-24.9.4 → troubadix-24.10.1}/troubadix/plugins/http_links_in_tags.py +0 -0
  148. {troubadix-24.9.4 → troubadix-24.10.1}/troubadix/plugins/illegal_characters.py +0 -0
  149. {troubadix-24.9.4 → troubadix-24.10.1}/troubadix/plugins/log_messages.py +0 -0
  150. {troubadix-24.9.4 → troubadix-24.10.1}/troubadix/plugins/malformed_dependencies.py +0 -0
  151. {troubadix-24.9.4 → troubadix-24.10.1}/troubadix/plugins/misplaced_compare_in_if.py +0 -0
  152. {troubadix-24.9.4 → troubadix-24.10.1}/troubadix/plugins/missing_desc_exit.py +0 -0
  153. {troubadix-24.9.4 → troubadix-24.10.1}/troubadix/plugins/missing_tag_solution.py +0 -0
  154. {troubadix-24.9.4 → troubadix-24.10.1}/troubadix/plugins/multiple_re_parameters.py +0 -0
  155. {troubadix-24.9.4 → troubadix-24.10.1}/troubadix/plugins/newlines.py +0 -0
  156. {troubadix-24.9.4 → troubadix-24.10.1}/troubadix/plugins/overlong_description_lines.py +0 -0
  157. {troubadix-24.9.4 → troubadix-24.10.1}/troubadix/plugins/overlong_script_tags.py +0 -0
  158. {troubadix-24.9.4 → troubadix-24.10.1}/troubadix/plugins/prod_svc_detect_in_vulnvt.py +0 -0
  159. {troubadix-24.9.4 → troubadix-24.10.1}/troubadix/plugins/qod.py +0 -0
  160. {troubadix-24.9.4 → troubadix-24.10.1}/troubadix/plugins/reporting_consistency.py +0 -0
  161. {troubadix-24.9.4 → troubadix-24.10.1}/troubadix/plugins/script_add_preference_type.py +0 -0
  162. {troubadix-24.9.4 → troubadix-24.10.1}/troubadix/plugins/script_calls_empty_values.py +0 -0
  163. {troubadix-24.9.4 → troubadix-24.10.1}/troubadix/plugins/script_calls_recommended.py +0 -0
  164. {troubadix-24.9.4 → troubadix-24.10.1}/troubadix/plugins/script_category.py +0 -0
  165. {troubadix-24.9.4 → troubadix-24.10.1}/troubadix/plugins/script_copyright.py +0 -0
  166. {troubadix-24.9.4 → troubadix-24.10.1}/troubadix/plugins/script_family.py +0 -0
  167. {troubadix-24.9.4 → troubadix-24.10.1}/troubadix/plugins/script_tag_form.py +0 -0
  168. {troubadix-24.9.4 → troubadix-24.10.1}/troubadix/plugins/script_tag_whitespaces.py +0 -0
  169. {troubadix-24.9.4 → troubadix-24.10.1}/troubadix/plugins/script_tags_mandatory.py +0 -0
  170. {troubadix-24.9.4 → troubadix-24.10.1}/troubadix/plugins/script_version_and_last_modification_tags.py +0 -0
  171. {troubadix-24.9.4 → troubadix-24.10.1}/troubadix/plugins/script_xref_form.py +0 -0
  172. {troubadix-24.9.4 → troubadix-24.10.1}/troubadix/plugins/security_messages.py +0 -0
  173. {troubadix-24.9.4 → troubadix-24.10.1}/troubadix/plugins/set_get_kb_calls.py +0 -0
  174. {troubadix-24.9.4 → troubadix-24.10.1}/troubadix/plugins/solution_text.py +0 -0
  175. {troubadix-24.9.4 → troubadix-24.10.1}/troubadix/plugins/solution_type.py +0 -0
  176. {troubadix-24.9.4 → troubadix-24.10.1}/troubadix/plugins/spaces_in_filename.py +0 -0
  177. {troubadix-24.9.4 → troubadix-24.10.1}/troubadix/plugins/spelling.py +0 -0
  178. {troubadix-24.9.4 → troubadix-24.10.1}/troubadix/plugins/tabs.py +0 -0
  179. {troubadix-24.9.4 → troubadix-24.10.1}/troubadix/plugins/todo_tbd.py +0 -0
  180. {troubadix-24.9.4 → troubadix-24.10.1}/troubadix/plugins/trailing_spaces_tabs.py +0 -0
  181. {troubadix-24.9.4 → troubadix-24.10.1}/troubadix/plugins/using_display.py +0 -0
  182. {troubadix-24.9.4 → troubadix-24.10.1}/troubadix/plugins/valid_oid.py +0 -0
  183. {troubadix-24.9.4 → troubadix-24.10.1}/troubadix/plugins/valid_script_tag_names.py +0 -0
  184. {troubadix-24.9.4 → troubadix-24.10.1}/troubadix/plugins/variable_assigned_in_if.py +0 -0
  185. {troubadix-24.9.4 → troubadix-24.10.1}/troubadix/plugins/variable_redefinition_in_foreach.py +0 -0
  186. {troubadix-24.9.4 → troubadix-24.10.1}/troubadix/plugins/vt_file_permissions.py +0 -0
  187. {troubadix-24.9.4 → troubadix-24.10.1}/troubadix/plugins/vt_placement.py +0 -0
  188. {troubadix-24.9.4 → troubadix-24.10.1}/troubadix/reporter.py +0 -0
  189. {troubadix-24.9.4 → troubadix-24.10.1}/troubadix/results.py +0 -0
  190. {troubadix-24.9.4 → troubadix-24.10.1}/troubadix/runner.py +0 -0
  191. {troubadix-24.9.4 → troubadix-24.10.1}/troubadix/standalone_plugins/__init__.py +0 -0
  192. {troubadix-24.9.4 → troubadix-24.10.1}/troubadix/standalone_plugins/allowed_rev_diff.py +0 -0
  193. {troubadix-24.9.4 → troubadix-24.10.1}/troubadix/standalone_plugins/changed_cves.py +0 -0
  194. {troubadix-24.9.4 → troubadix-24.10.1}/troubadix/standalone_plugins/changed_oid.py +0 -0
  195. {troubadix-24.9.4 → troubadix-24.10.1}/troubadix/standalone_plugins/changed_packages/changed_packages.py +0 -0
  196. {troubadix-24.9.4 → troubadix-24.10.1}/troubadix/standalone_plugins/changed_packages/marker/__init__.py +0 -0
  197. {troubadix-24.9.4 → troubadix-24.10.1}/troubadix/standalone_plugins/changed_packages/marker/added_epoch.py +0 -0
  198. {troubadix-24.9.4 → troubadix-24.10.1}/troubadix/standalone_plugins/changed_packages/marker/added_release.py +0 -0
  199. {troubadix-24.9.4 → troubadix-24.10.1}/troubadix/standalone_plugins/changed_packages/marker/added_udeb.py +0 -0
  200. {troubadix-24.9.4 → troubadix-24.10.1}/troubadix/standalone_plugins/changed_packages/marker/changed_update.py +0 -0
  201. {troubadix-24.9.4 → troubadix-24.10.1}/troubadix/standalone_plugins/changed_packages/marker/dropped_architecture.py +0 -0
  202. {troubadix-24.9.4 → troubadix-24.10.1}/troubadix/standalone_plugins/changed_packages/marker/marker.py +0 -0
  203. {troubadix-24.9.4 → troubadix-24.10.1}/troubadix/standalone_plugins/changed_packages/package.py +0 -0
  204. {troubadix-24.9.4 → troubadix-24.10.1}/troubadix/standalone_plugins/common.py +0 -0
  205. {troubadix-24.9.4 → troubadix-24.10.1}/troubadix/standalone_plugins/file_extensions.py +0 -0
  206. {troubadix-24.9.4 → troubadix-24.10.1}/troubadix/standalone_plugins/last_modification.py +0 -0
  207. {troubadix-24.9.4 → troubadix-24.10.1}/troubadix/standalone_plugins/no_solution.py +0 -0
  208. {troubadix-24.9.4 → troubadix-24.10.1}/troubadix/standalone_plugins/version_updated.py +0 -0
  209. {troubadix-24.9.4 → troubadix-24.10.1}/troubadix/troubadix.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: troubadix
3
- Version: 24.9.4
3
+ Version: 24.10.1
4
4
  Summary: A linting and QA check tool for NASL files
5
5
  Home-page: https://github.com/greenbone/troubadix
6
6
  License: GPL-3.0-or-later
@@ -16,6 +16,7 @@ Classifier: Programming Language :: Python :: 3
16
16
  Classifier: Programming Language :: Python :: 3.10
17
17
  Classifier: Programming Language :: Python :: 3.11
18
18
  Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Programming Language :: Python :: 3.13
19
20
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
20
21
  Requires-Dist: chardet (>=4,<6)
21
22
  Requires-Dist: charset-normalizer (>=3.2.0,<4.0.0)
@@ -23,7 +24,7 @@ Requires-Dist: codespell (>=2.0.0,<3.0.0)
23
24
  Requires-Dist: gitpython (>=3.1.31,<4.0.0)
24
25
  Requires-Dist: pontos (>=22.7,<25.0)
25
26
  Requires-Dist: python-magic (>=0.4.25,<0.5.0)
26
- Requires-Dist: validators (==0.20.0)
27
+ Requires-Dist: validators (>=0.34.0,<0.35.0)
27
28
  Project-URL: Repository, https://github.com/greenbone/troubadix
28
29
  Description-Content-Type: text/markdown
29
30
 
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "troubadix"
3
- version = "24.9.4"
3
+ version = "24.10.1"
4
4
  description = "A linting and QA check tool for NASL files"
5
5
  authors = ["Greenbone <info@greenbone.net>"]
6
6
  license = "GPL-3.0-or-later"
@@ -29,14 +29,14 @@ pontos = ">=22.7,<25.0"
29
29
  codespell = "^2.0.0"
30
30
  python-magic = "^0.4.25"
31
31
  chardet = ">=4,<6"
32
- validators = "0.20.0"
32
+ validators = "^0.34.0"
33
33
  gitpython = "^3.1.31"
34
34
  charset-normalizer = "^3.2.0"
35
35
 
36
36
  [tool.poetry.group.dev.dependencies]
37
37
  autohooks = ">=21.7.0"
38
38
  autohooks-plugin-black = ">=21.12.0"
39
- ruff = ">=0.5.6,<0.7.0"
39
+ ruff = ">=0.5.6,<0.8.0"
40
40
  autohooks-plugin-ruff = "^24.1.0"
41
41
 
42
42
  [tool.black]
@@ -0,0 +1,103 @@
1
+ # SPDX-License-Identifier: GPL-3.0-or-later
2
+ # SPDX-FileCopyrightText: 2024 Greenbone AG
3
+
4
+ from pathlib import Path
5
+
6
+ from tests.plugins import PluginTestCase
7
+ from troubadix.helper import CURRENT_ENCODING
8
+ from troubadix.plugin import LinterFix
9
+ from troubadix.plugins.spaces_before_dots import CheckSpacesBeforeDots
10
+
11
+
12
+ class TestSpacesBeforeDots(PluginTestCase):
13
+
14
+ def test_ok(self):
15
+ nasl_file = Path("/some/fake/directory/test.nasl")
16
+ content = """
17
+ script_tag(name:"summary", value:"Foo Bar.");
18
+ script_tag(name:"solution", value:"Foo .NET.");
19
+ script_tag(name:"insight", value:"Foo Bar ...");
20
+ """
21
+ fake_context = self.create_file_plugin_context(
22
+ nasl_file=nasl_file, file_content=content
23
+ )
24
+ plugin = CheckSpacesBeforeDots(fake_context)
25
+ results = list(plugin.run())
26
+ self.assertEqual(len(results), 0)
27
+
28
+ def test_fail(self):
29
+ nasl_file = Path("/some/fake/directory/test.nasl")
30
+ content = (
31
+ """
32
+ script_tag(name:"summary", value:"Foo Bar .");
33
+ script_tag(name:"vuldetect", value:"Foo Bar .");
34
+ script_tag(name:"insight", value:"Foo Bar .");
35
+ script_tag(name:"impact", value:"Foo . Bar . Foo");
36
+ """
37
+ 'script_tag(name:"affected", value:"Foo\n.\nBar.");'
38
+ 'script_tag(name:"solution", value:"Foo Bar\n.");'
39
+ )
40
+ fake_context = self.create_file_plugin_context(
41
+ nasl_file=nasl_file, file_content=content
42
+ )
43
+ plugin = CheckSpacesBeforeDots(fake_context)
44
+ results = list(plugin.run())
45
+ self.assertEqual(len(results), 7)
46
+ self.assertEqual(
47
+ results[0].message,
48
+ "value of script_tag summary has at least one occurence of excess"
49
+ " whitespace before a dot:\n"
50
+ " 'script_tag(name:"
51
+ '"summary", value:"Foo Bar .");'
52
+ "'",
53
+ )
54
+
55
+ def test_ignore(self):
56
+ nasl_file = Path("/some/fake/directory/test.inc")
57
+ fake_context = self.create_file_plugin_context(nasl_file=nasl_file)
58
+ plugin = CheckSpacesBeforeDots(fake_context)
59
+
60
+ results = list(plugin.run())
61
+
62
+ self.assertEqual(len(results), 0)
63
+
64
+ def test_fix(self):
65
+ with self.create_directory() as tempdir:
66
+ path = tempdir / "file.nasl"
67
+ content = (
68
+ """
69
+ script_tag(name:"summary", value:"Foo Bar .");
70
+ script_tag(name:"vuldetect", value:"Foo Bar .");
71
+ script_tag(name:"insight", value:"Foo .Net Bar .");
72
+ script_tag(name:"impact", value:"Foo . Bar . Foo");
73
+ """
74
+ 'script_tag(name:"affected", value:"Foo\n.\nBar.");'
75
+ 'script_tag(name:"solution", value:"Foo Bar\n.");'
76
+ )
77
+ expected_modified_content = (
78
+ """
79
+ script_tag(name:"summary", value:"Foo Bar.");
80
+ script_tag(name:"vuldetect", value:"Foo Bar.");
81
+ script_tag(name:"insight", value:"Foo .Net Bar.");
82
+ script_tag(name:"impact", value:"Foo. Bar. Foo");
83
+ """
84
+ 'script_tag(name:"affected", value:"Foo.\nBar.");'
85
+ 'script_tag(name:"solution", value:"Foo Bar.");'
86
+ )
87
+ path.write_text(content, encoding=CURRENT_ENCODING)
88
+
89
+ fake_context = self.create_file_plugin_context(
90
+ nasl_file=path, file_content=content
91
+ )
92
+
93
+ plugin = CheckSpacesBeforeDots(fake_context)
94
+
95
+ # keep list() to consume the iterator
96
+ list(plugin.run())
97
+
98
+ results = list(plugin.fix())
99
+ self.assertEqual(len(results), 1)
100
+
101
+ self.assertIsInstance(results[0], LinterFix)
102
+ modified_content = path.read_text(encoding=CURRENT_ENCODING)
103
+ self.assertEqual(modified_content, expected_modified_content)
@@ -11,9 +11,9 @@ from troubadix.standalone_plugins.deprecate_vts import (
11
11
  _finalize_content,
12
12
  _get_summary,
13
13
  deprecate,
14
- filter_files,
15
14
  get_files_from_path,
16
15
  parse_args,
16
+ parse_files,
17
17
  update_summary,
18
18
  )
19
19
 
@@ -26,7 +26,7 @@ class ParseArgsTestCase(unittest.TestCase):
26
26
 
27
27
  args = parse_args(
28
28
  [
29
- "--files",
29
+ "--file",
30
30
  testfile,
31
31
  "--output-path",
32
32
  output_path,
@@ -34,7 +34,7 @@ class ParseArgsTestCase(unittest.TestCase):
34
34
  reason,
35
35
  ]
36
36
  )
37
- self.assertEqual(args.files, [Path(testfile)])
37
+ self.assertEqual(args.file, [Path(testfile)])
38
38
  self.assertEqual(args.output_path, Path(output_path))
39
39
  self.assertEqual(args.deprecation_reason, reason)
40
40
 
@@ -47,7 +47,7 @@ class ParseArgsTestCase(unittest.TestCase):
47
47
  with self.assertRaises(SystemExit):
48
48
  parse_args(
49
49
  [
50
- "--files",
50
+ "--file",
51
51
  testfile,
52
52
  "--output-path",
53
53
  output_path,
@@ -87,6 +87,28 @@ class ParseArgsTestCase(unittest.TestCase):
87
87
  ]
88
88
  )
89
89
 
90
+ def test_parse_from_file(self):
91
+ output_path = "attic/"
92
+ with TemporaryDirectory() as tempdir:
93
+ from_file = tempdir / "from_file.txt"
94
+ testfile1 = tempdir / "testfile1.nasl"
95
+ testfile2 = tempdir / "testfile2.nasl"
96
+
97
+ from_file.write_text(f"{testfile1}\n{testfile2}\n", encoding="utf8")
98
+
99
+ args = parse_args(
100
+ [
101
+ "--from-file",
102
+ str(from_file),
103
+ "--output-path",
104
+ output_path,
105
+ "-r",
106
+ "NOTUS",
107
+ ]
108
+ )
109
+
110
+ self.assertEqual(args.from_file, from_file)
111
+
90
112
 
91
113
  NASL_CONTENT = (
92
114
  '...if(description)\n{\n script_oid("1.3.6.1.4.1.25623.1.0.910673");'
@@ -190,16 +212,12 @@ class DeprecateVTsTestCase(unittest.TestCase):
190
212
 
191
213
  self.assertEqual(result, expected)
192
214
 
193
- def test_filter_files(self):
215
+ def test_parse_files(self):
194
216
  with TemporaryDirectory() as in_dir:
195
217
  testfile1 = in_dir / "gb_rhsa_2021_8383_8383.nasl"
196
218
  testfile1.write_text(NASL_CONTENT, encoding="utf8")
197
- testfile2 = in_dir / "gb_rhsa_2020_8383_8383.nasl"
198
- testfile2.write_text(NASL_CONTENT, encoding="utf8")
199
219
 
200
- result = filter_files(
201
- files=[testfile1, testfile2], filename_prefix="gb_rhsa_2021"
202
- )
220
+ result = parse_files(files=[testfile1])
203
221
  expected = [
204
222
  DeprecatedFile(
205
223
  name="gb_rhsa_2021_8383_8383.nasl",
@@ -209,15 +227,3 @@ class DeprecateVTsTestCase(unittest.TestCase):
209
227
  ]
210
228
 
211
229
  self.assertEqual(result, expected)
212
-
213
- def test_filter_files_out(self):
214
- with TemporaryDirectory() as in_dir:
215
- testfile1 = in_dir / "gb_rhsa_2021_8383_8383.nasl"
216
- testfile1.write_text(NASL_CONTENT, encoding="utf8")
217
-
218
- result = filter_files(
219
- files=[testfile1], filename_prefix="gb_rhsa_2020"
220
- )
221
- expected = []
222
-
223
- self.assertEqual(result, expected)
@@ -2,4 +2,4 @@
2
2
 
3
3
  # THIS IS AN AUTOGENERATED FILE. DO NOT TOUCH!
4
4
 
5
- __version__ = "24.9.4"
5
+ __version__ = "24.10.1"
@@ -18,6 +18,7 @@
18
18
  from typing import Iterable, List
19
19
 
20
20
  from troubadix.plugin import FilePlugin, FilesPlugin, Plugin
21
+ from troubadix.plugins.spaces_before_dots import CheckSpacesBeforeDots
21
22
 
22
23
  from .badwords import CheckBadwords
23
24
  from .copyright_text import CheckCopyrightText
@@ -140,6 +141,7 @@ _FILE_PLUGINS = [
140
141
  CheckVTFilePermissions,
141
142
  CheckVTPlacement,
142
143
  CheckWrongSetGetKBCalls,
144
+ CheckSpacesBeforeDots,
143
145
  ]
144
146
 
145
147
  # plugins checking all files
@@ -64,7 +64,7 @@ class CheckScriptXrefUrl(FileContentPlugin):
64
64
  for match in matches:
65
65
  if match:
66
66
  if match.group("value") not in ALLOWED_URLS and not url(
67
- match.group("value")
67
+ match.group("value"), strict_query=False
68
68
  ):
69
69
  yield LinterError(
70
70
  f"{match.group(0)}: Invalid URL value",
@@ -0,0 +1,130 @@
1
+ # SPDX-License-Identifier: GPL-3.0-or-later
2
+ # SPDX-FileCopyrightText: 2024 Greenbone AG
3
+ import re
4
+ from collections.abc import Iterator
5
+ from pathlib import Path
6
+
7
+ from troubadix.helper import CURRENT_ENCODING
8
+ from troubadix.helper.helper import is_ignore_file
9
+ from troubadix.helper.patterns import (
10
+ ScriptTag,
11
+ get_script_tag_pattern,
12
+ )
13
+ from troubadix.plugin import (
14
+ FileContentPlugin,
15
+ LinterFix,
16
+ LinterResult,
17
+ LinterWarning,
18
+ )
19
+
20
+ TAGS = [
21
+ ScriptTag.SUMMARY,
22
+ ScriptTag.VULDETECT,
23
+ ScriptTag.INSIGHT,
24
+ ScriptTag.IMPACT,
25
+ ScriptTag.AFFECTED,
26
+ ScriptTag.SOLUTION,
27
+ ]
28
+
29
+ # Regex pattern to match:
30
+ # 1. A dot preceded and/or followed by any whitespace character (floating between words)
31
+ # 2. A dot preceded by any whitespace character at the end of the string
32
+ PATTERN = re.compile(r"\s+\.(\s|$)")
33
+ IGNORE = [
34
+ # 21.04 and 22.04 are generated and should not be touched manually
35
+ "21.04/",
36
+ "22.04/",
37
+ # uses dots for beginning of entry in enumeration
38
+ "common/2008/debian/deb_246.nasl",
39
+ "common/2008/debian/deb_266.nasl",
40
+ "common/2008/freebsd/freebsd_5e92e8a2.nasl",
41
+ "common/2008/freebsd/freebsdsa_cpio.nasl",
42
+ "common/2008/freebsd/freebsdsa_cvs2.nasl",
43
+ "common/2009/osc_photoGallery_sql_injection.nasl",
44
+ "common/2009/secpod_novell_edir_mult_vuln_jul09_lin.nasl",
45
+ "common/2009/secpod_novell_edir_mult_vuln_jul09_win.nasl",
46
+ "common/2010/freebsd/freebsd_3a7c5fc4.nasl",
47
+ "common/2012/freebsd/freebsd_a4a809d8.nasl",
48
+ "common/2015/amazon/alas-2014-455.nasl",
49
+ "common/2015/gb_mozilla_firefox_mult_vuln01_mar15_macosx.nasl",
50
+ "common/2015/gb_mozilla_firefox_mult_vuln01_mar15_win.nasl",
51
+ "common/2015/oracle/ELSA-2009-1619.nasl",
52
+ "common/2015/oracle/ELSA-2011-0586.nasl",
53
+ "common/2016/gb_perl_privilege_escalation_vuln_win.nasl",
54
+ "common/2021/dropbear/gb_dropbear_ssh_filename_vuln_may20.nasl",
55
+ "common/2021/eclipse/gb_jetty_GHSA-v7ff-8wcx-gmc5_lin.nasl",
56
+ "common/2021/eclipse/gb_jetty_GHSA-v7ff-8wcx-gmc5_win.nasl",
57
+ "common/gsf/2009/mandriva/gb_mandriva_MDVSA_2008_140.nasl",
58
+ "common/gsf/2009/mandriva/gb_mandriva_MDVSA_2008_141.nasl",
59
+ "common/gsf/2010/mandriva/gb_mandriva_MDVA_2010_173.nasl",
60
+ "common/gsf/2010/mandriva/gb_mandriva_MDVSA_2010_155.nasl",
61
+ "common/gsf/2010/mandriva/gb_mandriva_MDVSA_2010_155_1.nasl",
62
+ "common/gsf/2010/mandriva/gb_mandriva_MDVSA_2010_167.nasl",
63
+ "common/gsf/2020/f5/gb_f5_big_ip_K11315080.nasl",
64
+ "common/gsf/2020/f5/gb_f5_big_iq_K11315080.nasl",
65
+ "common/2022/opensuse/gb_opensuse_2022_1548_1.nasl",
66
+ "common/2024/opensuse/gb_opensuse_2023_3247_1.nasl",
67
+ "common/attic/debian/deb_232_1.nasl",
68
+ ]
69
+
70
+
71
+ class CheckSpacesBeforeDots(FileContentPlugin):
72
+ name = "check_spaces_before_dots"
73
+
74
+ def check_content(
75
+ self, nasl_file: Path, file_content: str
76
+ ) -> Iterator[LinterResult]:
77
+ """
78
+ This plugin checks for excess whitespace before a dot
79
+ in script_tags that have full sentence values
80
+ """
81
+ self.matches = []
82
+ if nasl_file.suffix == ".inc" or is_ignore_file(nasl_file, IGNORE):
83
+ return
84
+ for tag in TAGS:
85
+ pattern = get_script_tag_pattern(tag)
86
+ match = pattern.search(file_content)
87
+ if not match:
88
+ continue
89
+
90
+ value = match.group("value")
91
+ value_start = match.start("value")
92
+
93
+ for excess_match in PATTERN.finditer(value):
94
+ whitespace_pos = excess_match.start() + value_start
95
+ self.matches.append((whitespace_pos, excess_match.group()))
96
+ fullmatch = match.group()
97
+ yield LinterWarning(
98
+ f"value of script_tag {match.group('name')} has at least"
99
+ " one occurence of excess whitespace before a dot:"
100
+ f"\n '{fullmatch}'",
101
+ file=nasl_file,
102
+ plugin=self.name,
103
+ )
104
+
105
+ def fix(self) -> Iterator[LinterResult]:
106
+
107
+ if not self.matches:
108
+ return
109
+
110
+ # Sort matches by position, descending order to avoid messing up indices during replacement
111
+ self.matches.sort(reverse=True)
112
+
113
+ file_content = self.context.file_content
114
+ for pos, match_str in self.matches:
115
+ # Replace the match by removing the excess whitespace before the dot
116
+ fixed_str = re.sub(r"\s+\.", ".", match_str)
117
+ file_content = (
118
+ file_content[:pos]
119
+ + fixed_str
120
+ + file_content[pos + len(match_str) :]
121
+ )
122
+
123
+ with open(self.context.nasl_file, "w", encoding=CURRENT_ENCODING) as f:
124
+ f.write(file_content)
125
+
126
+ yield LinterFix(
127
+ "Excess spaces were removed",
128
+ file=self.context.nasl_file,
129
+ plugin=self.name,
130
+ )
@@ -2,12 +2,14 @@
2
2
  # SPDX-FileCopyrightText: 2024 Greenbone AG
3
3
 
4
4
  import re
5
- from argparse import ArgumentParser, Namespace
5
+ from argparse import ArgumentParser, ArgumentTypeError, Namespace
6
6
  from dataclasses import dataclass
7
7
  from enum import Enum
8
8
  from pathlib import Path
9
9
  from typing import Iterable, Optional
10
10
 
11
+ from pontos.terminal.terminal import ConsoleTerminal
12
+
11
13
  from troubadix.argparser import directory_type, file_type
12
14
  from troubadix.helper.patterns import (
13
15
  ScriptTag,
@@ -15,6 +17,7 @@ from troubadix.helper.patterns import (
15
17
  get_script_tag_pattern,
16
18
  get_special_script_tag_pattern,
17
19
  )
20
+ from troubadix.troubadix import from_file
18
21
 
19
22
 
20
23
  class Deprecations(Enum):
@@ -34,6 +37,15 @@ class DeprecatedFile:
34
37
  KB_ITEMS_PATTERN = re.compile(r"set_kb_item\(.+\);")
35
38
 
36
39
 
40
+ def existing_file_type(string: str) -> Path:
41
+ file_path = Path(string)
42
+ if not file_path.exists():
43
+ raise ArgumentTypeError(f'File "{string}" does not exist.')
44
+ if not file_path.is_file():
45
+ raise ArgumentTypeError(f'"{string}" is not a file.')
46
+ return file_path
47
+
48
+
37
49
  def update_summary(file: DeprecatedFile, deprecation_reason: str) -> str:
38
50
  """Update the summary of the nasl script by adding the information
39
51
  that the script has been deprecated, and if possible, the oid of
@@ -83,26 +95,18 @@ def get_files_from_path(dir_path: Path = None) -> list:
83
95
  return [file for file in dir_path.glob("**/*")]
84
96
 
85
97
 
86
- def filter_files(
87
- files: list, filename_prefix: str = None
88
- ) -> list[DeprecatedFile]:
89
- """Filter the files based on a provided prefix and convert them into
98
+ def parse_files(files: list) -> list[DeprecatedFile]:
99
+ """Convert filepaths into
90
100
  DeprecatedFile objects
91
101
 
92
102
  Args:
93
103
  files: a list of files to deprecate, should be .nasl VTs
94
- filename_prefix: an optional prefix to filter only specific files
95
104
 
96
105
  Returns:
97
106
  List of DeprecatedFile objects
98
107
 
99
108
  """
100
109
  to_deprecate = []
101
- if filename_prefix:
102
- filename_filter = re.compile(rf"{filename_prefix}")
103
- files[:] = [
104
- file for file in files if re.match(filename_filter, file.name)
105
- ]
106
110
 
107
111
  for file in files:
108
112
  with file.open("r", encoding="latin-1") as fh:
@@ -193,16 +197,6 @@ def parse_args(args: Iterable[str] = None) -> Namespace:
193
197
  required=True,
194
198
  help="Path where the deprecated files should be written to.",
195
199
  )
196
- parser.add_argument(
197
- "-p",
198
- "--filename-prefix",
199
- metavar="<filename_prefix>",
200
- nargs="?",
201
- default=None,
202
- type=str,
203
- help="The prefix of the files you would like to deprecate,"
204
- "for example 'gb_rhsa_2021' to filter on the year",
205
- )
206
200
  parser.add_argument(
207
201
  "-r",
208
202
  "--deprecation-reason",
@@ -214,16 +208,17 @@ def parse_args(args: Iterable[str] = None) -> Namespace:
214
208
  "been merged with another still active VT, 'duplicate': The VT has"
215
209
  "a still active duplicate, 'defunct': The VT is no longer "
216
210
  "functional.",
211
+ required=True,
217
212
  )
218
213
  group = parser.add_mutually_exclusive_group(required=True)
219
214
  group.add_argument(
220
215
  "-f",
221
- "--files",
222
- metavar="<files>",
216
+ "--file",
217
+ metavar="<file>",
223
218
  nargs="+",
224
219
  default=None,
225
220
  type=file_type,
226
- help="Files to deprecate",
221
+ help="File to deprecate",
227
222
  )
228
223
  group.add_argument(
229
224
  "-i",
@@ -231,20 +226,36 @@ def parse_args(args: Iterable[str] = None) -> Namespace:
231
226
  metavar="<input_path>",
232
227
  default=None,
233
228
  type=directory_type,
234
- help="Path to the existing nasl script directory",
229
+ help="Path to a directory where all files should be deprecated.",
230
+ )
231
+ group.add_argument(
232
+ "--from-file",
233
+ metavar="<from_file>",
234
+ default=None,
235
+ type=existing_file_type,
236
+ help=(
237
+ "Path to a single file that contains a list of files "
238
+ "to be deprecated, separated by new lines."
239
+ ),
235
240
  )
236
241
  return parser.parse_args(args)
237
242
 
238
243
 
239
244
  def main():
240
245
  args = parse_args()
246
+ terminal = ConsoleTerminal()
241
247
  input_path = args.input_path if args.input_path else None
242
- filename_prefix = args.filename_prefix
248
+ files = []
243
249
 
244
- files = args.files or get_files_from_path(input_path)
245
- filtered_files = filter_files(files, filename_prefix)
250
+ if input_path:
251
+ files = get_files_from_path(input_path)
252
+ elif args.from_file:
253
+ files = from_file(include_file=args.from_file, term=terminal)
254
+ elif args.file:
255
+ files = args.file
246
256
 
247
- deprecate(args.output_path, filtered_files, args.deprecation_reason)
257
+ to_be_deprecated = parse_files(files)
258
+ deprecate(args.output_path, to_be_deprecated, args.deprecation_reason)
248
259
 
249
260
 
250
261
  if __name__ == "__main__":
File without changes
File without changes