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] Unable to specify exclude paths #1238

Closed tomwyr closed 1 year ago

tomwyr commented 1 year ago

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

Additional comments

No response

incendial commented 1 year ago

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

tomwyr commented 1 year ago

@incendial Thanks, that helped. I think it's the CLI issue then. The help message doesn't mention using double quotes. https://github.com/dart-code-checker/dart-code-metrics/blob/a241ebfaafc63219809ca275093974f0f67c8f90/lib/src/cli/commands/base_command.dart#L127

incendial commented 1 year ago

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

tomwyr commented 1 year ago

TIL. Cheers