twitter / compose-rules

Static checks to aid with a healthy adoption of Compose
https://twitter.github.io/compose-rules
Other
1.37k stars 93 forks source link

Add exclude field to MultipleEmitters rule. #121

Closed MaximSysoev closed 1 year ago

MaximSysoev commented 1 year ago

Hi! Please consider the possibility of adding a field exclude to the MultipleEmitter rule. I ran into a situation when I have composable function which is always called inside Column, but it is not ColumnScope extension. Like this:

abstract class Screen {
  @Composable
  internal fun Content() {
    // Some logic
    Column(...) {
      Ui()
    }
  }

  @Composable
  abscract fun Ui()
}

I would not like to change it to ColumnScope.Ui() and fix it throughout the project. It would be nice to just exclude Ui method from rule checking. Maybe there are some other cases. Anyway it seems pretty flexible.

What do you think about it?

CLAassistant commented 1 year ago

CLA assistant check
All committers have signed the CLA.

github-actions[bot] commented 1 year ago

CLA Assistant Lite bot:
Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


You can retrigger this bot by commenting recheck in this Pull Request

MaximSysoev commented 1 year ago

recheck