-
Notifications
You must be signed in to change notification settings - Fork 7
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
GL01 Compliance #19
Comments
Thanks for raising the issue! This can definitely be added as a (defcustom numpydoc-newline-after-opening-quotes nil
"Flag to control insertion of newline after the opening quotes.
If set to t a newline will be inserted after the opening quotes of
the docstring."
:group 'numpydoc
:type 'boolean) (defaulting to The implementation of |
Thanks for the pointer @douglasdavis, I'll give this a go (first proper foray into Emacs LISP). I wonder if, longer term, it would be worth following the various validation rules albeit as a global option. First things first though, I need to walk before I can run. |
I was actually unaware of GL01! I think that goes to show the value of the validator, because I've seen a lot of projects (including my own) that try to be numpydoc compliant but do not include the newline. So perhaps it would be a good idea to have the default setting be t! |
I've had a first stab at this but am fumbling around to work out how to get the line to indent. (numpydoc--insert indent
(concat (make-string 3 numpydoc-quote-char)
(if numpydoc-newline-after-opening-quotes
"\n"
"")
(if (numpydoc--prompt-p)
(read-string
(format "Short description: "))
tmps)
"\n\n")
(make-string 3 numpydoc-quote-char)) What I don't understand/can't figure out is why, it doesn't indent because the code chunk here is using The concatenated items are...
I've tried a variant where I concatenate 1) and 2) first (numpydoc--insert indent
(concat (concat (make-string 3 numpydoc-quote-char)
(if numpydoc-newline-after-opening-quotes
"\n"
""))
(if (numpydoc--prompt-p)
(read-string
(format "Short description: "))
tmps)
"\n\n")
(make-string 3 numpydoc-quote-char)) but with the same result.
I think it would make sense and that would just be a case of setting There are various other validation rules in there, most are already met e.g. |
Thanks for writing and maintaining this package, I find it super useful when writing code.
One thing I've noticed is that the following was automatically generated...
I use the numpydoc pre-commit hook to make sure I get everything correct and on parsing the above it raised GL01.
Putting the first line on its own new line assuaged the linter.
I'll see if I can work out how to add this and make a Pull Request over the coming weeks but am writing this up now for reference.
The text was updated successfully, but these errors were encountered: