fix: avoid name[casing] auto-fix crash on multi-segment prefixes#5026
Open
bishalOps wants to merge 1 commit intoansible:mainfrom
Open
fix: avoid name[casing] auto-fix crash on multi-segment prefixes#5026bishalOps wants to merge 1 commit intoansible:mainfrom
bishalOps wants to merge 1 commit intoansible:mainfrom
Conversation
9124c08 to
8e71fdf
Compare
8e71fdf to
7dbcfc0
Compare
Contributor
|
I just created a similar fix for a similar bug in another rule (#5028). Maybe someone should check all (I'm surprised that there isn't a linting rule for this already, since it's a pretty common error I have seen way too often in too many different projects...) |
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.
Summary
ansible-lint --fixcrashed withValueError: too many values to unpackon task/play names containing more than one|(the documented multi-segment prefix convention, e.g.foo | destroy | Terminate serverhttps://docs.ansible.com/projects/lint/rules/name/#nameprefix). Switch thename[casing]auto-fix fromsplit("|")torsplit("|", 1)so the prefix is preserved and only the description is capitalized.Added a test fixture mirroring the docs'
foo | destroy | …example to lock in the fix.Reproducer
Without the fix:
After the fix: