-
Notifications
You must be signed in to change notification settings - Fork 187
[Feature Request] Add API to disable noqa support #484
Comments
Trying to hack this into flake8-docstrings will go poorly. As a Flake8 and Flake8-docstrings maintainer I'd rather start with something in the API only that allows us to gather all results because it will be very confusing going forward why we're overriding |
I never proposed to hack something into flake8-docstrings to change pydocstyle's behavior, that would be painful to maintain, and it would be trying to solve the problem at the wrong layer. I did file this issue on pydocstyle, not flake8-docstrings. I'm asking for feature parity between pydocstyle and flake8, they both parse and respect pydocstyle not having an equivalent to If you'd rather expose this functionality in pydocstyle via an API only, or prefer some different way of getting violations from pydocstyle to flake8 that bypasses its |
To me it looks like adding a boolean argument (with default value matching current behavior, of course) to e.g.
(deliberately didn't reformat to keep the diff small, and edited the diff as I missed a test the first time. I haven't actually tested any of this yet, I'm just questioning if this is the direction you're proposing) flake8-docstyle could then simply add Instead of a bool it could also be a list of codes to always return if you want more flexibility. |
This is why I preferred this direction. flake8-docstrings really wants to give all of the errors to Flake8 and let that make decisions. I think it's an anti-pattern for every tool to implement the same options as Flake8 and proliferate that maintenance across a bunch of already stretched thin maintainers. That's why I reacted to your solution-y feature request of adding more maintenance and support burden to this project |
Added to ConventionChecker.check_source() and ConventionChecker.check(). This allows other systems that integrate pydocstyle, such as flake8-docstyle, to request errors that are otherwise skipped due to # noqa comments. Added test for skip_errors feature in general and with this flag. Fixes PyCQA#484
Apologies, I misstated my original ask. My primary concern was simply to enable this functionality for flake8-docstrings, which is why I explicitly wrote:
It just seemed to me that asking for API surface without exposing that to users was a bit odd, so I phrased it in the terms of a user-facing feature. Especially considering that apparently I'll modify the title of this issue to reflect just the API changes, and submit a separate issue to add the option to expose the API to users. Feel free to close that one as a "won't fix", but I think it's worth having the paper trail of the discussion in case it comes up again or others want to chime in. In general, I agree that having While writing the tests, I noticed that pydocstyle also doesn't respect the flake8 |
(and apologies if you feel I'm spamming you with irrelevant issues. I'll gladly close them myself if you'd prefer.) |
* Add disable_skip_errors flag to ConventionChecker API Added to ConventionChecker.check_source() and ConventionChecker.check(). This allows other systems that integrate pydocstyle, such as flake8-docstyle, to request errors that are otherwise skipped due to # noqa comments. Added test for skip_errors feature in general and with this flag. Fixes #484 * Update release notes * rename argument to ignore inline noqa comments * Add docstring description of new argument * Move release note Co-authored-by: Sambhav Kothari <sambhavs.email@gmail.com>
flake8 has an option to disable
# noqa
comments. When running pydocstyle as a flake8 plugin (via flake8-docstrings) and using flake8's--disable-noqa
option,# noqa
comments still block all violation reports from pydocstyle because pydocstyle is processing those comments itself and deciding to not send the reports at all.It would be great if pydocstyle supported a feature equivalent to flake8's
--disable-noqa
and once that's in place, flake8-docstrings activated that feature so that flake8 sees all reports regardless of# noqa
comments and could make its own decision to report them or not.(I understand that would be a separate issue on flake8-docstrings once support is added to pydocstyle, I just mention it to ensure that the feature can be activated directly in
ConventionChecker.check_source()
as well as via traditional means).The text was updated successfully, but these errors were encountered: