Fix Utils module to not expect arguments for inspect
维护者通常 1 天内回复
评估
调研方向
从 Liquid::Utils.inspect 开始,复现 issue 中描述的缺少参数时的失败。阅读现有实现和相关 spec,以确定预期的默认行为,然后验证不带参数调用 inspect 不再引发 ArgumentError,并且相关 spec 通过。
由索引模型根据 Issue 内容生成。
描述
Why
Hello. 👋
The Liquid::Utils.inspect method expects an object argument but, when not given, it'll throw an ArgumentError. This violates the Liskov Substitution Principle becauseObject (superclass) does not require you pass in any arguments.
How
To fix, can the method signature be something like this?
self.inspect object = nil, seen = {}
This would allow object to be optional instead of requried.
Notes
I tried monkey patching with nil but ended up with different spec failures so not sure what the default expectation is here but this definitely causes specs to fail in CI when using SimpleCov 1.0.0. Although, when running locally, I could not recreate this.
- 主要语言
- Ruby
- 星标
- 11.9k
- 派生
- 1.6k
- 平均合并
- 11 小时 20 分钟
- 30 天内合并 PR
- 2
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
Shopify/liquid 的其他 Issue
-
`blank` treats Unicode whitespace differently depending on whether ActiveSupport is loaded可能已有人在做 @sebxt 于 37 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 68/100
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 62/100
维护者通常 1 天内回复
-
Wiki link update未关闭
难度 1/5 1 小时以内 新手友好度 65/100
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 65/100
维护者通常 1 天内回复
相似的 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 78/100
hanami/hanami-action#536 ·
-
难度 2/5 1-3 小时 新手友好度 68/100
Shopify/product-taxonomy#1054 ·
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 13 天内回复
-
难度 1/5 1 小时以内 新手友好度 85/100
docker/model-runner#1118 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 70/100
TarteelAI/quranic-universal-library#1111 ·
维护者通常 1 天内回复