Comments (10)
So no(qa|pep8)
is easily the biggest regret of the flake8/pep8 projects. We refuse to allow it to silence every error and that decision angers users who like to write terrible code. I'm not sure there's a good reason to add this. It might be nice to have, but the doc-string requirements are relaxed enough that I don't see any particular rule that necessitates this. I work on large projects like OpenStack where noqa
is particularly abused and it leads to really inconsistent code-bases where tools like flake8 are supposed to help guide the code and its developers towards a relatively consistent practice.
What particular errors are causing you problems @jayvdb ?
from pydocstyle.
noqa is a tool; how it is used depends on the developers.
It is handy when migrating code to be compliant, which is something that pywikibot is slowly doing. We have a mandatory tox rule which we are add files to as we complete them, or they near completion and have a # noqa or two to help them across the line, so there cant be any regressions in compliance.
We've encountered a few issues with pep257 itself (e.g. issue #78), some which were not even docstring related. We've had to add ugly hacks to our codebase because of pep257 , but we're all pretty keen on cleaning up the codebase, so it is a net positive ;-).
It would be preferable to be able to use # noqa to workaround pep257 problems, when they occur - until they are fixed and released and deployed onto our build machines, if a more elegant solution isnt available.
http://git.wikimedia.org/blob/pywikibot%2Fcore.git/b83e2e9e7dbf01800cc4b3bdef7f31d8ee775fdf/pywikibot%2F__init__.py#L65
http://git.wikimedia.org/blob/pywikibot%2Fcore.git/b83e2e9e7dbf01800cc4b3bdef7f31d8ee775fdf/pywikibot%2F__init__.py#L91
The main outstanding problem in pywikibot is exceptions which use the class docstring as the exception message. Changing that message is an interface change, so adding a '.' at the end of the class docstring should be a major version version, or we need to implement funky method of removing the '.' at runtime when the exception is raised.
http://git.wikimedia.org/blob/pywikibot%2Fcore.git/b83e2e9e7dbf01800cc4b3bdef7f31d8ee775fdf/pywikibot%2Fexceptions.py (search for noqa)
As another example, yesterday I tried to cleanup ez_setup.py, which is copied into many repos (including pywikibot), and met with resistance, which are mostly to do with personal taste wrt the pep257 fixes.
https://bitbucket.org/pypa/setuptools/pull-request/117/pep8-and-pep257-compliance/diff
IMO it is a good thing to push a module as far towards compliance as a maintainer is happy with, and noqa can help reach that objective - the maintainer has at least accepted that this line has problems in a lot of other peoples minds.
from pydocstyle.
👍 on request. any progress on this?
from pydocstyle.
@jayvdb - why isn't flake8's noqa
directive satisfying your needs?
@oryband - this issue was opened just a couple of days ago and we haven't decided if it will be done yet.
from pydocstyle.
Any progress?
from pydocstyle.
@Nurdok this request is about pep257 and not flake8, which we cant run on pull requests from untrusted devs.
from pydocstyle.
@jayvdb I suggest you use a tool like TravisCI which can run flake8
on PRs in a safe environment. Other than that, if the purpose of this issue is to allow you to fix the code bit-by-bit, you can also use the error selection to enable only a closed set of checks, and add to it over time.
While I do understand the request for a per-line ignore and while I have not yet decided against it, it will probably not happen any time soon due to more pressing issues. If the errors you get are localized to few files, I would just ignore the entire files, for now.
from pydocstyle.
As someone who works with django I would like my classes to have docstrings, but it seems a bit silly to have it on the nested meta class.
Ideally I would like to see the errors for nested classes split from top level classes, but a noqa option would solve the issue too.
from pydocstyle.
@hvdklauw Seems reasonable. Can you open a separate issue for that?
from pydocstyle.
I forgot about this issue.
fwiw, my own need for this evaporated after Wikimedia CI allowed executing flake8, and I created https://github.com/jayvdb/flake8-putty so that I could disable specific codes per file & per line.
from pydocstyle.
Related Issues (20)
- option to ban `noqa` comments that don't specify a code
- D102 - false positive on overload with comment
- cosmetic bug: wrong version stamp in webpage title: 1.0.0 instead of 2.1.1
- The match-dir parameter is not used. HOT 4
- Not detecting wrong DocStrings HOT 1
- Your website is down - https://pydocstyle.org HOT 3
- Crash with simple f-string HOT 7
- Docs website is down? HOT 1
- sdist: PKG-INFO should list LICENSE-MIT in License-File
- `D300` and `D301` false positives on docstrings with escaped triple quotes in them
- Should `__main__.py` really be considered a public module?
- Option to not report error for empty file HOT 1
- test_simple_fstring and test_fstring_with_args fail with Python 3.12 beta HOT 2
- 6.3.0: incorrect version in pyproject.toml?🤔 HOT 2
- pydocstyle 6.3.0 fails silently on a python script that has no .py extension
- Rule for missing PEP 698 `@overrides` decorators?
- Keyword Args not recognized in Google convention with no return
- Python3.12: Two tests fail HOT 1
- Google convention section names not properly checked
- D417 not raised in a standard Google configuration with missing arguments descriptions
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pydocstyle.