-
Notifications
You must be signed in to change notification settings - Fork 187
Refactor - split to modules, add parser tests, update readme #200
Conversation
tox | ||
pathlib |
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.
So, I have a quibble with this file. Is tox a test dependency and the rest are dependencies enumerated in tox, or are these test dependencies and tox is a different kind of requirement?
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.
Separated to tests.txt
and test_env.txt
.
# Conflicts: # src/pydocstyle.py # src/pydocstyle/tests/test_decorators.py
@sigmavirus24 care to take another look? I fixed the issue with the |
|
||
Example | ||
------- | ||
>>> check(['pydocstyle.py'], checked_codes=['D100']) |
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.
FYI, checked_codes
will no longer work
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.
Updated the docstring.
count = 0 | ||
for error in errors: | ||
sys.stderr.write('%s\n' % error) | ||
code = ReturnCode.violations_found |
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.
Is it necessary to reassign this for every error? Why not do something like:
count = 0
for error in errors:
print('%s' % error) # because we all agree sys.stderr isn't correct
count += 1
if count > 0:
code = ReturnCode.violations_found
else:
code = ReturnCode.no_violations_found
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.
Fixed.
Sorry for the lag in review @Nurdok this is a huge change, and my own personal life is a bit hectic and will be so for a couple weeks. So I'm reviewing this in chunks of free time as I find them. =) |
|
||
count = 0 | ||
for error in errors: | ||
sys.stderr.write('%s\n' % error) |
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.
print instead of sys.stderr?
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.
Since this is a change in behavior, I'd rather do this in a separate PR from this refactoring.
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.
That sounds perfectly reasonable to me :)
Some questions too:
|
No problem about the lag - I appreciate the review and it's not urgent.
Thanks! |
@Nurdok having the tests in the package is perfectly fine too. I didn't mean to convince you to undo that. I'm just curious as to why you did it. The reason I ask is because I have seen the benefit of always importing the fully-qualified module after it's been installed in the virtualenv via tox. This is why Flake8 has The reason I bring this up is because I think I saw relative imports in the tests and that concerns me a bit. If you're not testing what gets installed into a virtualenv, you're not testing what a user will receive after running |
I realize the test location is a preference, but as I read your suggestion it immediately became clear to me that it would solve all the ugly relative imports, so I'll take it :) |
Hah, cool. =D |
Do you see a reason not to put tests in |
Nope. =) |
I completed both points, although |
@sigmavirus24 I merged this so that other work on pydocstyle can continue. If you have further comments, I'll be happy to hear them. Cheers! |
@sigmavirus24 If you have some time, I'd love it if you could give this a look.
Also, this fixes #196.