Don't let users attempt to alias/merge arrays
まだ誰も着手していません。
評価
調査の方向性
Start with the YAML.load example and inspect how Psych handles an alias used with the << merge key when the aliased value is an array. The change is done when this invalid array merge is rejected with an error instead of producing a hash containing the literal << key.
索引モデルが issue の本文から書いたものです。
説明
I encountered the confusing behavior described below because I didn't realize that one couldn't merge arrays, only maps. Perhaps we should instead make the parser more strict and throw an error rather than producing the unexpected object structure?
The confusing behavior:
YAML.load("
# Bad! can't merge alias/arrays
foo: &foo
- a: 1
bar:
<<: *foo
")
=> {"foo"=>[{"a"=>1}], "bar"=>{"<<"=>[{"a"=>1}]}}
Note the appearance of the odd <<. I was expecting expected
{"foo"=>[{"a"=>1}], "bar"=>[{"a"=>1}]}
As discussed here, my error is that the problem is that &foo is an attempted alias for an array. It would have been ideal if the parser had indicated my error instead.
In case relevant:
ENV['RBENV_VERSION']
=> "2.4"
YAML.libyaml_version
=> [0, 1, 4]
(Also, not entirely sure if this request belongs here or at https://github.com/yaml/libyaml , please feel free to redirect me!)
- 主要言語
- Ruby
- スター
- 597
- フォーク
- 223
- 平均マージ
- 6時間 8分
- マージ済み PR(30日)
- 2
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
ruby/psych のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
Documentation
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
-
Psych.dump raises Encoding::CompatibilityError for UTF-16/UTF-32 strings対応中かも @Halvanhelv が 29 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 55/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 68/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 52/100
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
JetBrains/homebrew-utils#21 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
ublue-os/homebrew-experimental-tap#774 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
r-uby-dev/llm#251 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
accessibility
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
slovensko-digital/ops-portal#212 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100