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. #122

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?

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

@mrmans0n Hi! Could you help? Am I doing something wrong? CLA Assistant shows the error, but I have signed SLA.

kenyee commented 1 year ago

The rules have been moved here: https://github.com/mrmans0n/compose-rules Because Twitter locked contributors out of this for a while...