fix: correct .roomodes format and add source field support#5
Merged
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR corrects the .roomodes file format and adds support for a new "source" field in mode configurations to improve compatibility with external tools. Key changes include:
- Adding the "Source" field in metadata and configuration structures.
- Updating import and export commands to include conditional handling of the "source" field.
- Adjusting markdown files to demonstrate proper usage in frontmatter.
Reviewed Changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| internal/mode/parser.go | Added assignment for the "Source" field in the config. |
| internal/mode/mode.go | Updated Metadata and Config types to include the "Source" field. |
| internal/cmd/import.go | Includes logic to add a "source" entry in the frontmatter if present. |
| internal/cmd/export.go | Modifies JSON export structure to output "customModes", adding the "source". |
| .roo/modes/translate.md | Updates frontmatter example to include a "source" field. |
| .roo/modes/test.md | Defines test mode configuration; no "source" field provided. |
Files not reviewed (1)
- .roomodes: Language not supported
|
|
||
| exportData = append(exportData, ExportedMode{ | ||
| // Use the source field from the Frontmatter if it exists, otherwise use the file path | ||
| source := m.Source |
There was a problem hiding this comment.
The comment indicates using the source field from the frontmatter if it exists, otherwise falling back to the file path, but the current code only assigns m.Source. Consider implementing a fallback to m.FilePath when m.Source is empty.
This commit fixes issues with the .roomodes file format by: - Restructuring the JSON format to use a "customModes" wrapper object - Adding support for the "source" field in mode configurations - Properly preserving source field during import/export operations - Ensuring consistent handling of source paths in exported modes These changes maintain compatibility with external tools that expect the .roomodes file to follow the correct format structure.
d652b1f to
3653d1a
Compare
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This commit fixes issues with the .roomodes file format by:
These changes maintain compatibility with external tools that expect the .roomodes file to follow the correct format structure.