Skip to content

print.empty.columns truthness values are not properly handled #266

@fdela

Description

@fdela

Describe the bug
In taskwarrior configuration file, boolean truthness values can be represented by the following values, case insensitive (from taskrc manpage):

Note that Taskwarrior is flexible about the values used to represent Boolean items. You can use "on", "yes",
"y", "1" and "true". Anything else means "off".

vit only accepts yes (lowercase) to represent truth in print.empty.columns config variable.

To Reproduce

  1. Configure print.empty.columns with any of the above mentionned truthness values, case insensitive, except yes (attached test case uses True)
  2. Display next report
  3. Compare with task next output

=> Columns with no data are not displayed

Expected behavior
Columns with no data are displayed.

Affected code

vit/vit/config_parser.py

Lines 220 to 221 in 1e1d010

def set_config_data(self):
self.print_empty_columns = self.subtree('print.empty.columns') == 'yes'

Something like

self.print_empty_columns = self.subtree('print.empty.columns').lower() in ['y', 'yes', 'on', 'true', '1']

would fix this specific issue.

Test case
print-empty-columns.sh.txt

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions