id = "dart" name = "Dart" homepage = "https://dart.dev" description = "A command-line utility for Dart development." icon = "theSVG:dart" executables = ["dart"] [dotfiles] # The `dart` tool takes its settings from the command line and from # project-level files (pubspec.yaml, analysis_options.yaml). The only thing it # writes into the user's config directory is credentials. paths = [] exclude = [] # Two credential files, both under pub's `dartConfigDir`: # pub-credentials.json — the OAuth2 credentials for pub.dev, written by # `dart pub login` # (lib/src/oauth2.dart: `_credentialsFile()` returns # `p.join(configDir, 'pub-credentials.json')`) # pub-tokens.json — the bearer tokens for third-party hosted package # repositories, written by `dart pub token add` # (lib/src/authentication/token_store.dart: # `p.join(dir, 'pub-tokens.json')`) # https://github.com/dart-lang/pub/blob/master/lib/src/oauth2.dart # https://github.com/dart-lang/pub/blob/master/lib/src/authentication/token_store.dart # # `dartConfigDir` (lib/src/io.dart) is `applicationConfigHome('dart')` from # package:cli_util, which dart.dev's `dart pub token` page links to as the # "user-wide config directory". cli_util resolves it per platform: # Windows — %APPDATA% # macOS — $HOME/Library/Application Support # Linux — $XDG_CONFIG_HOME, else $HOME/.config # — the three names of one location, which is [appData], so each file below is # named once. # https://dart.dev/tools/pub/cmd/pub-token # https://github.com/dart-lang/cli_util/blob/master/lib/cli_util.dart secret = [ "[appData]/dart/pub-credentials.json", "[appData]/dart/pub-tokens.json", ] [commands] format = 1 label = "Dart commands" description = "Common dart subcommands: analyze, format, create and pub get. Global flags and other subcommands are left out." quality = "ai-draft" base = "fig:dart" parser = { end_of_options = "--", interleave = "permute", long_equals = true, short_attached = true, short_bundles = false } [[commands.source]] id = "fig" kind = "completion" url = "https://github.com/withfig/autocomplete/blob/master/src/dart.ts" license = "MIT" [[commands.subcommand]] path = ["analyze"] label = "Analyze code" description = "Static analysis of a Dart project." [[commands.subcommand.source]] id = "fig" kind = "completion" url = "https://github.com/withfig/autocomplete/blob/master/src/dart.ts" license = "MIT" [[commands.subcommand.field]] id = "directory" label = "Project directory" type = "path" position = 0 path = { kind = "directory", role = "input" } sources = ["fig"] [[commands.subcommand.field]] id = "fatal_infos" label = "Treat infos as fatal" type = "boolean" option = ["--fatal-infos"] sources = ["fig"] [[commands.subcommand.field]] id = "fatal_warnings" label = "Treat warnings as fatal" type = "boolean" option = ["--fatal-warnings"] sources = ["fig"] [[commands.subcommand.field]] id = "no_fatal_warnings" label = "Do not treat warnings as fatal" type = "boolean" option = ["--no-fatal-warnings"] sources = ["fig"] [[commands.subcommand.task]] id = "strict" label = "Strict analysis" set = { fatal_infos = [true] } fields = ["directory", "fatal_infos"] required = [] [[commands.subcommand.task]] id = "plain" label = "Analyze project" fields = ["directory", "no_fatal_warnings"] required = [] [[commands.subcommand.group]] id = "basic" label = "Basic" fields = ["directory", "fatal_infos", "fatal_warnings", "no_fatal_warnings"] [[commands.subcommand]] path = ["format"] label = "Format code" description = "Rewrites files in place unless an output mode is given." [[commands.subcommand.source]] id = "fig" kind = "completion" url = "https://github.com/withfig/autocomplete/blob/master/src/dart.ts" license = "MIT" [[commands.subcommand.field]] id = "targets" label = "Files or directories" type = "path" position = 0 multiple = true path = { kind = "any", role = "input" } effect = "overwrite" sources = ["fig"] [[commands.subcommand.field]] id = "line_length" label = "Line length" type = "integer" option = ["--line-length", "-l"] suggestions = [{ value = "80", label = "80" }, { value = "120", label = "120" }] sources = ["fig"] [[commands.subcommand.field]] id = "set_exit_if_changed" label = "Exit 1 if anything changes" type = "boolean" option = ["--set-exit-if-changed"] sources = ["fig"] [[commands.subcommand.field]] id = "fix" label = "Apply style fixes" type = "boolean" option = ["--fix"] sources = ["fig"] [[commands.subcommand.task]] id = "format" label = "Format in place" fields = ["targets", "line_length", "fix"] required = ["targets"] [[commands.subcommand.task]] id = "check" label = "Check only (CI)" set = { set_exit_if_changed = [true] } fields = ["targets", "set_exit_if_changed"] required = ["targets"] [[commands.subcommand.group]] id = "basic" label = "Basic" fields = ["targets", "line_length", "set_exit_if_changed", "fix"] [[commands.subcommand]] path = ["create"] label = "Create project" description = "Creates a new Dart project from a template." [[commands.subcommand.source]] id = "fig" kind = "completion" url = "https://github.com/withfig/autocomplete/blob/master/src/dart.ts" license = "MIT" [[commands.subcommand.field]] id = "directory" label = "Target directory" type = "path" position = 0 path = { kind = "directory", role = "output" } sources = ["fig"] [[commands.subcommand.field]] id = "template" label = "Template" type = "string" option = ["--template", "-t"] suggestions = [{ value = "console", label = "console" }, { value = "package", label = "package" }, { value = "server-shelf", label = "server-shelf" }, { value = "web", label = "web" }] sources = ["fig"] [[commands.subcommand.field]] id = "force" label = "Generate even if directory exists" type = "boolean" option = ["--force"] effect = "overwrite" sources = ["fig"] [[commands.subcommand.field]] id = "no_pub" label = "Skip pub get" type = "boolean" option = ["--no-pub"] sources = ["fig"] [[commands.subcommand.task]] id = "console" label = "Console app" set = { template = ["console"] } fields = ["directory", "template"] required = ["directory"] [[commands.subcommand.task]] id = "package" label = "Package" set = { template = ["package"] } fields = ["directory", "template"] required = ["directory"] [[commands.subcommand.group]] id = "basic" label = "Basic" fields = ["directory", "template", "force", "no_pub"] [[commands.subcommand]] path = ["pub", "get"] label = "Get packages" description = "Resolves and downloads dependencies." [[commands.subcommand.source]] id = "fig" kind = "completion" url = "https://github.com/withfig/autocomplete/blob/master/src/dart.ts" license = "MIT" [[commands.subcommand.field]] id = "offline" label = "Use cached packages only" type = "boolean" option = ["--offline"] sources = ["fig"] [[commands.subcommand.field]] id = "dry_run" label = "Dry run" type = "boolean" option = ["--dry-run", "-n"] sources = ["fig"] [[commands.subcommand.field]] id = "precompile" label = "Precompile executables" type = "boolean" option = ["--precompile"] sources = ["fig"] [[commands.subcommand.task]] id = "get" label = "Get packages" fields = ["offline", "precompile"] required = [] [[commands.subcommand.task]] id = "preview" label = "Preview changes" set = { dry_run = [true] } fields = ["dry_run"] required = [] [[commands.subcommand.group]] id = "basic" label = "Basic" fields = ["offline", "dry_run", "precompile"]