Support partial substitution in `substitute`
还没有人认领这个 Issue。
评估
调研方向
从 utils.substitute 入口点开始,审查当前基于 libfmt 的实现及其中引用的限制。定义并验证部分替换、默认值和可选子字符串所需的行为,并通过测试和文档覆盖约定的语法及验收结果。
由索引模型根据 Issue 内容生成。
描述
What
- Allow partial substitution in
utils.substitutewithout throwing an exception, e.g. such that we can dosubstitute("image.{frame}.{view}.exr", {"view": "right"}) == "image.{frame}.right.exr". - Support for providing a default value, e.g.
{variable:format-default}- TSC feedback - Enhance syntax to support optional substrings e.g.
/mnt</lhs{show}/rhs>/file, where/lhsand/rhswon't print if{show}is not provided - TSC feedback.
Why
We suspect that partial, or gradual, substitution will be useful in OpenAssetIO, especially in the context of serialisation and multi-component systems. However, the current implementation relies on libfmt, which does not support this in its public interface.
If a substitution variable is not provided, the source of the string (host/manager) may wish to provide a good default.
To make strings more re-usable e.g. across different but related file system layouts, it's useful to have a mechanism to make substrings around a token only printed when the token is substituted.
- 主要语言
- C++
- 星标
- 352
- 派生
- 48
- 平均合并
- 4 天 14 小时
- 30 天内合并 PR
- 5
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
OpenAssetIO/OpenAssetIO 的其他 Issue
-
bug test
难度 2/5 1-3 小时 新手友好度 82/100
OpenAssetIO/OpenAssetIO#1527 ·
-
difficulty/medium help wanted
难度 5/5 一周以上 新手友好度 25/100
OpenAssetIO/OpenAssetIO#1504 · 2 条评论 ·
-
difficulty/hard help wanted
难度 4/5 3-5 天 新手友好度 42/100
OpenAssetIO/OpenAssetIO#1503 · 7 条评论 ·
-
difficulty/hard help wanted
难度 5/5 一周以上 新手友好度 30/100
OpenAssetIO/OpenAssetIO#1502 ·
-
difficulty/hard help wanted
难度 5/5 一周以上 新手友好度 30/100
OpenAssetIO/OpenAssetIO#1501 ·
查看 OpenAssetIO/OpenAssetIO 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 88/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 66/100
ROCm/rocm-systems#15475 ·
维护者通常 2 天内回复
-
难度 1/5 1 小时以内 新手友好度 68/100
Sendspin/sendspin-cpp#257 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 76/100
pocoproject/poco#5664 ·
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 70/100