# swift/coverage

> Measures each source target in Xcode projects and Swift packages against `coverage.lines` and its `coverage.swift_target` floor.

Measures each source target in Xcode projects and Swift packages against `coverage.lines` and its `coverage.swift_target` floor.

Part of the [`swift`](/reference/configurations/swift/) configuration, at the `recommended` [level](/start/concepts/#levels). It runs at the `push` [stage](/start/concepts/#stage), once per scope. gspot runs this check itself. It needs a build of the project. It runs on macOS and Linux.

## Why

A floor for each target exposes Swift code that no test runs.

## What to do

Add tests for the target, or lower its floor with a reason.

## Example

A Swift target reports 85% line coverage against a 90% floor. Add a test that exercises its uncovered lines, then rerun the target.

## Turn it off

Turn it off for some files, with a reason:

```shell
gspot ignore swift/coverage --paths "<glob>" --reason "<why>"
```
