Support arg+ syntax for argument capture#108
Closed
johnrengelman wants to merge 1 commit intotarget:masterfrom
johnrengelman:varargs
Closed
Support arg+ syntax for argument capture#108johnrengelman wants to merge 1 commit intotarget:masterfrom johnrengelman:varargs
johnrengelman wants to merge 1 commit intotarget:masterfrom
johnrengelman:varargs
Conversation
Pull Request Test Coverage Report for Build 229
💛 - Coveralls |
wass3r
requested changes
Sep 15, 2019
Collaborator
wass3r
left a comment
There was a problem hiding this comment.
@johnrengelman thanks for the contribution! Just one quick fix. I have tested otherwise and seems good to me. If you're up to it, would love to see this mentioned in docs. I created an issue for it at target/flottbot-docs#34.
| message.Output = msg | ||
| return false | ||
| } | ||
| if strings.HasSuffix(rule.Args[len(rule.Args)-1], "+") { |
Collaborator
There was a problem hiding this comment.
Super quick fix here. This trips up when length of rule.Args is zero. A fix here should get us past the tests.
Collaborator
|
Thanks @johnrengelman for the idea and majority of the work. We finished it out in #116 |
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.
Proposed change
Allow a rule to capture the remaining arguments by adding a
+to the argument name in the rule.Variable argument capture can only be activated on a single argument at the end of the argument list. It cannot be combined with optional arguments.
Types of changes
What types of changes is this pull request introducing to flottbot? Put an
xin the boxes that applyChecklist
You can fill this out after creating your PR. Put an
xin the boxes that apply