From e3499e08fdf941f9cd9f03588a33a61f1c4a6b10 Mon Sep 17 00:00:00 2001 From: clavedeluna Date: Mon, 25 Nov 2024 13:28:29 -0300 Subject: [PATCH] add property to get all registered tool rules --- src/codemodder/registry.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/codemodder/registry.py b/src/codemodder/registry.py index 971ac5eb..56abba06 100644 --- a/src/codemodder/registry.py +++ b/src/codemodder/registry.py @@ -52,6 +52,16 @@ def codemods(self): def default_include_paths(self) -> list[str]: return list(self._default_include_paths) + @property + def all_tool_rules(self) -> list[str]: + return [ + rule + for key, values in self._codemods_by_tool.items() + if key != "pixee" + for codemod in values + for rule in codemod.requested_rules + ] + def codemods_by_tool(self, tool_name: str) -> list[BaseCodemod]: return self._codemods_by_tool.get(tool_name, [])