# gspot/suppressions

> Reports suppressions with no reason, any that lift a size or complexity limit, and Semgrep or Vale directives.

Reports suppressions with no reason, any that lift a size or complexity limit, and Semgrep or Vale directives.

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

## Why

A suppression with no reason hides a finding nobody reviewed.

## What to do

Fix the finding and remove the suppression, or add a reason in the syntax of the tool. Never suppress a size or complexity limit: split the code by its steps, or ask the user to raise it in gspot.toml.

## Example

An `eslint-disable-next-line` comment without a reason reports a finding. Fix the code and remove the comment, or append `-- reason: ...` that explains the exception.

## Turn it off

Turn it off for some files, with a reason:

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

## Suppression forms

| Tool              | Form                                                                                                 |
| ----------------- | ---------------------------------------------------------------------------------------------------- |
| shellcheck        | `# shellcheck disable=SC2086 # reason: the word splitting is wanted here`                            |
| stylelint         | `/* stylelint-disable-next-line declaration-no-important -- the vendor widget sets its own color */` |
| html-validate     | `<!-- [html-validate-disable-next no-inline-style -- the email client strips classes] -->`           |
| eslint            | `// eslint-disable-next-line no-console -- the command prints its result`                            |
| tsc               | `// @ts-expect-error: the library types omit this overload`                                          |
| markdownlint-cli2 | `<!-- markdownlint-disable-next-line MD013 -- the table row cannot wrap -->`                         |
| vale              | Refused; use `gspot ignore`                                                                          |
| pytest            | `if TYPE_CHECKING: # pragma: no cover # imports for type checkers only`                              |
| ruff              | `import plugins # noqa: F401 # the module registers its plugins on import`                           |
| basedpyright      | `value = payload['key'] # type: ignore[index] # the payload is checked above`                        |
| semgrep           | Refused; use `gspot ignore`                                                                          |
| sqlfluff          | `SELECT * FROM orders -- noqa: AM04 -- the view mirrors every column`                                |
| swiftlint         | `// swiftlint:disable:next force_unwrapping - the URL is a literal`                                  |
| swiftformat       | `// swiftformat:disable:next redundantSelf - the closure needs self`                                 |
| periphery         | `// periphery:ignore - the runtime calls it by name`                                                 |
