-
Notifications
You must be signed in to change notification settings - Fork 261
feat(diff): change default behavior to prune by omission #819
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(diff): change default behavior to prune by omission #819
Conversation
Codecov Report
@@ Coverage Diff @@
## master #819 +/- ##
==========================================
+ Coverage 51.08% 51.39% +0.31%
==========================================
Files 103 103
Lines 9056 9020 -36
==========================================
+ Hits 4626 4636 +10
+ Misses 3553 3510 -43
+ Partials 877 874 -3
Continue to review full report at Codecov.
|
8326493 to
cc00d0a
Compare
kevinrizza
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some small nits, lgtm otherwise
| - If in latest mode (old-refs is specified), a diff between old-refs and new-refs is added to the output. | ||
| - If --include-file is set, items from that file will be added to the diff: | ||
| - If --include-additive is false (the default), a diff will be generated only on those objects, depending on the mode. | ||
| - If --include-additive is true, the diff will contain included objects, plus those added by the mode's invocation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it possible to include some optional help text with example calls?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
| latestMode := !headsOnlyMode | ||
| isInclude := len(g.Includer.Packages) != 0 | ||
|
|
||
| switch { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is a switch statement better than a nested if statement here? Worrying about the default case running or not seems like it would be easy to break on further refactor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An if statement would look more confusing, and a switch statement supports future modes more intuitively.
| }, | ||
| }, | ||
| }, | ||
| IncludeAdditively: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to add some test cases where IncludeAdditively is false for explicit output comparison?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The tests I added elsewhere cover this case. These are mostly to ensure input is parsed and output is rendered correctly with real files.
cc00d0a to
21fd210
Compare
Signed-off-by: Eric Stroczynski <ericstroczynski@gmail.com>
|
/approve |
dinhxuanvu
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dinhxuanvu, estroz, kevinrizza The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
Thanks! |
Description of the change: change the behavior of
opm alpha diffto only include stuff from the include file by default, and optionally act additively with--include-additiveMotivation for the change: it is counterintuitive to include additively by default
Reviewer Checklist
/docs