Skip to content

no-file-level-escape-hatch-suppression

File-level Ruff suppression disables an escape-hatch rule across the entire file.

Why

A file-wide suppression silently authorizes future uses that were never reviewed.

Fix

Suppress each intentional use inline with the exact code and a reason.

Examples

Before — flagged File suppresses every banned API use
app/service.py
# ruff: file-ignore[banned-api]
import os
After — preferred One use is suppressed with a reason
app/service.py
import os # noqa: TID251 — vendor SDK boundary

Formerly: no-file-level-escape-hatch-noqa