0.7 deprecation: Use `at most one line break`

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

https://github.com/GenericMappingTools/GMT.jl/blob/j07/src/gmtinfo.jl#L53

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

Why is that line offending?

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

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

1 Like

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

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.

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).

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.

Looks great. Thanks!