Skip to content
Novus Examples
yaml447 B

YAML with TAB Indentation, Intentionally Invalid

An intentionally invalid YAML file indented with real TAB characters, which the spec forbids for indentation. The final key shows the legal case — a tab inside a quoted scalar — so a parser can be checked for rejecting one without rejecting the other.

Preview — first 11 linesyaml
# INTENTIONALLY INVALID. YAML forbids the TAB character as indentation; only spaces may
# indent a node. The lines below are indented with real TAB characters (U+0009), so a
# conforming loader must raise rather than guess. Tabs inside a scalar VALUE are legal,
# which is why the last key is fine and the ones above it are not.
pipeline:
	name: broken
	stages:
		- build
		- test
legal_tab_inside_value: "a	tab inside a quoted scalar is allowed"

Specifications

Variant
intentionally invalid
Indent Character
TAB (U+0009)
Tab Indented Lines
4
Legal Tab In Scalar
1

Testing contract

Expected to fail
Scenario
Reject TAB indentation while still accepting a TAB inside a quoted scalar
Expected result
The loader raises a scanner error naming the tab character at the first indented line, and does not raise on the quoted scalar containing a tab

What is a .yaml file?

YAML (YAML Ain't Markup Language) is a human-readable data-serialization format using indentation, key-value pairs, and lists, and is a superset of JSON. It supports comments, anchors, and multiple documents per file, favoring readability for configuration. Its indentation sensitivity makes it error-prone to hand-edit.

How to use this file

Use an example YAML file to test config parsers, indentation and anchor handling, multi-document streams, and safe-loading to avoid arbitrary object construction.

How to use this file for testing

“YAML with TAB Indentation, Intentionally Invalid” is a deterministic Novus Examples fixture for Error handling, Config parsing, Schema validation. Deliberately corrupt and invalid files, clearly labelled, for testing how your tool fails.

Documented properties for this file: YAML · 447 bytes. Compare results against paired or grouped companions on this page when present (clean↔damaged, searchable↔scanned, or format twins) so scores stay reproducible across runs.

Download the file once, keep the path stable in CI or local scripts, and treat the spec table as the contract: dimensions, seeds, field lists, and roles are intentional. Corrupt or invalid samples are labelled as such — expect parsers to fail loudly rather than silently accept them.

Pipeline and infrastructure fixtures are inert configuration: steps reference fictional images and scripts, and nothing here executes. Run your linter, schema validator, migrator, or policy engine against them, and expect the deprecated-syntax and intentionally invalid variants to be rejected.

Code examples

import yaml  # pip install pyyaml

with open("tabs-for-indentation.yaml") as f:
    data = yaml.safe_load(f)
print(data)

Generated by generation/pipelines.py. Free for any use, no attribution required — license.