Skip to content

Commit

Permalink
add property to get all registered tool rules (#933)
Browse files Browse the repository at this point in the history
  • Loading branch information
clavedeluna authored Nov 26, 2024
1 parent eae284b commit 4109358
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/codemodder/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -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, [])

Expand Down

0 comments on commit 4109358

Please sign in to comment.