dart-code-checker / dart-code-metrics

Software analytics tool that helps developers analyse and improve software quality.
https://dcm.dev
Other
860 stars 265 forks source link

[BUG] Multiple analyzer plugins can't be enabled #1213

Closed cbenhagen closed 1 year ago

cbenhagen commented 1 year ago

Environment and configuration

Starting from Flutter 3.7.6 it is not possible to use multiple ananlyzer plugins anymore. So the following config will throw the following: warning: Multiple plugins can't be enabled

What did you do?

include: package:lint/analysis_options.yaml

analyzer:
  errors:
    ...
  exclude:
    ...
  plugins:
    - dart_code_metrics
    - custom_lint

...

What did you expect to happen?

I expect to be able to use dart_code_metrics together with other analyzer plugins.

What actually happened?

warning: Multiple plugins can't be enabled

Participation

Additional comments

Please consider integrating with custom_lint.

cbenhagen commented 1 year ago

Relevant issues: https://github.com/dart-lang/sdk/issues/50981 https://github.com/flutter/flutter/issues/121836

incendial commented 1 year ago

I expect to be able to use dart_code_metrics together with other analyzer plugins.

Well, this limitation comes from the API that we use and can't be considered as a bug. We have another version that doesn't use analyzer plugins, consider switching to it.

cbenhagen commented 1 year ago

If that other version would have a reasonable pricing option for single person teams I would definitely consider it. But currently it costs more than the whole Intellij Suite. So unless that changes there is no real alternative and there is a path forward that other analyzer plugins use: They integrate with custom_lint to improve performance and be compatible with that API.

@incendial please consider to re-open as a feature request

spideythewebhead commented 1 year ago

Hi, I have faced a similar issue with multiple analyzer plugins. I have came up with the idea of having a proxy analyzer plugin that allows multiple plugins to register. While I support assists for now, it could be extended to support more or it could be used for your own cases. You can see about that here https://github.com/spideythewebhead/analyzer_plugin_proxy_generator