-
Notifications
You must be signed in to change notification settings - Fork 83
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
Small fixes #329
Small fixes #329
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.
Sorry for the slow review; I kinda missed the notification email! 😓
LGTM, I'd just apply some minor changes to this.
Thanks!
|
||
return self._columnize_list(label, lines) | ||
|
||
def _columnize_list(self, label, lst): |
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'd move this function's logic inside _columnize_text
, since it's not really something we're reusing.
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 externalized this part on purpose, because we will use it for the categories. (see PR #323)
todoman/model.py
Outdated
if value is None: | ||
v = '' | ||
elif not isinstance(value, str): | ||
raise ValueError("Got {0} for {1} where str was expected" |
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.
These validations are kinda unreachable, and are mostly here to prevent programming errors. Because of that, I'd much prefer to use assert
, since otherwise these is normally-unreachable code.
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.
Good point, I'll change this part.
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.
Done, changed it into assertions.
Just realized that the (now gone) fourth commit fixes something that is already taken care of in #332. I guess we should wait until this is merged and I'll rebase to the new master. |
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.
LGTM. I'll merge this once master is fixed, which I'll try to do very soon!
Can you merge or rebase master into your branch, so that CI passes? Thanks! |
Done. |
Thanks! Sorry to keep you waiting so long with a broken |
No worries, thanks for merging! |
Small fixes to make life easier:
Todo
model checks types in__setattr__
Formatter
distinguishes text and lists in_columnize
_columize_*
(Work towards solving #323)