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
Consistent return types #1035
Consistent return types #1035
Conversation
This commit affects all signatures that exist in the type documentation: it replaces "returns " occurences with "-->" form. See #1024 (comment) for explanations.
|
I'm not in favor of such tests, because they raise the barrier to contribution. That said, I contribute very little to the docs these days, so don't let that stop you. |
|
Note that we've had xt/ tests for some time now that we can run ad hoc, and don't break the build. (I wish there was a way to force them to run for PRs, however.) |
|
Yeah, you're totally right! Thanks for notice. It seems that nobody is against currently, so I'll continue to work. I will move the test to xt/ and resolve conflicts tomorrow. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have looked through the changes and see no problems whatsoever.
| @lines.push($line-no); | ||
| } | ||
| $line-no++; | ||
| if so $line ~~ /(multi|method|sub) .+? ')' ' '+? 'returns' ' '+? (<alnum>|':')+? $/ { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
\s+ instead of ' '+??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, it won't catch things that are spread over several lines. Not sure if that's a big problem.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
\s+
Yeah, my bad.
About several lines. There are really a few such signatures, firstly, and it will be a noisy rule, secondly.
But if anyone feels ready to write one - welcome.
|
To those reading the discussion: we like all tests. Anything you can automate will be appreciated. It's just that we will put some tests in |
|
The conflicts were solved, so we can merge this freely and I'll add a test in the master then. |
See #1024 (comment) the whole issue history) for the original discussion.
To make docs signatures more consistent and to make them more version-agnostic this PR changes all
returnsto-->form.Discussion is welcome!
The key points:
1)We don't prohibit "returns" form anywhere, we just want to use single form in all signatures over the docs.
1.5)It is tested, so maintenance burden will be not so big.
2)We know 'returns" just reads nicely.
3)The otherwise change ("-->" to "returns") was rejected. Not the least reason is that "returns" can do less than "-->'.