napari / cookiecutter-napari-plugin

Cookiecutter for napari plugins
BSD 3-Clause "New" or "Revised" License
67 stars 39 forks source link

Bugfix: check for underscores in plugin name #164

Closed GenevieveBuckley closed 11 months ago

GenevieveBuckley commented 1 year ago

Bugfix for check for underscores in plugin name. Must use re.search (not re.match) to detect an underscore anywhere in the plugin name string.

import re

re.search(r"_", "plugin_name_with_underscores") # returns matches
# but
re.match(r"_", "plugin_name_with_underscores")  # returns None, because no underscore was detected at the *beginning* of this string.
GenevieveBuckley commented 11 months ago

@Czaki and @DragaDoncila, we discussed this briefly at the meeting - can one of you give it a quick review so we can merge?

It is a very straightforward bugfix but I don't want to merge my own PR, that would be a bad habit.