codecov.yml Reference

🚧

Changing your YAML?

Changing your YAML? A reminder to always validate your YAML before you deploy https://api.codecov.io/validate

Top-level sections used in codecov.yml

codecov

codecov: token: "<some token here>" bot: "codecov-io" ci: - "travis.org" strict_yaml_branch: "yaml-config" max_report_age: 24 disable_default_path_fixes: no require_ci_to_pass: yes notify: after_n_builds: 2 wait_for_ci: yes

codecov.token

The repository upload token

  • Type: String
  • Default: N/A

codecov.bot

The username you want to use for Codecov operations


codecov.ci

Additional CI provider URLs you want Codecov to recognize.


codecov.strict_yaml_branch

Specify a branch you want Codecov to always only read the YAML from


codecov.max_report_age

The age you want coverage reports to expire at, or if you want to disable this check. Expired reports will not be processed by codecov.


codecov.disable_default_path_fixes

Should Codecov's default path fixes be disabled


codecov.require_ci_to_pass

Should Codecov wait for all other statuses to pass before sending its status.

  • Type: Boolean
  • Default: true

codecov.notify

codecov.notify.after_n_builds

How many uploaded reports Codecov should wait to receive before sending statuses


codecov.notify.wait_for_ci

Should Codecov wait for all CI statuses to complete before sending ours.
Note: Codecov considers all non-codecov statuses to be CI statuses

  • Type: Boolean
  • Default: true

codecov.notify.notify_error

If any uploads fail to process replace the regular coverage comment with a comment containing the number of uploads that failed.

  • Type: Boolean
  • Default: false

codecov.notify.manual_trigger

codecov: notify: manual_trigger: true

Codecov will trigger no notifications or statuses until explicitly told do so by the CLI. This setting is helpful if your CI upload pipeline uploads a variable number of coverage reports per commit, and you would prefer to get no notifications from Codecov until Codecov is told to do so (e.g., at the end of the CI process).

Note that this feature requires the use of Codecov's CLI, and no notifications will be triggered until the CLI's send-notifications command is executed in your CI run.

  • Type: Boolean
  • Default: false

component_management

component_management: default_rules: # Dict. rules inherited by all components that don't define a tag for themselves. paths: # List. Path filters. - "specific_file.txt - "^some.*regex$" - "glob/*" flag_regexes: # List. Flags to be included in the component. - "fruit.*" statuses: # List. Status definitions. # These statuses are the same as for flag_management # Except they don't accept 'flags' individual_components: # List. These are the actual components. - component_id: component_1 # String. Required. name: display_name_1 # String. Optional. # Individual components also accept paths, flag_regexes and statuses - component_id: other_component #...

More info: https://docs.codecov.com/docs/components

coverage

coverage: precision: 2 round: down range: "70...100" notify: # notification blocks. See: https://docs.codecov.io/docs/codecovyml-reference#section-coverage-notify status: project: patch: changes:

coverage.precision

What precision do you want the coverage value to be

  • Type: Range(0,5)
  • Default: 2

coverage.round

Which direction to you want to round the coverage value

  • Type: One of 'down', 'up', 'nearest'
  • Default: down

coverage.range

The value range where you want the value to be green


coverage.notify

The standard notification settings are shown below, but it is recommend to view https://docs.codecov.io/docs/notifications for more information.

<notification_provider>: #see: ttps://docs.codecov.io/docs/notifications url: "https://hooks.example.com/hook/8675309" branches': - master - dev - staging threshold': 1% flags: - backend - frontend base: "parent" only_pulls: false paths: "*/**/*"

Note that the following notification providers are supported and will need to be defined in the YAML (see Notifications):

  • Gitter
  • IRC
  • Slack

coverage.status

More info: https://docs.codecov.io/docs/commit-status

coverage: status: project: default: # This can be anything, but it needs to exist as the name # basic settings target: auto threshold: 5% base: auto # advanced settings branches: - master if_ci_failed: error #success, failure, error, ignore only_pulls: false flags: - frontend paths: - src/frontend removed_code_behavior: off #removals_only, fully_covered_patch, adjust_base",

parsers

parsers: javascript: enable_partials: yes # default yes v1: include_full_missed_files: true # default false gcov: branch_detection: conditional: yes loop: yes method: no macro: no cobertura:	handle_missing_conditions: true #default false partials_as_hits: true #default false

parsers.jacoco

Controls how Codecov counts partial coverage hits in Jacoco

  • Type: map
parsers: jacoco: partials_as_hits: true #false by default

parsers.javascript

Unknown


parsers.v1

Unknown


parsers.gcov

Controls how Codecov parses branch coverage in gcov reports. The coverage must exist in the uploaded report for us to parse it.

parsers: gcov: branch_detection: conditional: yes loop: yes method: no macro: no

parsers.go

Controls how Codecov parses partial coverage in Golang reports. The coverage must exist in the uploaded report for us to parse it.

  • Type: map
parsers: go: partials_as_hits: true #false by default

parsers.cobertura

Controls how Codecov parses partial coverage in Cobertura reports. The coverage must exist in the uploaded report for us to parse it.

  • Type: map
parsers: cobertura: partials_as_hits: true # false by default handle_missing_conditons: true # false by default

ignore

ignore: - "path/to/folder" # ignore folders and all its contents - "test_*.rb" # wildcards accepted - "**/*.py" # glob accepted

fixes

fixes: - "before/::after/" # move path e.g., "before/path" => "after/path" - "::after/" # move root e.g., "path/" => "after/path/" - "before/::" # reduce root e.g., "before/path/" => "path/"

flags

flags: projectA: paths: - projectA/src carryforward: false #default -- false projectB: paths: - projectB/src carryforward: true

comment

comment: layout: "diff, flags, files" behavior: default require_changes: false # if true: only post the comment if coverage changes

slack_app

Toggle the sending of notifications through the Codecov Slack App

slack_app: false

turn off github_checks annotations (GitHub users only)

github_checks: annotations: false

Codecov Cloud Report Archiving

  • How to disable archiving - In your codecov.yml, set the following line to false as follows:
codecov: archive: uploads: false

annotations

Specify whether to use GitHub Checks annotations or normal statuses. GitHub Checks are enabled by default and can be modified on the top level in your codecov.yml.