# Refs:
# - https://docs.codecov.com/docs/common-recipe-list
# - https://docs.codecov.com/docs/codecovyml-reference
#
# After making changes, run below command to validate
# curl --data-binary @codecov.yml https://codecov.io/validate
coverage:
  range: 80...100
  round: down
  precision: 2
  status:
    project:                   # measuring the overall project coverage
      default:                 # context, you can create multiple ones with custom titles
        informational: true
        target: 85%            # specify the target coverage for each commit status
                               #   option: "auto" (compare against parent commit or pull request base)
                               #   option: "X%" a static target percentage to hit
        threshold: 0%          # allow the coverage drop by x% before marking as failure
        if_ci_failed: ignore   # require the CI to pass before setting the status
    patch:
      default:
        target: 85%            # specify the target coverage for each commit status
                               #   option: "auto" (compare against parent commit or pull request base)
                               #   option: "X%" a static target percentage to hit
        threshold: 0%          # allow the coverage drop by x% before marking as failure
comment:
  layout: "header, files, footer"
  hide_project_coverage: false
codecov:
  require_ci_to_pass: false
ignore:
  - "**/*_cql.go"
  - "**/*_generated.go"
  - "**/*_mock.go"
  - "**/*_test.go"
  - "**/*_test_utils.go"
  - "**/constants.go"
  - "**/interface.go"
  - "**/interfaces.go"
  - "**/main.go"
  - "**/mocks.go"
  - "**/mocks/**"
  - "**/testdata/**"
  - "**/testing/**"
  - "**/types.go"
  - "**/version.go"
  - "bench/**"
  - "canary/**"
  - "common/persistence/persistence-tests/**"
  - "common/domain/errors.go"
  - "common/log/**"
  - "common/metrics/**"
  - "common/persistence/nosql/nosqlplugin/dynamodb/**"
  - "common/persistence/nosql/nosqlplugin/mongodb/**"
  - "common/types/shared.go" # 8k lines of getters. Not worth testing manually but consider switching to generated code.
  - "host/**"
  - "idls/**"
  - "service/history/workflow/errors.go"
  - "testflags/**"
  - "tools/linter/**"
