Default value expressions are returned incorrectly
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 42/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- ruby
調査の方向性
lib/puppet-strings/yard/parsers/puppet/statement.rb の 89-90 行目を読み、次に issue で参照されている Puppet の SourcePosAdapter と locator メソッドを比較します。class test($param = 1 + 1) のデフォルト式がどのように抽出されるかを追跡します。完了条件は、Puppet の互換性を損なうことなく、返される値に完全な 1 + 1 式が含まれることです。
索引モデルが issue の本文から書いたものです。
説明
Describe the Bug
Complex parameter default expressions (specifically those involving an AST branch node) are returned incorrectly.
For example:
class test($param = 1 + 1) { ... }
The default value for $param is returned as +.
Expected Behavior
The default value should be returned as 1 + 1.
Additional Context
This seems to happen because ParameterizedStatement parser uses a SourcePosAdapter from Puppet to extract the text for the AST object. However, the extract_text method it calls only extracts the text for the AST branch itself, not for the entire tree rooted in that branch. The SourcePosAdapter calls @object.locator.extract_text, but there is an extract_tree_text method available on the locator which seems to do the right thing.
https://github.com/puppetlabs/puppet-strings/blob/main/lib/puppet-strings/yard/parsers/puppet/statement.rb#L89-L90
https://github.com/puppetlabs/puppet/blob/master/lib/puppet/pops/adapters.rb#L63
https://github.com/puppetlabs/puppet/blob/master/lib/puppet/pops/parser/locator.rb#L55
I would file a PR but I'm not deep enough into puppet-strings to understand its relationship to Puppet and the compatibility issues involved with the SourcePosAdapter to know the appropriate place to make this change.
- 主要言語
- Ruby
- スター
- 90
- フォーク
- 91
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
puppetlabs/puppet-strings のほかの issue
-
bug
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
puppetlabs/puppet-strings#389 · コメント 3 件 · リアクション 1 件 ·
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 55/100
puppetlabs/puppet-strings#386 ·
-
maintenance
難易度 2/5 1〜3時間 初心者へのやさしさ 35/100
puppetlabs/puppet-strings#370 ·
-
bug
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
puppetlabs/puppet-strings#365 ·
-
community feature
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
puppetlabs/puppet-strings#353 ·
puppetlabs/puppet-strings の issue をすべて見る
似ている issue
-
bug f:search
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
feature
難易度 2/5 1〜3時間 初心者へのやさしさ 60/100
manyfold3d/manyfold#7346 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
🐞 bug pending triage
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
CircuitVerse/CircuitVerse#8025 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
we-promise/sure#4199 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
riscv/riscv-unified-db#2738 ·
メンテナーはふだん 1 日以内に返信