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

Fix allowed names for Unit-returning functions #139

Merged

Conversation

dellisd
Copy link
Contributor

@dellisd dellisd commented Jun 21, 2023

The allowed names for the naming detector were only being checked for compsable functions that returned a value. For functions that return nothing or Unit, the allowed names would have no effect.

@salesforce-cla
Copy link

Thanks for the contribution! Before we can merge this, we need @dellisd to sign the Salesforce Inc. Contributor License Agreement.

ZacSweers
ZacSweers previously approved these changes Jun 21, 2023
Copy link
Collaborator

@ZacSweers ZacSweers left a comment

Choose a reason for hiding this comment

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

Thanks!

Copy link
Collaborator

@ZacSweers ZacSweers left a comment

Choose a reason for hiding this comment

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

Actually, I think we don't want to do this. This more or less just disables the lint, which at that point you may as well use @Suppress("ComposableNaming")

@ZacSweers ZacSweers dismissed their stale review June 21, 2023 21:44

Changed mind

@dellisd
Copy link
Contributor Author

dellisd commented Jun 21, 2023

This only disables the lint if you've added the function name to the allowed names, doesn't it? That seems fine to me if you have a specific function name that you want to disable this rule on in many (many) places, but not actually disable it in general.

@ZacSweers
Copy link
Collaborator

Hmmm I'm not sure. @chrisbanes @mrmans0n thoughts?

Copy link
Collaborator

@chrisbanes chrisbanes left a comment

Choose a reason for hiding this comment

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

Looks good to me! The allowed names functionality should opt-out as fast as possible imo.

@chrisbanes chrisbanes added this pull request to the merge queue Jun 25, 2023
Merged via the queue into slackhq:main with commit 99492b6 Jun 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants