Skip to content

Add doc warning for risky plugin names (related to #1694) #1722

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions docs/plugindevelopment.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.. warning::

Avoid naming your plugin directory or module lib, test, or utils. These names are common in Python or used internally by some backends (e.g., Slack). Using them may cause your plugin to fail to load due to module resolution conflicts. Prefer unique, descriptive names such as lib_tools or myplugin_utils.
6 changes: 5 additions & 1 deletion errbot/plugin_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,11 @@ def _load_plugins_generic(
feedback: Dict[Path, str],
):
self._install_potential_package_dependencies(path, feedback)
plugfiles = path.glob("**/*." + extension)

plugfiles = []
for ext in ("plug", "plugin"):
plugfiles.extend(path.glob(f"**/*.{ext}"))

for plugfile in plugfiles:
try:
plugin_info = PluginInfo.load(plugfile)
Expand Down