Skip to main content

Configuration ⚙️

Very Good CLI reads a project-level configuration file, very_good.yaml, to persist frequently used command-line arguments so that running the CLI locally produces the same results as running it on CI.

Where it lives​

The very_good.yaml file sits at the root of your project. When you run a Very Good CLI command, the CLI searches for very_good.yaml starting from the current working directory and walks up through its ancestors. The closest file wins; configuration from ancestor directories is not merged. When no file is found, the CLI proceeds with an empty configuration.

This lets a single very_good.yaml at the repository root apply to commands run from any nested package.

Precedence​

For any option, values are resolved in the following order, from highest priority to lowest:

  1. Command line flag — an argument passed explicitly on the command line.
  2. Configuration value — the corresponding value from very_good.yaml.
  3. CLI default — the default value baked into the CLI (or null if the option has no default).

This means every value in very_good.yaml can be overridden per-invocation on the command line without editing the file.

Schema​

Each top-level key in very_good.yaml maps to a Very Good CLI command. Every field mirrors a CLI flag using snake_case (e.g. --min-coverage becomes min_coverage); test.optimization is the one field that also accepts a map, grouping --optimization and --exclude-optimization together. Unrecognized keys cause the CLI to exit with a configuration error.

# very_good.yaml
test: {}
create: {}
dart:
test: {}
packages:
get: {}
check:
licenses: {}

test​

Defaults for very_good test.

test:
coverage: true
optimization:
enabled: true
exclude:
- test/integration
concurrency: 8
tags: my-tag
exclude_coverage: '**/*.g.dart'
exclude_tags: skip
min_coverage: 95
show_uncovered: true
collect_coverage_from: all # imports | all
update_goldens: true
fail_fast: true
dart_define:
- FOO=bar
- X=42
dart_define_from_file: defines.env
platform: chrome
report_on:
- lib/
- packages/foo/lib/
run_skipped: true
flavor: staging
timeout: 30
file_reporter: json:reports/tests.json
FieldTypeNotes
coverageboolWhether to collect coverage information.
optimizationbool | mapWhether to apply optimizations for test performance. See optimization.
concurrencyintPositive integer. The number of concurrent test suites run.
tagsstringRun only tests associated with the specified tags.
exclude_coveragestringSpace-separated globs, relative to each package root, that exclude files from coverage.
exclude_tagsstringRun only tests that do not have the specified tags.
min_coveragenumberBetween 0 and 100. Enforces a minimum coverage percentage.
show_uncoveredboolWhether to show uncovered lines when coverage is below 100%.
collect_coverage_fromimports | allWhether to collect coverage from imported files only or all files.
update_goldensboolWhether matchesGoldenFile() calls should update the golden files.
fail_fastboolWhether to stop running tests after the first failure.
dart_definestring | listAdditional --dart-define values.
dart_define_from_filestring | listPaths of .json or .env files with --dart-define-from-file values.
platformstringThe platform to run tests on (chrome, vm, android, ios).
report_onstring | listFile paths to report coverage information to.
run_skippedboolWhether to run skipped tests instead of skipping them.
flavorstringThe flavor to build for testing.
timeoutintPositive integer (seconds). Maximum time tests may run before being killed.
file_reporterstringAdditional file reporter as <name>:<path> (e.g. json:reports/tests.json).

optimization​

optimization accepts either a boolean or a map. A boolean is shorthand for enabled, so optimization: false and optimization: {enabled: false} are equivalent.

test:
optimization:
enabled: true
exclude:
- test/integration
- test/**/serial_*_test.dart
FieldTypeNotes
enabledboolWhether to apply optimizations for test performance. Mirrors --optimization.
excludestring | listGlobs of test files to keep out of the optimized bundle. Mirrors --exclude-optimization.

Globs are matched against each test file's path relative to the package root and match everything nested underneath what they name, so test/integration excludes every test in that directory. ** matches zero or more directories, so test/**/serial_*_test.dart matches both test/serial_a_test.dart and test/nested/serial_a_test.dart. Matching is case-sensitive on every platform.

Excluded files still run, each as its own test suite, in their own isolate. See Skip optimization for specific tests.

