-
Notifications
You must be signed in to change notification settings - Fork 10
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
Support natural sorting on attributes #356
Conversation
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.
natsort introduced on effort
There are other sorting methods besides alphabetical and natural. The configuration must be flexible enough to support those as well. https://natsort.readthedocs.io/en/master/api.html#natsort-api
|
Is the additional cyclomatic complexity acceptable? Reducing it by creating a separate function wouldn't be beneficial in my opinion. @Letme |
Closes #354
The option
:sort:
of theitem-attributes-matrix
sorts items on attribute values alphabetically. This is good and desired as the default behavior.A use case for natural sorting on attribute values came up. For example, sorting on values of the attribute
effort
like11d
and5d
.This PR adds a new configuration value
traceability_attributes_sort = {"effort": natsort.natsorted}
. Any item-attributes-matrix that contains theeffort
attribute will sort on attribute values naturally.This default value can be overridden in conf.py like all other configuration values.