# swift/skip-reasons

> Checks that skip calls and disabled traits name a nonempty reason, and unavailable tests carry an explanation.

Checks that skip calls and disabled traits name a nonempty reason, and unavailable tests carry an explanation.

Part of the [`swift`](/reference/configurations/swift/) configuration, at the `recommended` [level](/start/concepts/#levels). It runs at the `commit` [stage](/start/concepts/#stage), per file. gspot runs this check itself.

## Why

A skipped test with no reason stays off, because nobody can tell when to restore it.

## What to do

Write why the test stays off and what turns it on again, or delete it.

## Example

`throw XCTSkip()` in a Swift test reports a missing reason. Restore the test, or give a reason such as `throw XCTSkip("Requires the hardware test device")`.

## Turn it off

Turn it off for some files, with a reason:

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