fix: Ignore packages that are not plugins #1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When a package starting with a plugin name is found, but it is not a plugin, it becomes safely ignored.
Description
When a packages has a name that matches a plugin, but it is not a plugin, it is safely ignored and reported to the user.
Background: The company where I work, and where I use
commitizen
for releasing package versions, is called CZ. And because we are not very imaginative, we use to call the packages that we develop for internal use something likecz_
.This collides with the way that
commitizen
discover plugins, and the discovery process raises an exception when a package starts with the namecz_
is found but is not implemented as a plugin.This MR proposes a way to ignore those packages that collide in name but are not plugins. This proposal tries to be as agnostic as possible, not very Pythonic, but I am open to suggestions.
Checklist
./script/format
and./script/test
locally to ensure this change passes linter check and testExpected behavior
When the CLI searches for plugins, those packages that have a name
cz_
but lack thediscover_this
attribute, will be ignored and the user will get a warningSteps to Test This Pull Request
cz_
. It can be located under asrc
foldercommitizen
commitizen changelog --help
. Without this patch, an exception will be risen.Additional context