DEVELOPMENT EDITION · 769442725406
Diagnostics Reference
On this page

B0201: indentation that does not match a block

Catalog status: active. Default severity: error. Stable name: inconsistent-indentation. Family: Syntax and source text.

In Vibe, as in Python, a line's indentation says which block it belongs to. A line indented less than the block it ends must line up with a block around it; this one lines up with none. Vibe also takes no tabs in indentation, so that every editor shows a block the same way.

Example (Vibe)

    if x > 0:
        print(x)
      print(x + 1)
error[B0201]: this line is indented less than the block it ends, but more than any block around it

What to do

Line the statement up with the block it belongs to: here, with print(x) to keep it inside the if, or with if to run it after. Replace tabs with spaces (four per level is Python's usual).

Regression source and further reading

Complete regression example: source, command arguments and expected results. The fixture deliberately reproduces this diagnostic.

See syntax and source text, the code index, and diagnostic interpretation for modes, replay, fix-its and JSON.