Skip to content

lint: Enable always_declare_return_types; fix existing places they're missing #851

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

Merged
merged 8 commits into from
Jul 30, 2024

Conversation

gnprice
Copy link
Member

@gnprice gnprice commented Jul 30, 2024

When the return type is omitted, the syntax for a function declaration looks a lot like that for a function call.

Some of these also get clearer because the type is nontrivial and a typedef for it is helpful for describing another function's signature too.

Prompted by
#813 (comment)
and previously
#790 (comment)
… and previously several other occasions, going back to:
#305 (comment)

gnprice added 8 commits July 29, 2024 16:46
This makes the _convertTextTheme signature clearer to express,
and also lets us specify the return type of mkAddLabel in a
reasonable readable syntax.
This commit covers only where the type is totally boring from the
function's definition: it's the thing that the autofix would insert,
or else it's void and the autofix should insert void.  (But there
seems to be a bug where the autofix doesn't work if the answer should
be void.)
Otherwise the syntax for a function declaration looks a lot like
that for a function call.
@gnprice gnprice added the maintainer review PR ready for review by Zulip maintainers label Jul 30, 2024
@gnprice gnprice requested a review from chrisbobbe July 30, 2024 00:11
@chrisbobbe chrisbobbe merged commit 26fc976 into zulip:main Jul 30, 2024
1 check passed
@chrisbobbe
Copy link
Collaborator

LGTM, thanks! Merged.

@gnprice gnprice deleted the pr-always-declare-return-types branch July 30, 2024 05:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintainer review PR ready for review by Zulip maintainers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants