MDS033: directory-structure
Markdown files must exist only in explicitly allowed directories.
# Settings
| Key | Type | Description |
|---|---|---|
| allowed | list | Glob patterns for allowed directories |
Patterns are matched against the full file path using
forward slashes. Use ** to match nested directories
(e.g., docs/** allows any file under docs/). The
special pattern "." allows root-level files only.
# Config
Enable with allowed directories:
rules:
directory-structure:
allowed:
- "docs/**"
- "plan/**"
- "."
- "internal/**/testdata/**"Enabling with the mapping form but without allowed
emits a config warning:
directory-structure: rule enabled but no "allowed" patterns configuredDisable (default):
rules:
directory-structure: false# Examples
# Good
# Allowed file
This file is in an allowed directory.# Bad
# Misplaced file
This file is not in an allowed directory.# Meta-Information
- ID: MDS033
- Name:
directory-structure - Status: ready
- Default: disabled
- Fixable: no
- Implementation: source
- Category: structural