Skip to content

fix(workspace): preserve .pymarkdown / .yamllint lint configs on upgrade - #1102

Merged
c-vigo merged 8 commits into
devfrom
bugfix/1099-preserve-lint-configs
Jul 15, 2026
Merged

c-vigo merged 8 commits into
devfrom
bugfix/1099-preserve-lint-configs

Conversation

@c-vigo

@c-vigo c-vigo commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Closes #1099. Part of #1096.

Problem

.pymarkdown (the JSON config pymarkdown reads), .yamllint, and the .pymarkdown.config.md doc were fully-managed and overwritten on every install.sh --force, silently destroying repo-specific ignore: globs and rule disables — the exact defect fixed for .pre-commit-config.yaml (#878) and .typos.toml (#913) by promoting them to PRESERVE_FILES. That reasoning was never applied here.

Change

  • Promote .pymarkdown, .yamllint, and .pymarkdown.config.md to PRESERVE_FILES, mirroring the .typos.toml (fix(workspace): scaffold upgrade clobbers a customized .typos.toml (dual-config corruption) #913) change set: *_PREEXISTED captures + print_preserved_template_diff so template evolution stays visible.
  • .yamllint / .pymarkdown.config.md (comment-capable) render the preserved banner; .pymarkdown is strict JSON and stays un-bannered in _BANNER_SKIP, exactly like the already-preserved renovate.json.

Scope note: the original issue named only .pymarkdown.config.md (it carried the managed banner); the actual config a consumer customizes is .pymarkdown (comment-less JSON, banner-skip-listed, missed by a banner-keyed grep). Corrected to preserve the real config plus its doc companion.

Tests / verification

6 new bats cases (preserve + customized-survives + diff-hint for .pymarkdown and .yamllint) + test_transforms.py PRESERVE_FILES membership and preserved-banner coverage. init-workspace.bats 186 ok / 0 fail; test_transforms.py 37 passed; full prek run --all-files green locally.

Merge note

Re-merged onto dev (changelog union resolved). Siblings #1092 and #1093 also touch CHANGELOG.md — a later merge may need "Update branch".

c-vigo added 7 commits July 15, 2026 09:37
Promote both lint configs to PRESERVE_FILES so consumer rule exceptions
survive install.sh --force, mirroring the .typos.toml (#913) promotion:
capture *_PREEXISTED and print the template diff on upgrade. The banner
transform derives the variant from PRESERVE_FILES, so both templates now
render the preserved banner.

Refs: #1099
.pymarkdown is the strict-JSON config pymarkdown actually reads (md0xx rule
settings) — the file a consumer really customizes. Promote it to
PRESERVE_FILES with a *_PREEXISTED capture and template-diff guard, like
.yamllint. Being comment-less JSON it stays banner-skipped, exactly like
renovate.json.

Refs: #1099
@c-vigo c-vigo added bug Something isn't working priority:medium Important but not urgent area:workspace Workspace tooling, justfile, templates labels Jul 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:workspace Workspace tooling, justfile, templates bug Something isn't working priority:medium Important but not urgent

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant