Comments (11)
Let me be devil's advocate for a second. Why would you ignore a rule?
from pydocstyle.
You might want to ignore certain rules for various reasons, either for purely subjective reasons (you just don't agree with it) or legacy projects where you just haven't convinced everyone to get entirely on the pep257 bandwagon.
Aside from the 'ignoring' use-case, the error codes just make the the project more friendly for external tools, so they don't have to depend on matching the human-readable version of the error, which may change.
from pydocstyle.
I think this is also more desirable in the context of Flake8 and the extension written for it using pep257. In general, having error codes with shorter descriptions are more in line with the other tools we already support and use. I didn't mention it because it doesn't particularly bother me since we're using pep257 as an extension. Were we introducing it as a core feature, I may have been a bit more concerned. That said, I agree that ignoring a rule is generally a bad idea, but rules are meant to be broken. :-P
from pydocstyle.
@sigmavirus24 do you have any suggestions for error code naming?
from pydocstyle.
Well easiest for Flake8 is to use a D (for doc-string)[1] followed by 3 or more numbers as you see fit (and to store them somewhere on the error object for us to use for ignoring). Generally similar errors are grouped in sort of classes like pep8 so you have 99 errors to report for each like idea, e.g., D1xx are all similar but different errors relating to essentially the same idea. D2xx works the same.
I don't recall the exact error strings as they are in pep257 now, but one of this week's nights I might be able to provide a suggestion for grouping the errors together. I have no good suggestions for shortening the messages though because I find them to be as terse as I can imagine them (while working on flake8-docstrings I thought about re-mapping the errors but couldn't think of better messages frankly).
[1]: Mainly because I used D in flake8-docstrings which integrates pep257 into flake8.
from pydocstyle.
D123
sounds good. I guess it will be a net-positive for Python community to allow to silence the errors, since otherwise many people wouldn't follow PEP 257 at all.
from pydocstyle.
D123
sounds good. I guess it will be a net-positive for Python community to allow to silence the errors, since otherwise many people wouldn't follow PEP 257 at all.
+1 I've had the opportunity to work with pep8 and like its concept of error codes.
from pydocstyle.
@JensRantil how did you use them?
from pydocstyle.
@JensRantil how did you use them?
I used them to skip a certain error that was incorrectly reported. I then filed a bug upstream.
from pydocstyle.
I'm working on this in my fork. Expect a pull request later today.
from pydocstyle.
I think this issue can be closed now.
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.