Repository navigation
Add support for .yaml extension for config and match files (#2184) - #2519
Conversation
…panso#2483) When running commands like `espanso service --help` or `espanso package --help`, the CLI was displaying the main application help instead of the specific subcommand help. This was caused by using `clap_instance.print_help()` which always prints the root command help, instead of using `err.exit()` which properly handles contextual help for subcommands. Fix: Use `err.exit()` to let Clap handle contextual help display. Fixes espanso#2483
HTML special characters in snippet labels and triggers were being interpreted as HTML tags instead of displayed as text in the search bar. - Add EscapeHtml() helper function to escape &, <, >, and " - Escape label and trigger strings before inserting into HTML template - Add comment referencing issue espanso#974 Example: A snippet with `<kbd>test</kbd>` now displays correctly instead of rendering an actual <kbd> HTML element.
HTML special characters in match labels and triggers were being interpreted by wxHtmlListBox, causing tags like <kbd> to render as HTML instead of plain text. Added EscapeHtml() helper function to escape HTML entities (&, <, >, ") in both labels and triggers before display. Fixes espanso#974
YAML files can now use both .yml and .yaml extensions. The .yaml extension is now preferred as it is the official YAML file extension. Changes: - Added .yaml pattern to STANDARD_INCLUDES for match files - Support default.yaml with fallback to default.yml for backwards compatibility - Updated all file creation to use .yaml extension (default.yaml, base.yaml) - Updated file path references in edit, path, and troubleshoot commands - Renamed resource files from .yml to .yaml - File watcher already supported both extensions Fixes espanso#385
Update 4 unit tests in espanso-config/src/config/resolve.rs to expect both .yaml and .yml patterns in STANDARD_INCLUDES: - aggregate_includes_empty_config - aggregate_includes_custom_includes - aggregate_includes_extra_includes - aggregate_includes_includes_and_extra_includes The tests were failing on Linux CI because they expected only .yml patterns, but the code now includes both .yaml and .yml patterns. Tests on Windows and macOS passed because unit tests are only executed on Linux in CI.
|
Thanks gcailly! Currently we support .yml on the config only. It's a bug that we don't support .yaml extension. This is fixed with this PR here, but my question is if we should make the default, and first option to lookup YAML, or we stay with the current default YML. What do you think? |
|
Well, I made up my mind again, 😆 . |
|
Smeech, please update the documentation, as this is important info for our users 🙏🏼 👍🏼 |
I'll add it to the list, but it won't affect most users, and none at all until it makes it into a Release. If we're making it the default, however, and changing the names of |
|
@smeech, I didn't think this change would impact the documentation so significantly. I'll make a PR for the docs. |
|
As I provide a lot of the support for new users, I try to think of how the docs appear for them. At this stage, we'll have many using the versions before the change, as well as a handful on the new version. Bearing in mind we don't push updates, both need to understand what they're reading and how it affects their own configuration. I don't want to have to have 130 instances of something like "if you're using v2.2.9 onwards, you can also use TBH, I would prefer to keep the existing defaults, but simply permit Alternatives are to revert to versioned docs, as we did while v0.7.5 was prevalent, or introduce a "What's new" section we expect everyone to read through. Without having had much time to think this through, I'm open to other suggestions, however! |
- Replace all .yml references with .yaml throughout the documentation - Add note explaining .yaml is the official extension while .yml remains supported - Update glob patterns to show both extensions: ../match/**/[!_]*.yaml and ../match/**/[!_]*.yml Related to espanso/espanso#2519
|
@smeech I understand your point. |
|
Hey!
I understand your pain to address possibly documenting multiple versions (and loads of work) and that not what we want ever again. Maintaining multiple versions of a documentation is a colossal burden to manage. Maybe we (the espanso org) need to express our expectations we have over the users, so it's a clear understanding about what we provide, and back our comments and decisions with a public contract. What do you think? My suggestion for the documentation is NOT to change notes: |
My thoughts exactly. |
|
At the end I reverted the priority of |
|
Ideally we'd allow
Priority doesn't really matter (except if users have duplicate base-named files with different extensions), but will probably cause fewer user issues if
No problem with:
It's an excellent PR from @gcailly, it just goes a bit further than the Issues and what we need at the moment, I'm afraid 😁 . |
|
Yes! I didn't revert the whole PR, just changed the priority order from
to
In the future it is as easy as reverting the #2523 (reverting the revert 😆 ) and it's done |
) (espanso#2519) * Add support for .yaml extension for config and match files (espanso#385) YAML files can now use both .yml and .yaml extensions. The .yaml extension is now preferred as it is the official YAML file extension. Changes: - Added .yaml pattern to STANDARD_INCLUDES for match files - Support default.yaml with fallback to default.yml for backwards compatibility - Updated all file creation to use .yaml extension (default.yaml, base.yaml) - Updated file path references in edit, path, and troubleshoot commands - Renamed resource files from .yml to .yaml - File watcher already supported both extensions Fixes espanso#385 * Fix unit tests for .yaml extension support Update 4 unit tests in espanso-config/src/config/resolve.rs to expect both .yaml and .yml patterns in STANDARD_INCLUDES: - aggregate_includes_empty_config - aggregate_includes_custom_includes - aggregate_includes_extra_includes - aggregate_includes_includes_and_extra_includes The tests were failing on Linux CI because they expected only .yml patterns, but the code now includes both .yaml and .yml patterns. Tests on Windows and macOS passed because unit tests are only executed on Linux in CI.
This PR adds support for the
.yamlextension for configuration and match files, while maintaining backwards compatibility with existing.ymlfiles..yamlextension (the official YAML extension)..yamland.ymlextensions are now detected and loaded..yamlfirst, then falls back to.ymlfor backwards compatibility.espanso edit,espanso path) to use.yamlextension.base.yml→base.yaml,default.yml→default.yaml.Existing users with
.ymlfiles will continue to work. The file watcher already supported both extensions, and the config loader now has a fallback mechanism.Fixes #2184, #385.