-
-
Notifications
You must be signed in to change notification settings - Fork 33
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
Update signature of compare/diff built-in functions step by step #1052
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
d2e08c7
to
68d8c0f
Compare
BenchmarkManyRunbooks-4
Metadata
BenchmarkOpenAPI3-4
Metadata
BenchmarkSingleRunbook-4
Metadata
Reported by octocov |
Code Metrics Report
Details | | main (68d8c0f) | #1052 (f70567e) | +/- |
|---------------------|----------------|-----------------|--------|
- | Coverage | 64.4% | 64.4% | -0.1% |
| Files | 77 | 77 | 0 |
| Lines | 8666 | 8682 | +16 |
+ | Covered | 5589 | 5597 | +8 |
- | Code to Test Ratio | 1:0.7 | 1:0.7 | -0.1 |
| Code | 15941 | 15973 | +32 |
+ | Test | 11663 | 11664 | +1 |
- | Test Execution Time | - | 5m38s | +5m38s | Code coverage of files in pull request scope (75.7% → 75.4%)
Reported by octocov |
@k2tzumi |
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.
I have included below a comment expressing my feelings
#1047 (comment)
if len(ignores) > 1 { | ||
deprecation.AddWarning("diff/compare", "diff/compare(x, y, ignores...string) is deprecated. Use diff/compare(x, y, ignores []string) instead.") | ||
} |
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.
I understood that it would be phased out.
case []any: | ||
for _, vv := range v { | ||
s, ok := vv.(string) | ||
if !ok { | ||
return "", fmt.Errorf("invalid ignore specifiers: %v", vv) | ||
} | ||
ignoreSpecifiers = append(ignoreSpecifiers, s) | ||
} |
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.
Currently accepting ANY for compatibility, so it needs to be checked.
@@ -25,7 +52,7 @@ func Diff(x, y any, ignorePaths ...string) (string, error) { | |||
return "", err | |||
} | |||
|
|||
jqIgnorePaths, cmpIgnoreKeys := impl.splitIgnoreSpecifiers(ignorePaths) | |||
jqIgnorePaths, cmpIgnoreKeys := impl.splitIgnoreSpecifiers(ignoreSpecifiers) |
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.
This process will also be unnecessary in the future.
merge: | ||
test: | | ||
compare( | ||
{"a": 1, "b": 3, "c": 5}, | ||
{"a": 1, "b": 2, "c": 4}, | ||
"b", "c" | ||
) |
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.
This test here will fail in the future.
ref: #1047
Because variadic arguments like Go cannot be used in expr-lang.
While accepting both arguments, deprecate the variadic argument type.