Skip to content

CAT 027

unurgunite edited this page Jul 11, 2026 · 3 revisions

CAT-027 — Tempfile resource leak

Severity: error | Confidence: high | Auto-fix:

Warning

This rule flags real bugs, not just performance issues.

Description

Tempfile resource leak — Tempfile must be closed and unlinked after use. Use the block form to ensure cleanup.

Bad code

f = Tempfile.new("tmp")
f.print "data"

Performance Impact

Tip

This rule can significantly improve performance in hot code paths.

Benchmark

Note

See bench results at bench/cat-027/

Clone this wiki locally