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

Reasoning behind Modifiers being only mandatory in public functions #25

Closed
AbelToy opened this issue Feb 21, 2023 · 2 comments · Fixed by #33
Closed

Reasoning behind Modifiers being only mandatory in public functions #25

AbelToy opened this issue Feb 21, 2023 · 2 comments · Fixed by #33

Comments

@AbelToy
Copy link

AbelToy commented Feb 21, 2023

I would like to know the reasoning behind Modifiers being only mandatory in public functions.

Additionally, I would like to request a way to change this setting if possible.

https://mrmans0n.github.io/compose-rules/rules/#when-should-i-expose-modifier-parameters

@mrmans0n
Copy link
Owner

This had more to do with Twitter for Android, and how the rules needed to be balanced out to not be overly annoying (this one, if applied to public functions, would get broken a lot). The reasoning was along the lines of public functions being usable from somewhere else (e.g. modules written by people in other teams, etc), vs private/internal functions being highly contextual to the project you/your team works on.

However I see the point in making it configurable, that's a great idea.

@AbelToy
Copy link
Author

AbelToy commented Feb 22, 2023

Makes sense, thanks!

I will try to get a PR sorted out this weekend then, unless you want to get into it!

mrmans0n added a commit that referenced this issue Mar 15, 2023
Adds configurability to the ModifierMissing rule, so that now users can configure whether they want non-public composables to be also subject to this check.
The current configuration, where only public composables run this rule, keeps being the default. Values `public_and_internal` and `all` are added.

Fixes #25
mrmans0n added a commit that referenced this issue Mar 15, 2023
Adds configurability to the ModifierMissing rule, so that now users can configure whether they want non-public composables to be also subject to this check.
The current configuration, where only public composables run this rule, keeps being the default. Values `public_and_internal` and `all` are added.

Fixes #25
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 a pull request may close this issue.

2 participants