Exclude a swift file from XCode code coverage

Viewed 891

I am using Apollo SDK, which generates an API.swift file. Can we exclude this file from the code coverage

2 Answers

You can't exclude files from code coverage report directly in Xcode. You can use external tools like xcov or slather to generate HTML version of report and set list of excluded files in its config file.

You can do it in codecov.yml (external tools)

... ... ...

ignore:

  • "path-for-file-to-ignore"
Related