We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ccb1df0 commit 88f293aCopy full SHA for 88f293a
src/codemodder/registry.py
@@ -53,6 +53,11 @@ def default_include_paths(self) -> list[str]:
53
def add_codemod_collection(self, collection: CodemodCollection):
54
for codemod in collection.codemods:
55
wrapper = codemod() if isinstance(codemod, type) else codemod
56
+ if wrapper.id in self._codemods_by_id:
57
+ raise KeyError(
58
+ f"Codemod with id {wrapper.id} is already registered. Consider changing the codemod name or origin."
59
+ )
60
+
61
self._codemods_by_id[wrapper.id] = wrapper
62
self._default_include_paths.update(
63
chain(
0 commit comments