fix: Ignore packages that are not plugins#1
Merged
mmartinortiz merged 3 commits intomasterfrom Jan 28, 2022
Merged
Conversation
When a package starting with a plugin name is found, but it is not a plugin, it becomes safely ignored.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
commitizenfor 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
commitizendiscover 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/formatand./script/testlocally 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_thisattribute, will be ignored and the user will get a warningSteps to Test This Pull Request
cz_. It can be located under asrcfoldercommitizencommitizen changelog --help. Without this patch, an exception will be risen.Additional context