fix(copy): skip sync for files with unknown comment extensions instead of crashing #18
+12
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
ValueErrorin_handle_syncfor files with extensions not inEXTENSION_COMMENT_MAPorFILENAME_COMMENT_MAP.json,.cfg) caused a hard crash during sync becauseget_comment_config()raises on unknown extensionsDetails
_handle_synccallssections.has_sections(),sections.wrap_in_synced_section(), andheader.add_header(), all of which callget_comment_config(path)internally. For file extensions not in the known maps, this raises aValueErrorand crashes the entire copy command.The fix adds an early return at the top of
_handle_syncusingheader.has_known_comment_prefix(dest_path). This is consistent with_find_files_with_configwhich already had the same guard for orphan cleanup.SCAFFOLDandREPLACEsync modes are unaffected -- they don't need comment configs.