Skip to content

[codecov-cli] Swift comments inside functions incorrectly marked as uncovered lines #106

@InterstellarStella

Description

@InterstellarStella

Environment

  • Codecov CLI version: Latest
  • Language: Swift
  • Coverage format: Cobertura XML (generated from Xcode)

Steps to Reproduce

  1. Create a Swift file with comments inside a function
  2. Run your test suite and generate coverage reports
  3. Upload the coverage report to Codecov using the CLI
  4. View the pull request coverage report

Expected Result

Comments should be excluded from coverage calculations regardless of where they appear in the file. Whether a comment is inside or outside a function, it should not be counted as a "coverable line" or show up as "uncovered."

Actual Result

Comments inside functions are marked as uncovered lines and show up in the coverage report as missing coverage (see screenshot). This makes it look like there's missing test coverage when there isn't.

However, if you move the exact same comments outside the function, they are correctly excluded from the coverage report and don't appear at all.

Screenshot:

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions