flag: remove dependencies on shared variables#1671
Merged
Conversation
skelouse
reviewed
Jan 29, 2023
See urfave#1670 for context This commit creates a new type separatorSpec that will get passed into flag parser, instead of reading from shared variables.
b42de53 to
dc6dfb7
Compare
dearchap
reviewed
Jan 29, 2023
| a.separator.sep = a.SliceFlagSeparator | ||
| } | ||
|
|
||
| if a.DisableSliceFlagSeparator { |
Contributor
There was a problem hiding this comment.
if a.DisableSliceFlagSeparator {
....
} else if len(a.SliceFlagSeparator) != 0 {
...
}
dearchap
approved these changes
Jan 29, 2023
dearchap
left a comment
Contributor
There was a problem hiding this comment.
Minor comments. Thanks for the PR @zllovesuki
Contributor
Any thoughts on failing tests? |
mudler
referenced
this pull request
in kairos-io/provider-kairos
Jan 30, 2023
[](https://renovatebot.com) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [github.com/urfave/cli/v2](https://togithub.com/urfave/cli) | require | patch | `v2.24.1` -> `v2.24.2` | --- ### Release Notes <details> <summary>urfave/cli</summary> ### [`v2.24.2`](https://togithub.com/urfave/cli/releases/tag/v2.24.2) [Compare Source](https://togithub.com/urfave/cli/compare/v2.24.1...v2.24.2) #### What's Changed - Update README badges for v2 by [@​meatballhat](https://togithub.com/meatballhat) in [https://github.com/urfave/cli/pull/1664](https://togithub.com/urfave/cli/pull/1664) - Target two most recent Go versions in v2 by [@​meatballhat](https://togithub.com/meatballhat) in [https://github.com/urfave/cli/pull/1666](https://togithub.com/urfave/cli/pull/1666) - flag: remove dependencies on shared variables by [@​zllovesuki](https://togithub.com/zllovesuki) in [https://github.com/urfave/cli/pull/1671](https://togithub.com/urfave/cli/pull/1671) - Show non categorized flags with categorized on help by [@​skelouse](https://togithub.com/skelouse) in [https://github.com/urfave/cli/pull/1673](https://togithub.com/urfave/cli/pull/1673) #### New Contributors - [@​zllovesuki](https://togithub.com/zllovesuki) made their first contribution in [https://github.com/urfave/cli/pull/1671](https://togithub.com/urfave/cli/pull/1671) **Full Changelog**: urfave/cli@v2.24.1...v2.24.2 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/kairos-io/provider-kairos). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC4xMDguNCIsInVwZGF0ZWRJblZlciI6IjM0LjExNi4xIn0=--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
1 task
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.
What type of PR is this?
What this PR does / why we need it:
Remove the dependencies of shared variable from slice type flags parsing, and instead use a
separatorSpecfor parsing. This should not fail downstream dependencies that may be running multiple*Appconcurrently with race detector on.Which issue(s) this PR fixes:
Fixes #1670
Special notes for your reviewer:
This commit creates a new type separatorSpec that will get passed into flag parser, instead of reading from shared variables. I'm uncertain that if I may have missed some parts of the code to be injected. Please let me know if I overlooked anything.
With
HideVersionandHideHelp, the integration test mentioned in the issue is now passing with race detector on with this patch applied.Testing
Should be passing with
separatorSpec, assuming that the call site has the configuredseparatorSpecfrom caller.Release Notes