Comments (8)
Hi @JenniferHem, thank you for opening this issue, appears to be a problem with the way indents are handled with numpy style docs, I'll look into this as soon as I can
from docsig.
Hi @JenniferHem
The result is quite confusing, I understand
As the param was not even parsed due to the indentation it resulted in a missing parameter
The None value was parsed after iterating through the longest so it also resulted in an incorrect error for ordering
A new error has been added
E115: syntax error in description
Which gives you more control over this result
If you don't care about syntax errors in the description you can disable the check
This is available with ^0.26.0
Thanks again π
from docsig.
Hi @JenniferHem
The numpy
parser was too strict with indents and whitespace
Those examples now pass and you can clone or pip install docsig==0.23.2
If you find anything else please keep opening issues or PRs so long as you find use for this! I don't use numpy
style, so issues like this help a lot
from docsig.
@JenniferHem.
numpy
was pretty buggy and not very usable, you should see some positive results with the latest version (v0.24.0
), It's at least as usable as RST, which works well for me
from docsig.
I can confirm that your fixes solved the mentioned errors and I see it working as expected. Thank you very much for the quick fix(es)!
from docsig.
Okay not sure if it is intended so not re-opening I just saw an issue with:
def check_stuff(str_lin: str, a: str) -> bool:
"""Check if "A" or "B".
The function checks wether the string is "A" or "B".
Parameters
----------
str_lin: str
special string produced by function_of_y ["a"]
a second wrong indent line
a: str
string stuff
Returns
-------
bool
Returns True, else false
"""
if any(s in str_lin for s in ["A", "B"]):
return True
return False
Here I get the error:
def check_stuff(βstr_lin, βa) -> βbool:
"""...
:param a: β
:param None: β
:return: β
"""
E103: parameters missing
hint: there appears to be a syntax error that could be causing this
E101: parameters out of order
which definitely helped me to spot the wrong indent.
I am just not 100% sure if the indent should cause this (might be specific functionalities of docs related that I am not aware?) or if this should not fail when parsing?
This is definitely a style problem which should not occur, just thought I'd run it by you to get your opinion how you want to handle this!
from docsig.
Amazing thanks!
from docsig.
No worries @JenniferHem, happy you have found this useful π
from docsig.
Related Issues (14)
- args and kwargs are not recognized as generic arguments HOT 2
- Support for Numpy HOT 3
- Positional-only arguments not recognized HOT 3
- Support for Python 3.7.x HOT 4
- Feature request - pre-commit integration & links HOT 4
- Report when the parameter is spelled wrongly HOT 3
- 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
- `docsig -v` doesn't print version
- Issue with pre-commit integration
- Import error on `sphinxcontrib.napoleon` on Python 3.10.8 HOT 6
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.