Allow setting default priority to empty
Hi, I want to set my default priority to none/empty, but this is currently not possible because ConfigParser always reads a string and taskw only accepts 'L', 'M', 'H' or the None literal.
I checked out the project and got it fixed, but before I can do a pull request, I am asking how do you prefer it to be fixed. This are the alternatives I can think of, from best to worse:
- After reading the config file check if the default_priority is
'None'as a string and change it to a literal. (Cons: doesn't feel like a clean solution) - Make
Nonethedefault_priorityinstead of'M'. (Cons: It will change the current expected behavior of bugwarrior) - Set the
allow_no_valueflag in ConfigParser. (Cons: it could make it difficult to spot and debug errors in the bugwarriorrc file)
P.S. Thanks for bugwarrior it is really useful
I agree 1 doesn't seem clean. I don't feel strongly about 2 but I suspect the impact of changing a default like that is not worth it. I don't think 3 is a problem -- to me it's normal ini-file weirdness.
Totally voting for 3 here. Being able to write default_priority = feels like a very intuitive solution.
Just to add a little detail to this discussion: what the allow_no_value option provides is the ability for you to specify config values without the = following afterward. That is, something like key_without_value below:
[somesection]
normal_key_with = value
key_without_value
I'm not at all opposed to turning on allow_no_value, but the parser will already parse default_priority = (returned value would be an empty string) with or without our turning on allow_no_value. Wouldn't it just be simpler to interpret default_priority = as requesting that tasks be imported without priority?
Oh gosh, default_priority = is exactly what I thought we were talking about, and mirrors how TaskWarrior sets the empty priority.
I'm now wondering if this worked all along and I just haven't been using it, in which case I'm going to feel very silly indeed!
I had the same impression as @pjf. Apparently we don't need to make any change to the config parsing but perhaps just need to handle the None value.
While the misconception was cleared up it would be good to document proper syntax in Common Service Configuration Options and perhaps add test(s) that the empty value works.
Apparently the empty value does not currently work. See #795.
Hi, I haven't been actively using bugwarrior for a while now, but I am setting it up into my daily workflow again. I have been lying around local changes for quite a while now, one is for actually handling this, I think.
It's been 2.5 years when I made that change, I can't really follow my reasoning back then, but for me it does the job, so that could be a starting point. I use it in conjunction with gitlab, having the following line in my bugwarriorrc:
gitlab.default_priority =
I've also done some other changes that fit my workflow better, but cherry-picking this ontop of develop doesn't explode for me and doesn't add priorities to any of my tasks. So, this might be a starting point. I'd open a pull-request if desired.
Edit: I tried to get behind my reasoning back then and without those modifications, it works as well.
To clarify, I think this issue is about allowing people to change the default_priority setting to empty rather than changing that setting's default value.
Hey there.
I tried pretty much every thing before googling and finding this page.
-
gitlab.default_priority -
gitlab.default_priority = -
gitlab.default_priority = None -
gitlab.default_priority = '' -
gitlab.default_priority = 'None" - Etc
As said by @ryneeverett I simply want the default_priority to be None.
The default being M is not the issue but not being able to change it to None is.
This needs better documentation.
I tried everything I could think of and it does not allow me to set it empty no matter what I do
ValueError: 'None' is not a valid choice; choices: ['H', '', 'L']
Yeah, we should probably have a code block of examples in the Common Service Configuration Options section.
My recollection:
- If you're using ini format it should be
gitlab.default_priority= - If you're using toml it should be
default_priority = ""
- If you're using ini format it should be
gitlab.default_priority=- If you're using toml it should be
default_priority = ""
I'm pretty sure I tried both, and none worked, had to use L meanwhile.
@adriangalilea The fix for this bug has not yet been released and I suspect you're using the latest 1.8.0 stable release.
Actually, no, empty string doesn't work in develop branch either. I am using toml config with default_priority = "" in jira and I get an error ValueError: 'None' is not a valid choice; choices: ['H', 'M', '', 'L']. Not sure why that is.
@Rahlir Maybe this should be opened then.
Actually, no, empty string doesn't work in develop branch either. I am using toml config with
default_priority = ""in jira and I get an errorValueError: 'None' is not a valid choice; choices: ['H', 'M', '', 'L']. Not sure why that is.
Yikes. Thanks for the report!