With --recursive, the closest very_good.yaml applies to every package in the run and each glob is matched against the package currently being tested, so test/integration excludes that directory in every package. Per-package exclusions are not expressible.

create​

Defaults for very_good create.

create:
description: A configured project.
org_name: com.very.good
publishable: true
template: my-template
workspace: true
FieldTypeNotes
descriptionstringThe description for the generated project.
org_namestringThe organization for the generated project.
publishableboolWhether the generated project is intended to be published.
templatestringThe template used to generate the project.
workspaceboolWhether the project resolves dependencies from a parent workspace.

dart.test​

Defaults for very_good dart test. The fields mirror test, minus the Flutter-only flags (update_goldens, flavor, timeout, dart_define, dart_define_from_file) plus check_ignore.

dart:
test:
coverage: true
optimization:
enabled: true
exclude:
- test/integration
concurrency: 8
tags: my-tag
exclude_coverage: '**/*.g.dart'
exclude_tags: skip
min_coverage: 95
show_uncovered: true
collect_coverage_from: all # imports | all
fail_fast: true
platform: chrome
report_on:
- lib/
- packages/foo/lib/
run_skipped: true
check_ignore: false
file_reporter: json:reports/tests.json
FieldTypeNotes
coverageboolWhether to collect coverage information.
optimizationbool | mapWhether to apply optimizations for test performance. See optimization.
concurrencyintPositive integer. The number of concurrent test suites run.
tagsstringRun only tests associated with the specified tags.
exclude_coveragestringSpace-separated globs, relative to each package root, that exclude files from coverage.
exclude_tagsstringRun only tests that do not have the specified tags.
min_coveragenumberBetween 0 and 100. Enforces a minimum coverage percentage.
show_uncoveredboolWhether to show uncovered lines when coverage is below 100%.
collect_coverage_fromimports | allWhether to collect coverage from imported files only or all files.
fail_fastboolWhether to stop running tests after the first failure.
platformstringThe platform to run tests on (chrome, vm).
report_onstring | listFile paths to report coverage information to.
run_skippedboolWhether to run skipped tests instead of skipping them.
check_ignoreboolWhether to respect coverage ignore comments (e.g. // coverage:ignore-line).
file_reporterstringAdditional file reporter as <name>:<path> (e.g. json:reports/tests.json).

packages.get​

Defaults for very_good packages get.

packages:
get:
recursive: true
ignore:
- example
- integration_test
FieldTypeNotes
recursiveboolWhether to install dependencies recursively for nested packages.
ignorestring | listPackages to exclude from installing dependencies.

packages.check.licenses​

Defaults for very_good packages check licenses.

packages:
check:
licenses:
ignore_retrieval_failures: true
dependency_type:
- direct-main
- direct-dev
allowed:
- MIT
- BSD-3-Clause
skip_packages:
- very_good_analysis
reporter: csv # text | csv
FieldTypeNotes
ignore_retrieval_failuresboolWhether to disregard licenses that failed to be retrieved.
dependency_typestring | listOne or more of direct-main, direct-dev, direct-overridden, transitive.
allowedstring | listOnly allow the use of certain licenses.
forbiddenstring | listDeny the use of certain licenses. Cannot be combined with allowed.
skip_packagesstring | listPackages to skip from having their licenses checked.
reportertext | csvThe format used to list all licenses.
info

Options that accept a list also accept a single string. For example, ignore: example is equivalent to ignore: [example].

Example​

A single very_good.yaml at the root of a repository can capture the defaults for every Very Good CLI command used in that project:

# very_good.yaml
create:
org_name: com.very.good
workspace: true

test:
min_coverage: 100
exclude_coverage: '**/*.g.dart'
report_on:
- lib/

dart:
test:
min_coverage: 100
exclude_coverage: '**/*.g.dart'
report_on:
- lib/

packages:
get:
recursive: true
check:
licenses:
dependency_type:
- direct-main
- transitive
allowed:
- MIT
- BSD-3-Clause
reporter: csv

With the file above, running very_good test behaves the same as running very_good test --min-coverage 100 --exclude-coverage '**/*.g.dart' --report-on lib/. Any command-line flag still takes precedence, so very_good test --min-coverage 90 lowers the coverage threshold for that single run.