-
Notifications
You must be signed in to change notification settings - Fork 187
Conversation
Comments like "#noqa" can be added to the end of function and method definitions to skip checks.
I'm starting to think that certain things should be part of reusable library code because now pycodestyle, pydocstyle, and flake8 have just slightly different implementations of almost the same thing and that's going to lead to really weird inconsistencies between the three. Further, from what I can tell, this will directly conflict with people running pydocstyle from inside Flake8 (e.g., via flake8-docstrings), which is something I'm strongly against. |
How do you mean? |
This might be true, but I'd prefer to do that as a separate subsequent refactoring. It will be hard to get all these libraries to settle on and adopt a new shared API, and in the meantime, something like this is badly needed for this library to be usable for many people. |
Actually it looks like
So I don't see any conflicts in this scheme...? |
* Added the ability to ignore specific function and method doctstrings with | ||
comments: | ||
|
||
1. "# noqa" or "# pydocstyle: noqa" skips all checks. |
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.
@Eric89GXL This and # pydocstyle: D102,D203
are what I'm talking about. You should just use # noqa
below. Even so, having # pydocstyle: noqa
in a file will skip the whole file? That's what people are going to expect from having used # flake8: noqa
. You're going to confuse people with 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.
Absolutely, but that means the logic in this PR would only complicate that because it's completely turning the semantics of these comments on their head. I don't see a need to use |
@sigmavirus24 Got rid of |
Do you really need to invoke Could you use |
I'll try those alternatives |
@jayvdb I tried
I assume there are workarounds for this, but isn't it less clean than having |
|
@Eric89GXL note, that there are many teams in the PyCQA and @jayvdb is a member of one (which is not the team that maintains pydocstyle). My opposition was merely in having divergent behaviour between two projects which you seem to have resolved. If you have need for specific configuration from pydocstyle in flake8's configuration through |
But maybe I'm missing how simple your alternative proposal is. Can you
write the docs to describe the process you mean, since they should probably
be included anyway?
|
So in other words, once I have flake8-docstyle installed, I have to change
existing workflows? This seems inferior to having pydocstyle support
reasonable options out of the box without needing to install two or three
other libraries and change calls and configurations in non obvious ways.
I'm not sure why you'd want to promote this as the standard for how to
achieve this functionality.
Why such strong opposition to this? Maintenance burden?
|
So this PR's documentation / API proposal was:
Since it's not being used, I guess the doc should have something like this added to show people how to use it with current
I think step (4) is especially painful for devs who work on multiple repos, many of which use |
Hi folks - sorry for joining this party so late :) @sigmavirus24 - it seems like the issues you mentioned have been resolved (not using @Eric89GXL - thanks for the PR. I'll go ahead and give you a code review now :) |
@@ -17,3 +17,9 @@ Configuration Files | |||
^^^^^^^^^^^^^^^^^^^ | |||
|
|||
.. include:: snippets/config.rst | |||
|
|||
|
|||
Per-file configuration |
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.
How about "In-file configuration" so it'll be more clear?
Thanks fro the comments @Nurdok, comments addressed. I'm happy to squash to a single commit so I avoid touching a bunch of now-unchanged lines if it helps. |
In-file configuration | ||
^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
.. include:: snippets/per_file.rst |
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.
The snippet name should also be changed.
@@ -140,13 +144,17 @@ def is_empty_or_comment(line): | |||
return ''.join(reversed(list(filtered_src))) | |||
|
|||
def __str__(self): | |||
return 'in %s %s `%s`' % (self._publicity, self._human, self.name) | |||
out = 'in %s %s `%s`' % (self._publicity, self._human, self.name) |
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.
Please change this to format
as well while you're at it :)
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.
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'll only hold you to lines you changed, but if you feel like going over the code, I'd be grateful.
@Eric89GXL Just a few more comments :) I don't really mind about squashing either way. |
@Nurdok comments addressed. The only |
Merged! |
Allows per-function skips. Ready for review/merge from my end.
I added tests and updated docs in hopefully correct ways.
Closes #202.
Closes #97.