1
0
Fork 0
mirror of synced 2025-01-03 03:39:00 -05:00
dotbot/tests/dotbot_plugin_issue_357.py
Anish Athalye abecc97bad Modernize project
This patch adds static typing, and it switches to the Hatch package
manager and its Hatchling build backend.
2024-12-27 22:01:05 -08:00

19 lines
564 B
Python

from typing import Any
from dotbot.plugin import Plugin
# https://github.com/anishathalye/dotbot/issues/357
# if we import from dotbot.plugins, the built-in plugins get executed multiple times
class NoopPlugin(Plugin):
_directive = "noop"
def can_handle(self, directive: str) -> bool:
return directive == self._directive
def handle(self, directive: str, _data: Any) -> bool:
if directive != self._directive:
msg = f"NoopPlugin cannot handle directive {directive}"
raise ValueError(msg)
return True