-
Notifications
You must be signed in to change notification settings - Fork 82
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
[MISC] Change value_list_validator construction. #1298
Conversation
Why is it an API break? If the range interface accepts anything that was accepted before and has the same semantics, the API is preserved. We explicitly state that people may not rely on the exact signature, only on the implied semantics. |
Sorry, I added some examples for clarity. There is a syntax break since I cannot use |
@seqan/core ping |
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 just looked into it to get an overview of the implied changes. Found some things
955eb75
to
e90c6d0
Compare
Codecov Report
@@ Coverage Diff @@
## master #1298 +/- ##
==========================================
+ Coverage 97.41% 97.41% +<.01%
==========================================
Files 216 216
Lines 8671 8675 +4
==========================================
+ Hits 8447 8451 +4
Misses 224 224
Continue to review full report at Codecov.
|
@@ -691,16 +692,33 @@ TEST(validator_test, arithmetic_range_validator_error) | |||
|
|||
TEST(validator_test, value_list_validator_success) | |||
{ | |||
// type deduction | |||
// -------------- | |||
// all arithmetic types are deduced to double in order to easily allow chaining of arithmetic validators |
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 explanation could also go into the class docs. I was actually wondering why it's double
for all arithmetic types...
e90c6d0
to
32e6552
Compare
32e6552
to
e0df972
Compare
@@ -90,7 +90,7 @@ void initialize_argument_parser(argument_parser & parser, cmd_arguments & args) | |||
|
|||
//![value_list_validator] | |||
parser.add_option(args.aggregate_by, 'a', "aggregate-by", "Choose your method of aggregation.", | |||
option_spec::DEFAULT, value_list_validator{{"median", "mean"}}); | |||
option_spec::DEFAULT, value_list_validator{"median", "mean"}); |
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.
In general these files seem not to follow our style guide which they actually should but that is for another time. It seems we need to go through the tutorials anyway before the release. But maybe you can mark it already as a card so we do not forget about it.
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.
which style do you mean specifically?
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 all-or-nothing rule:
if you break on a line, then put every argument on a separate line
parser.add_option(args.aggregate_by,
'a',
"aggregate-by",
"Choose your method of aggregation.",
option_spec::DEFAULT,
value_list_validator{{"median", "mean"}});
dcb703a
to
73bfa5a
Compare
73bfa5a
to
80aebe8
Compare
23a4527
to
2fcdd2f
Compare
2fcdd2f
to
c19bb3e
Compare
Part of #1196
I noticed that you cannot construct a value_list_validator from a simple range (only from a vector or initialiser list). I added construction from a range, as well as construction from a parameter pack which makes initialiser lists obsolete, but this is an API break. @seqan/core Should I still provide an initialiser list constructor?
Also: where in the changelog did we report API changes?