From 7b1be418e1ffbfdcfc930f3c39169512744580a2 Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Wed, 11 Oct 2023 12:00:05 -0400 Subject: [PATCH 1/2] fix: plugin wrapper repr not helpful Signed-off-by: Henry Schreiner --- src/validate_pyproject/plugins/__init__.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/validate_pyproject/plugins/__init__.py b/src/validate_pyproject/plugins/__init__.py index 56d22a1..d2a9022 100644 --- a/src/validate_pyproject/plugins/__init__.py +++ b/src/validate_pyproject/plugins/__init__.py @@ -47,6 +47,9 @@ def help_text(self) -> str: return "" return Template(tpl).safe_substitute(tool=self.tool, id=self.id) + def __repr__(self) -> str: + return f"{self.__class__.__name__}({self.tool!r}, {self._load_fn!r})" + def iterate_entry_points(group=ENTRYPOINT_GROUP) -> Iterable[EntryPoint]: """Produces a generator yielding an EntryPoint object for each plugin registered From 55ee081471db8c195e46d5c03f55237fb61e626e Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Wed, 11 Oct 2023 14:23:52 -0400 Subject: [PATCH 2/2] Update src/validate_pyproject/plugins/__init__.py Co-authored-by: Anderson Bravalheri --- src/validate_pyproject/plugins/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/validate_pyproject/plugins/__init__.py b/src/validate_pyproject/plugins/__init__.py index d2a9022..95206be 100644 --- a/src/validate_pyproject/plugins/__init__.py +++ b/src/validate_pyproject/plugins/__init__.py @@ -48,7 +48,7 @@ def help_text(self) -> str: return Template(tpl).safe_substitute(tool=self.tool, id=self.id) def __repr__(self) -> str: - return f"{self.__class__.__name__}({self.tool!r}, {self._load_fn!r})" + return f"{self.__class__.__name__}({self.tool!r}, {self.id})" def iterate_entry_points(group=ENTRYPOINT_GROUP) -> Iterable[EntryPoint]: