Skip to content

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

Closed
@stereotype441

Description

@stereotype441

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2A bug or feature request we're likely to work onlegacy-area-analyzerUse area-devexp instead.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions