# Codecov configuration to make it a bit less noisy
codecov:
  token: ${{ secrets.CODECOV_TOKEN }}
  notify:
    require_ci_to_pass: yes

coverage:
  precision: 2
  round: down
  range: 70...100

  status:
    patch: false

    project:
      default:
        # inspired by
        # github.com/theochem/iodata/blob/73eee89111bcec426d9e8651ec5d85541c7d6d24/.codecov.yml#L1-L9
        # Commits and PRs are never marked as "failed" due coverage issues.
        # Codecov is only used as an informal tool when reviewing PRs,
        # not in the least because of the many false failures.
        target: 0%
        threshold: 100%

  # ignore statistics for the testing folders
  ignore:
    - .*/tests/.*
    - .*/.*/tests/.*
    - .*/examples/.*
    - .*/__int__.py
    - .*/_version.py
    - "test_*.rb" # wildcards accepted
    - .*/data/.*
    - .*/versioneer.py
    - .*/*/__init__.py
    # - "**/*.pyc"         # glob accepted

comment:
  layout: "reach, header, diff, uncovered, files, changes,"
  behavior: default
  require_changes: false # if true: only post the comment if coverage changes
  require_base: no # [yes :: must have a base report to post]
  require_head: yes # [yes :: must have a head report to post]
  branches: # branch names that can post comment
    - staging
    - main