fleetlint Policy for a fleet of repositories
v0.10
Getting started

slop/debug-output

No debug prints outside tests

Severityinfo
Tiersall
Stacksany
Scoperoot
Kindexpr
Sourcelibrary v0.7.0
Selected byfleetlint-slop@v0.7.0

Requirement

Non-test code writes through the logger or the program’s output layer, not through raw print calls (print(, console.log(, fmt.Print, System.out.print, Console.WriteLine(, var_dump(), and carries no debugger statements (debugger, binding.pry, byebug).

Why

Raw prints cannot be levelled, redacted or switched off, and they leak into the output of anything that embeds the code.

Check

For each item in:

codegrep("nontest", r'(^|[^.\w])print\(|\bconsole\.(log|debug|info)\(|(^|[^.\w])println!?\(|\bfmt\.Print|\bdebugPrint\(|\bdbg!\(|\bSystem\.(out|err)\.print|\bConsole\.Write(Line)?\(|\b(var_dump|print_r)\(|\bbinding\.pry\b|^\s*byebug\b|^\s*debugger;?\s*$')
false

Fix

Use the logger; for a CLI, the output stream the command was given.

Agent instruction: Replace with the project’s logger or output writer; delete prints and debugger statements that are debugging leftovers.

Sources


Generated by fleetlint docs from catalog v0.7.0.