Skip to content
This repository was archived by the owner on Jul 16, 2023. It is now read-only.

[FEATURE REQUEST] Export CliRunner #457

Closed
ookami-kb opened this issue Sep 14, 2021 · 8 comments
Closed

[FEATURE REQUEST] Export CliRunner #457

ookami-kb opened this issue Sep 14, 2021 · 8 comments
Assignees
Labels
area-core type: enhancement New feature or request
Milestone

Comments

@ookami-kb
Copy link
Contributor

It would be useful to have CliRunner exported.

Use case

We have a package where we customize analyzer rules to share the settings across our products. Recently we've added dart_code_metrics as a dependency to share its configuration as well. The only problem so far is that we cannot use the CLI analyzer because of the restriction "Cannot run executables in transitive dependencies".

Exporting CliRunner would allow creating an executable in our package and proxy all the calls to CliRunner.

@incendial
Copy link
Member

@ookami-kb could you share, why you don't want to call dart_code_metrics executable in target packages directly?

@ookami-kb
Copy link
Contributor Author

ookami-kb commented Sep 15, 2021

@incendial we add dependency for dart_code_metrics to our mews_pedantic package. It means that for our product apps (they depend on mews_pedantic) dart_code_metrics is a transitive dependency. It means that in this product app I cannot just run flutter pub run dart_code_metrics:metrics lib since it will give an error: "Cannot run executables in transitive dependencies".

@incendial
Copy link
Member

Ah, I see, thanks. Have you tried global activate or it's less convenient for you? I'm asking, because I think we should avoid exporting CliRunner since it's more like our internal implementation and it's better to avoid a situation when we'll need to create major package updates to update it.

@ookami-kb
Copy link
Contributor Author

Yeah, it's less convenient since:

  • We cannot enforce some specific package version if needed;
  • We need another step in CI pipeline.

But I can understand your point as well.

@incendial
Copy link
Member

incendial commented Sep 20, 2021

I've checked Dart SDK repo and it looks like this limitation for execution of transitive dependencies is intentional: dart-lang/sdk#23426

How do you solve this problem right now? Maybe you can start with src imports and see how it goes?

@ookami-kb
Copy link
Contributor Author

Maybe you can start with src imports and see how it goes?

Yes, it's exactly what I did for now.

@incendial
Copy link
Member

@ookami-kb cli runner will become a part of public API. It's occurred, that this use-case is pretty common, so we'll support it officially

@incendial incendial added type: enhancement New feature or request area-core labels Oct 16, 2022
@incendial incendial added this to the 5.0.0 milestone Oct 16, 2022
@incendial incendial added waiting for release Will be available after new version is released and removed in progress labels Oct 16, 2022
@incendial
Copy link
Member

Available in 5.0.0 🚀

@incendial incendial removed the waiting for release Will be available after new version is released label Oct 31, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-core type: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants