Ignore lines with comments inside the files, expected misses

Summary/Description

So I’m making a Swift framework and there are some lines that I can’t cover with tests, like the ones behind version number checks for old iOS versions that GitHub doesn’t have preinstalled simulators for.

It would be nice if these lines could be either marked as “ignore” or “expected miss” inside the code.

Examples

if #available(iOS 12.0) {
  doTheNewStuff()
} else {
  // codecov:miss:next -- marks the next line as expected miss
  doTheOldStuff()
  // codecov:ignore:start -- ignores everything between this and the end line
  doTheOldStuff()
  // codecov:ignore:end
  doTheOldStuff() // codecov:ignore:this -- ignores this line
  // codecov:ignore:next ios -- ignores the next line for the "ios" flag
  doTheOldStuff()
}

Versions

I’m using Swift and running the tests via GitHub Actions.

6 Likes

Hi @Cyberbeni thanks for the request. I’ll forward to the product team.

1 Like

What is the status of this feature request? Is it going to be implemented soon?

1 Like

Hi @GegznaV it is not being prioritized at this time given the low activity on this topic and from user feedback.