Skip to content
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

Merged
merged 5 commits into from Dec 10, 2016
Merged

Consistent return types #1035

merged 5 commits into from Dec 10, 2016

Conversation

Altai-man
Copy link
Member

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 returns to --> 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 "-->'.

This commit affects all signatures that exist in the type documentation: it replaces "returns " occurences with "-->" form.

See #1024 (comment) for explanations.
@moritz
Copy link
Collaborator

moritz commented Dec 6, 2016

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.

@coke
Copy link
Collaborator

coke commented Dec 6, 2016

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

@Altai-man
Copy link
Member Author

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.

Copy link
Member

@AlexDaniel AlexDaniel left a 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>|':')+? $/ {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

\s+ instead of ' '+??

Copy link
Member

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.

Copy link
Member Author

@Altai-man Altai-man Dec 7, 2016

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.

@AlexDaniel
Copy link
Member

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 xt/ to cause less troubles for contributors, but we are still in favor of all tests.

@Altai-man
Copy link
Member Author

The conflicts were solved, so we can merge this freely and I'll add a test in the master then.

@AlexDaniel AlexDaniel merged commit 63d182a into master Dec 10, 2016
@Altai-man Altai-man deleted the consistent-return-types branch December 10, 2016 12:26
coke added a commit that referenced this pull request Jan 23, 2017
(pulled from #1035)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants