dart-code-checker/dart-code-metrics

[BUG] Unable to specify exclude paths

tomwyr opened this issue ยท 4 comments

Environment and configuration

DCM version: 5.7.4
Dart SDK version: 3.0.1

What did you do?

I ran flutter pub run dart_code_metrics:metrics check-unused-code --exclude={/**.g.dart} lib

What did you expect to happen?

Run the script on all files except generated ones.

What actually happened?

I got zsh: no matches found: --exclude={/**.g.dart} error message.

Participation

  • I am willing to submit a pull request for this issue.

Additional comments

No response

Please wrap the --exclude value into " (ex, --exclude="/**.g.dart"). Also note that { } syntax should be used for more than 1 option.

@incendial Thanks, that helped.
I think it's the CLI issue then. The help message doesn't mention using double quotes.

valueHelp: '{/**.g.dart,/**.freezed.dart}',

Quotes are related to zsh behaviour (zsh: no matches found:), so it's not applicable to everyone thus is not in the help message.

TIL. Cheers