-
-
Notifications
You must be signed in to change notification settings - Fork 166
Allow param lists to split on ': ' rather than ' : ' #78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Ping @scikit-learn |
How about we split correctly but issue a warning? |
See, by the way, my attempt (via grep, sed, git apply, git add --patch) to fix such errors in scikit-learn at scikit-learn/scikit-learn#7920 I considered a warning, and don't mind it. I'd actually rather something that output a git patch :) Main problem is that I don't think |
That grep script is truly horrific ;) |
I did try implementing it in numpydoc, but got sick at the thought of putting all the context info in. This worked :) |
So, if you have something that works, would fixing numpydoc still be useful to you, or should we just add that "fixer" into the README? |
I think fixing numpydoc is worthwhile. I wanted a way to resolve these On 23 November 2016 at 09:52, Stefan van der Walt notifications@github.com
|
I think this and other discussions around similar requests has helped settle the issue in my mind: we should stick to one docstring format, and rather help those who want to fix their projects with a linter-type tool. |
The problem with that statement is that the docstring format is somewhat inconsistent: see also allows leading space or none; parameters allows with leading space only. |
But yes, I'm happy with a linter/fixer. |
The docstring format seems consistent? https://github.com/numpy/numpy/blob/master/doc/HOWTO_DOCUMENT.rst.txt |
But the implementation is not similarly restrictive: On 23 November 2016 at 12:42, Stefan van der Walt notifications@github.com
|
I'll submit a PR for a linter/fixer. |
Thanks @jnothman, I'd be happy to review that. |
I think the original proposal should be rejected for the same reason as mentioned in #87 (comment) (+ following discussion). |
It is very easy to mistakenly separate parameter names from their type description by
': '
instead of the correct' : '
. There are at least 260 instances in Scikit-learn, for instance, and Joblib appears to use : without a preceding space as a standard. This variation is unsurprising when See Also, for instance, does not require a space before its colons.Would we expect great ramifications were we to change it to allow a single colon followed by whitespace as delimiter?
The text was updated successfully, but these errors were encountered: