Closed tangoalx closed 2 years ago
@jacebrowning: I think I can get a solution for that quickly. But I would like to hear your opinion on that:
Default values given by command line option -d
are just taken from the given defaults.yml
file as it is - the yml attribute "defaults" is not expected in that file. That is inconsistent to the way we include defaults in the .doorstop
file, which demands a defaults-req.yml
file which contains the yml attribute defaults
as top level element. I would like to harmonize that. This also requires adaption of documentation here.
From my understanding a command line option overwrites stored defaults completely. The idea behind the example leading to this bug is a very practical one: I want to be able to set defaults for normative requirements, but in case of non-normative ones, I want to be able to set different defaults. As normative and non-normative requirements are exclusive, I also need the defaults to be exclusive. I can also imagine different types of requirements being exclusive and requiring a template, so that the requirement engineer can apply that quickly. On the other hand, I can also imagine user-scenarios demanding to add further defaults on top of already given ones. There are several ways a user would still be able to accomplish that (e.g. providing more different default files, or even extracting common attributes into files and use the pyyaml include
technique).
- Default values given by command line option
-d
are just taken from the givendefaults.yml
file as it is - the yml attribute "defaults" is not expected in that file. That is inconsistent to the way we include defaults in the.doorstop
file, which demands adefaults-req.yml
file which contains the yml attributedefaults
as top level element. I would like to harmonize that. This also requires adaption of documentation here.
That's not really an issue to be honest. That just found out that it was my misusage - it is possible to get around it, if designing the yml more elegant.
The fix for this is available here: https://pypi.org/project/doorstop/3.0a2/
Intro
When I set attributes in a .doorstop file, then I cannot use the
doorstop add -d defaults.yml REQ
command to use a different set of default attributes for a newly created requirement.Basically the
-d
option works as expected, if no default values have been set in the.doorstop
file.I'm using doorstop version 2.2b5.
My setup
.doorstop
defaults-req.yml
defaults.yml
Run
command line:
Result
When I look into the item, then I see that instead of applying
defaults.yml
, thedefaults-req.yml
is applied, but thedefaults.yml
has been just copied as a whole in the yml file.REQ-001.yml
Expected
A command line option must always override the default values otherwise the option is pointless.
REQ-001.yml