Skip to content

dart analyze command doesn't support analyzing a single file #44910

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

Closed
stereotype441 opened this issue Feb 9, 2021 · 1 comment
Closed

dart analyze command doesn't support analyzing a single file #44910

stereotype441 opened this issue Feb 9, 2021 · 1 comment
Labels
legacy-area-analyzer Use area-devexp instead. P2 A bug or feature request we're likely to work on

Comments

@stereotype441
Copy link
Member

With dartanalyzer, I can analyze a single file, e.g.:

paulberry@paulberry-linux-2:~/dart-new/sdk$ out/ReleaseX64/dart-sdk/bin/dartanalyzer ~/tmp/test.dart
Analyzing /usr/local/google/home/paulberry/tmp/test.dart...
  error • The property 'isEven' can't be unconditionally accessed because the receiver can be 'null'. • /usr/local/google/home/paulberry/tmp/test.dart:4:3 • unchecked_use_of_nullable_value
1 error found.

With dart analyze, it's not supported:

paulberry@paulberry-linux-2:~/dart-new/sdk$ out/ReleaseX64/dart-sdk/bin/dart analyze ~/tmp/test.dart
Directory doesn't exist: /usr/local/google/home/paulberry/tmp/test.dart

Usage: dart analyze [arguments] [<directory>]
-h, --help                   Print this usage information.
    --fatal-infos            Treat info level issues as fatal.
    --[no-]fatal-warnings    Treat warning level issues as fatal.
                             (defaults to on)

Run "dart help" to see global options.

This makes it more difficult for me as a developer to study the behavior of the analyzer using quick experiments.

@stereotype441 stereotype441 added the legacy-area-analyzer Use area-devexp instead. label Feb 9, 2021
@scheglov scheglov added the P2 A bug or feature request we're likely to work on label Feb 9, 2021
@devoncarew
Copy link
Member

Yup, this is worth doing (closing this specific issue as a dup of #43891).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
legacy-area-analyzer Use area-devexp instead. P2 A bug or feature request we're likely to work on
Projects
None yet
Development

No branches or pull requests

3 participants