0.7 deprecation: Use `at most one line break`


#1

Hi, I’ve ported most of GMT.jl to 0.7 but keep receiving many of these. Don’t understand what it wants with this story of the line breaks.
Thanks for pointers.

 Warning: Deprecated syntax `multiple line breaks between doc string and object` at C:\j\.julia\v0.7\GMT\src\gmtinfo.jl:53.
│ Use `at most one line break` instead.
└ @ nothing gmtinfo.jl:53

#2

You should remove the # -------------- between docstring and gmtinfo!


#3

Why is that line offending?


#4

Thanks. It worked, though I also wonder what’s offensive in having a comment line between doc string and the function declaration.


#5

It might be better to require no blank lines between doc string and what it attaches to.


#6

It’s not a blank line. Any comment line will trigger that (so far) deprecation warning.


#7

Yes, what I’m saying is that only a blank line should trigger the warning, not a comment. So a doc string followed by however many lines that only have comments followed by an expression would behave as if the expression was on the next line after the doc string. But maybe that’s too complicated.


#8

I think it would be great if the parser would emit ignored-by-default CommentNodes in the same way that it currently emits LineNumberNodes. This would make it easy to identify comment lines as non-blank.

As a bonus it would become much easier to write utilities that take commands from comments in Julia code (e.g. to control how a document is linted or displayed).


#9

See https://github.com/ZacLN/CSTParser.jl which keeps everything in the AST enabling tools like https://github.com/JuliaComputing/FemtoCleaner.jl to be built on top of it.


#10

Looks great. Thanks!