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

If a root project has plugins enabled, projects in sub-folders should have those plugins too #188

Open
rrousselGit opened this issue Sep 14, 2023 · 11 comments
Assignees
Labels
enhancement New feature or request

Comments

@rrousselGit
Copy link
Collaborator

Currently in a mono-repo, all projects need to install custom_lint + plugins.

We could alleviate that by having a pubspec at the root of the workspace which installs both custom_lint and plugins. And then enable plugins for all sub-projects in the workspace.

@rrousselGit rrousselGit added the enhancement New feature or request label Sep 14, 2023
@rrousselGit rrousselGit self-assigned this Sep 14, 2023
@Pavel-Sulimau
Copy link

Pavel-Sulimau commented Oct 2, 2023

Hey @rrousselGit, I'm wondering if it's possible to run custom_lint checks in a terminal/CI without enabling it as an analyzer plugin in an IDE, so without adding this?

analyzer:
  plugins:
    - custom_lint

It goes without saying that having the IDE highlighting problems is really handy but taking into account that the IDE may become very slow on larger mono-projects (we have 100+ dart/flutter packages already, and it is not recommended for 10+ packages) it can be handy to run the checks just in terminal/CI.

@rrousselGit
Copy link
Collaborator Author

Yes that works.

@Pavel-Sulimau
Copy link

Yes that works.

@rrousselGit, then I must be missing something.

I get the lints when I run dart run custom_lint having custom_lint referenced in the analyzer->plugins section.
image

But when I run the same command without custom_lint referenced in the analyzer->plugins section, I always get "No issues found!"
image

So, what will be the correct way to run the checks in the terminal without having to enable the plugin for the IDE?

@rrousselGit
Copy link
Collaborator Author

Actually you're correct, I've changed that at some point.

@Pavel-Sulimau
Copy link

Actually you're correct, I've changed that at some point.

@rrousselGit, I'm a bit confused. So running the checks from a terminal without enabling custom_lint as an analyzer plugin is NOT supported, right?

@rrousselGit
Copy link
Collaborator Author

Kind of. The command line voluntarily excludes projects where it isn't enabled, to avoid cases where the linter runs in places where it shouldn't

@Pavel-Sulimau
Copy link

The command line voluntarily excludes projects where it isn't enabled

Would it make sense then to do the filtering based on the presence of custom_lint dev_dependency in a project rather than based on the presence of the enabled plugin?

@rrousselGit
Copy link
Collaborator Author

You can technically install the command line globally and not add it as dev_dependency

@Pavel-Sulimau
Copy link

So, do you see the value in having an option to run the tool without the need to enable the analyzer_plugin? If so, do you see a relatively easy way to get it implemented?

@rrousselGit
Copy link
Collaborator Author

Supporting that isn't hard. It's just about removing one if condition. The command line works without the analysis_options.yaml.
Although it could mean that there would be a difference between how the CLI behaves and how the IDE behaves.

Overall I'm skeptical about the value. If you have concerns about the IDE performance, I'd rather look into that first.
And you can always decide to only open a few projects instead of the entire monorepo.

@kturney
Copy link

kturney commented Jun 6, 2024

Our team would also find it valuable to be able to run custom_lint from the command line while disabling the plugin in analysis_options.yaml.

Unfortunately, we've had multiple devs negatively impacted by the increased memory and CPU usage after I added custom_lint to our (rather large monorepo) project.

However, we would still gain good value by being able to run our custom lint rules via custom_lint in CI (or locally via command line).

Alternatively, (and maybe this isn't a great idea), it could be useful to support an env var or maybe a dart/flutter vs code extension config that allows individual developers to opt out of custom analyzer plugins.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants