Skip to content

Validate filename template placeholders in config - #98

Merged
Ava-91 merged 2 commits into
mainfrom
remediation/p2-filename-template-validation
Sep 10, 2026
Merged

Ava-91 merged 2 commits into
mainfrom
remediation/p2-filename-template-validation

Conversation

@Ava-91

@Ava-91 Ava-91 commented Sep 10, 2026

Copy link
Copy Markdown
Owner

Problem

Unsupported filename placeholders such as {banana} are accepted by configuration but fail later during rename planning.

Root cause

validate_profile() only checked that the template was a non-empty string.

Fix

Validate template syntax and supported placeholders at profile validation time using string.Formatter. Supported fields remain track, artist, title, album, album_artist, disc, year, genre, and format.

Tests

Added coverage for all supported fields, unsupported fields, malformed syntax, nested unsupported fields, and existing config behavior.

Validation

Latest branch CI is green across Python 3.11, 3.12, 3.13, unittest, pytest, compileall, pip check, Ruff, and security.

Scope / non-goals

No sanitization, collision, rename execution, scanner, metadata, artwork, duplicate, SQLite, or operation-log changes.

Closes #97

@Ava-91
Ava-91 merged commit 331a1f5 into main Sep 10, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Reject unsupported filename placeholders during profile validation

1 participant