-
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 seqan3::option_spec enum names to lower case. #2285
[MISC] Change seqan3::option_spec enum names to lower case. #2285
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2285 +/- ##
=======================================
Coverage 98.18% 98.19%
=======================================
Files 261 262 +1
Lines 10820 10853 +33
=======================================
+ Hits 10624 10657 +33
Misses 196 196
Continue to review full report at Codecov.
|
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.
Looks Good, just wondered if seqan3::option_spec::default
might be more straight forward ? 🥳
1630b92
to
6d786e9
Compare
|
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.
Thank you. The defaulted
-> default
naming should be addressed. Maybe you can independently of me research about the meaning defaulted
as an adjective. If I am not mistaken, then we have this all over the library 😢
| REQUIRED | Required options will cause an error if not provided. | | ||
| ADVANCED | Advanced options are only displayed wit `-hh/--advanced-help`. | | ||
| HIDDEN | Hidden options are never displayed when exported. | | ||
| defaulted | The default tag with no special behaviour. | |
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 think the meaning of defaulted as adjective is wrong here. So default
was actually correct.
And I just realise that we use this misleading word for all the defaulted constructors 🤯.
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.
Again, I cannot use default
:( ! (in lower case letters) because it is a compiler keyword. So I thought defaulted is the next best alternative. If you deem defaulted wrong, how else should we name it?
default
as we use it, is already an adjective. But you can also see it as a verb to default
and then defaulted
is the past tense that can still mean something was set to default. (see https://www.dict.cc/englisch-deutsch/to+default.html, translating to default
to etw. als Standardeinstellung übernehmen
)
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.
But the meaning is rather: required option
, hidden option
etc. As far as I remember, we use a verb for functions only (it would be good if I could point now to the style guide but we don't have it). Nonetheless, I never've seen an enum value as a verb so it would be confusing to start now. Another, question, why do we have a default tag? Would that not be something internal, if the user just does not specify anything? What is the default behaviour? Why do you need to say explicitly it is default, which is already the meaning if I don't specify the other? Maybe we can remove 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.
Nonetheless, I never've seen an enum value as a verb so it would be confusing to start now.
hm.. I see. I have no strong feelings about this.
Another, question, why do we have a default tag?
Because you need to specify the option_spec if you want to specify a validator.
p.add_option(var, 'i', "integer", "desc", option_spec::default, arithmetic_validator{3, 5});
Maybe we can remove it?
Only if we would add an add_option
overload that omits the option_spec before the validator. 🤷
I don't know if we want to add several overloads to allow "a different order".
What is the default behaviour?
Neither, required, advanced nor hidden. Just a normal option.
Possible alternatives (meaning "nothing special"): standard
, normal
, simple
, orderly
, regular
, classic
, usual
.
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 default is public, because you need to provide it if you use a validator:
parser.add_option(args.sam_path, 'o', "output", "The output SAM file path.",
seqan3::option_spec::DEFAULT,
seqan3::output_file_validator{seqan3::output_file_open_options::create_new, {"sam"}});
Maybe we could use something like standard
(which is a synonym of default) or even normal
or general
.
We usually use adjectives or nouns in enums, so defaulted would be the expecption...
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.
New idea: option_spec has "require" semantics instead of "visible" semantics.
The enum names of seqan3::option_spec
were changed to lower case:
seqan3::option_spec::DEFAULT
is replaced byseqan3::option_spec::optional
seqan3::option_spec::standard
(default-visible and non-required).seqan3::option_spec::REQUIRED
is replaced byseqan3::option_spec::required
(default-visible and required).seqan3::option_spec::ADVANCED
is replaced byseqan3::option_spec::advanced
(advanced-visible and non-required).seqan3::option_spec::HIDDEN
is replaced byseqan3::option_spec::hidden
(non-visible and non-required).
Resolution 14-12-2020: We will name it |
@rrahn I included the namechange and updated the documentation :) |
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.
just a minor suggestion for improvement
Co-authored-by: rrahn <[email protected]>
I had some free time to tackle other stuff and this was something API relevant that needed to be done for a while.
Part of seqan/sharg-parser#80
The enum names of
seqan3::option_spec
were changed to lower case:seqan3::option_spec::DEFAULT
is replaced byseqan3::option_spec::defaulted
.seqan3::option_spec::REQUIRED
is replaced byseqan3::option_spec::required
.seqan3::option_spec::ADVANCED
is replaced byseqan3::option_spec::advanced
.seqan3::option_spec::HIDDEN
is replaced byseqan3::option_spec::hidden
.