Comments (3)
Hello @EFord36
Thanks for taking the time to write this up, happy to hear you have found this useful
I went for the current format as this is how I like to write my class docstrings. I did consider the case you're making, but class checks were optional so I let it be. I can't remember what documentation or advice I followed for this to be my preferred way of writing class docstrings, but I can't argue with the PEP as I generally follow PEPs to reduce complexity in my workflow.
I would be interested in docsig supporting this. I would like this to benefit as many people as possible so if this is something anyone else would want, in this case yourself, then that would be reason enough to add it in my opinion.
I would like to keep the way classes are currently checked as an option, as myself and others (flask being an example) document classes this way as a preference
Please open a PR, that would be great! It could be as simple as creating a new flag, -C, --check-class-constructor
and then implementing what you've suggested by passing the flag to the end logic. Personally I would prefer if this can work independent of the previous way. Although it wouldn't make much sense to pass -c
and -C
at the same time it doesn't really have to be an either or, and it could just be up to the end user to choose which switch they like. Adding string literal options to argparse can be a bit of a mess (e.g. docsig --check-class class
or docsig --check-class constructor
is probably not ideal, in my opinion, as it comes with the need to set defaults and just leads to more typing).
I look forward to seeing how things work out
Cheers!
Stephen
from docsig.
Makes sense! Yes, totally makes sense that the flag is cleanest - I meant to mention that as an option as well, sorry for forgetting.
Hopefully I'll be able to get to this sometime next week!
from docsig.
quick update - mainly for the purpose of saying 'I am working on this, it shouldn't be too long:
I've start working on this and think I'm nearly there implementation wise, but need to add tests (and to do that, figure out how to add tests that specify the options to docsig). Shouldn't take long, but I've been a bit tied up this week. Hopefully not too long until I can make some more progress.
from docsig.
Related Issues (20)
- Support for Python 3.7.x HOT 4
- Report when the parameter is spelled wrongly HOT 3
- `docsig -v` doesn't print version
- Support for Numpy HOT 3
- Parameter and return value is not correctly recognized HOT 8
- Feature request - pre-commit integration & links HOT 4
- Add linkable path
- False positive when return annotation is a string HOT 2
- Skip checking for one line docstings HOT 2
- Handling of *args and **kwargs HOT 7
- Issue with pre-commit integration
- Import error on `sphinxcontrib.napoleon` on Python 3.10.8 HOT 6
- args and kwargs are not recognized as generic arguments HOT 2
- Positional-only arguments not recognized HOT 3
- docsig doesn't seem to support `@typing.overload`-ed functions/methods well HOT 2
- `@typing.overload`-ed methods not supported HOT 1
- Sphinx 7.0 compatibility HOT 4
- Second layer defined functions seem not to be checked HOT 4
- Optinal return statements with overload function result in docsig error E104 HOT 2
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 docsig.