ArTchie-Bedder-Suite / Docs / Anvil
Scene YAML Linter
Lints project scenes and prefabs for unnamed objects, insane nesting, empty scenes, missing prefab instances, and duplicate sibling names.
Editor-only. Unity 2021.3+. Lives in Anvil.Editor (includePlatforms: Editor). No extra packages.
Editor window
ArTchie / Anvil / Scene YAML Linter
| Button | What it does |
|---|---|
| Scan | Walks every scene and prefab under Assets/ (skips Packages/ and Library/). |
| Copy JSON | Puts the report JSON on the clipboard. |
| Write report | Writes <project>/AnvilReports/scene-yaml-lint.json (creates the folder if needed). |
Each row is: assetPath, kind (scene or prefab), hierarchy objectPath, rule, and a short detail.
Rules
rule |
When it fires |
|---|---|
unnamed |
GameObject m_Name is empty/whitespace or exactly GameObject |
nesting-depth |
Transform ancestor count is greater than 12 (root = 0) |
empty-scene |
Scene has no roots, or every root is Main Camera / Directional Light (scenes only) |
missing-prefab |
Prefab instance whose source asset is missing (PrefabInstanceStatus.MissingAsset, or YAML m_SourcePrefab guid not found) |
duplicate-sibling |
Two or more children of the same parent share the same name (one item per name group) |
Batchmode (CI)
Unity -batchmode -nographics -quit -projectPath <proj> -executeMethod Anvil.SceneYamlLinter.RunBatch -anvil-out <file.json> -anvil-fail
| Arg | Meaning |
|---|---|
-anvil-out <file.json> |
Output path. Default: <project>/AnvilReports/scene-yaml-lint.json |
-anvil-fail |
Exit code 1 if any lint item was found; otherwise 0 |
RunBatch only calls EditorApplication.Exit when Application.isBatchMode is true. It logs count= and the output path.
Also accepts -anvil-out=file.json.
JSON
{
"tool": "SceneYamlLinter",
"generatedUtc": "2026-08-18T02:00:00Z",
"count": 1,
"items": [
{
"assetPath": "Assets/Scenes/Main.unity",
"kind": "scene",
"objectPath": "Level/Props/GameObject",
"rule": "unnamed",
"detail": "m_Name is \"GameObject\""
}
]
}
Notes
- Prefabs are loaded with
PrefabUtility.LoadPrefabContents/UnloadPrefabContents. - Scenes: additive open+close in the Editor window (restores your previous setup);
OpenSceneMode.Singlein batch. - If a scene/prefab cannot be opened, the tool falls back to YAML (names, father chain, PrefabInstance guids). Binary-serialized assets cannot be YAML-parsed; they are skipped with a warning.
GameObject (1)is not treated as unnamed — only the exact default nameGameObject.- Empty-scene does not look at URP volumes or other template extras; those scenes are not “default-only”.
- Empty projects and a missing
AnvilReportsfolder are fine (count: 0). - Does not modify scenes or prefabs. Does not touch runtime player code.
Source in the box: Assets/ArTchie Studios/ArTchie-Suite/com.artchie.anvil/Documentation/SceneYamlLinter.md