Switch branches/tags
analyzer-0.32.4 analyzer-0.32.1 analyzer-0.32.0 analyzer-0.31.2-alpha.2 analyzer-0.31.2-alpha.1 analyzer-0.31.2-alpha.0 analyzer-0.31.1 analyzer-0.31.0+1 analyzer-0.31.0 2.1.0-dev.7.1 2.1.0-dev.7.0 2.1.0-dev.6.0 2.1.0-dev.5.0 2.1.0-dev.4.0 2.1.0-dev.3.1 2.1.0-dev.3.0 2.1.0-dev.2.0 2.1.0-dev.1.0 2.1.0-dev.0.0 2.0.0 2.0.0-dev.69.5 2.0.0-dev.69.4 2.0.0-dev.69.3 2.0.0-dev.69.2 2.0.0-dev.69.1 2.0.0-dev.69.0 2.0.0-dev.68.0 2.0.0-dev.67.0 2.0.0-dev.66.0 2.0.0-dev.65.0 2.0.0-dev.64.2 2.0.0-dev.64.1 2.0.0-dev.64.0 2.0.0-dev.63.0 2.0.0-dev.62.0 2.0.0-dev.61.0 2.0.0-dev.60.0 2.0.0-dev.59.0 2.0.0-dev.58.0 2.0.0-dev.57.0 2.0.0-dev.56.0 2.0.0-dev.55.0 2.0.0-dev.54.0 2.0.0-dev.53.0 2.0.0-dev.52.0 2.0.0-dev.51.0 2.0.0-dev.50.0 2.0.0-dev.49.0 2.0.0-dev.48.0 2.0.0-dev.47.0 2.0.0-dev.46.0 2.0.0-dev.45.0 2.0.0-dev.44.0 2.0.0-dev.43.0 2.0.0-dev.42.0 2.0.0-dev.41.0 2.0.0-dev.40.0 2.0.0-dev.39.0 2.0.0-dev.38.0 2.0.0-dev.37.0 2.0.0-dev.36.0 2.0.0-dev.35 2.0.0-dev.34.0 2.0.0-dev.33.0 2.0.0-dev.32.0 2.0.0-dev.31.0 2.0.0-dev.30.0 2.0.0-dev.29.0 2.0.0-dev.28.0 2.0.0-dev.27.0 2.0.0-dev.26.0 2.0.0-dev.25.0 2.0.0-dev.24.0 2.0.0-dev.23.0 2.0.0-dev.22.0 2.0.0-dev.21.0 2.0.0-dev.20.0 2.0.0-dev.19.0 2.0.0-dev.18.0 2.0.0-dev.17.0 2.0.0-dev.16.0 2.0.0-dev.15.0 2.0.0-dev.14.0 2.0.0-dev.13.0 2.0.0-dev.12.0 2.0.0-dev.11.0 2.0.0-dev.10.0 2.0.0-dev.9.0 2.0.0-dev.8.0 2.0.0-dev.7.0 2.0.0-dev.6.0 2.0.0-dev.5.0 2.0.0-dev.4.0 2.0.0-dev.3.0 2.0.0-dev.2.0 2.0.0-dev.1.0 2.0.0-dev.0.1 2.0.0-dev.0.0 1.25.0-dev.16.4 1.25.0-dev.16.3
Nothing to show
Find file History
danrubel and commit-bot@chromium.org Automatically run analysis server from source if launched with the SD…
…K source tree

Change-Id: I13ff79f90b3a7e0f0ea55b5c839a20c0d790de0d
Reviewed-on: https://dart-review.googlesource.com/c/80510
Reviewed-by: Devon Carew <devoncarew@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
Latest commit a29c049 Oct 18, 2018



Use dartanalyzer to statically analyze your code at the command line, checking for errors and warnings that are specified in the Dart Language Specification. DartPad, code editors, and IDEs such as WebStorm use the same analysis engine that dartanalyzer uses.

Basic usage

Run the analyzer from the top directory of the package. Here's an example of testing a Dart file.

dartanalyzer bin/test.dart


The following are the most commonly used options for dartanalyzer:

  • --packages=
    Specify the path to the package resolution configuration file. For more information see Package Resolution Configuration File. This option cannot be used with --package-root.

  • --package-warnings
    Show warnings not only for code in the specified .dart file and others in its library, but also for libraries imported with package:.

  • --options=
    Specify the path to an analysis options file.

  • --lints
    Show the results from the linter.

  • --no-hints
    Don't show hints for improving the code.

  • --ignore-unrecognized-flags
    Rather than printing the help message, ignore any unrecognized command-line flags.

  • --version
    Show the analyzer version.

  • -h or --help
    Show all the command-line options.

The following are advanced options to use with dartanalyzer:

  • -b or --batch
    Run in batch mode.

  • --dart-sdk=
    Specify the directory that contains the Dart SDK.

  • --fatal-warnings
    Except for type warnings, treat warnings as fatal.

  • --format=machine
    Produce output in a format suitable for parsing.

  • --url-mapping=libraryUri,/path/to/library.dart
    Tells the analyzer to use the specified library as the source for that particular import.

The following options are deprecated:

  • --package-root=
    Deprecated. Specify the directory to search for any libraries that are imported using package:. This option is replaced as of Dart 1.12 with --packages.