Skip to content

Force-update all comments in .yml files when resaving#1169

Merged
MischaPanch merged 2 commits intomainfrom
update-all-yaml-comments
Mar 27, 2026
Merged

Force-update all comments in .yml files when resaving#1169
MischaPanch merged 2 commits intomainfrom
update-all-yaml-comments

Conversation

@opcode81
Copy link
Copy Markdown
Contributor

No description provided.

Comment thread src/serena/util/yaml.py

def transfer_missing_yaml_comments_by_index(
source: CommentedMap, target: CommentedMap, indices: list[int], forced_update_keys: Sequence[str] = ()
source: CommentedMap, target: CommentedMap, indices: list[int], forced_update_keys: Sequence[str] = (), force_update_all: bool = False
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like force updating by default, but a few powerusers may want to keep their comments. We could accommodate both by adding an "advanced" global config option allow_config_comment_overwrites. Wdyt? Or not worth the complexity?

@MischaPanch MischaPanch merged commit 9f1b71a into main Mar 27, 2026
3 of 4 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.

2 participants