-
Notifications
You must be signed in to change notification settings - Fork 25
Conversation
For now I'm only checking for the |
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 job!
I left just a comment that a test that can be added to cover the a missing case and it will be ready to merge from my point of view.
config = parse(buf) | ||
assert config[0]['base'] is None | ||
|
||
|
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 think a good addition here would be this test also:
def test_parse_empty_value():
buf = StringIO(u'base: ""')
config = parse(buf)
assert config[0]['base'] is ''
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.
Looks great! I just noted a piece that could stick around for removal in a separate PR.
@@ -15,7 +15,6 @@ | |||
from .config import PYTHON_INVALID | |||
from .validation import INVALID_BOOL | |||
from .validation import INVALID_CHOICE | |||
from .validation import INVALID_DIRECTORY |
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.
Let's keep this line for now, in case we have some side effects from removing a line like this.
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!
e89c7e1
to
b8c68be
Compare
I think this PR is ready to be merged.
I suppose we should look for a general solution for this instead of repeat something like this for every field: if 'field' not in self.raw_config:
return None
field = self.raw_config['field']
if field is None:
return None What do you think? |
@humitos I was thinking of that, but if you look closely, always there are some additional checks before the second step, and at the end, we only will save 1 line of code per method. |
I forgot to delete one line on the merge 🤦♂️ |
@stsewd shall we do a PR into rtd core for this as well? |
@agjohnson yeah! |
Cool. Setting to blocking for now, we'll revisit this after. |
This is ported in readthedocs/readthedocs.org#4461 |
* Port readthedocs/readthedocs-build#38 * Fix test
This fix readthedocs/readthedocs.org#2813