Check C++ starter node comments against the C++ harness
メンテナーはふだん 1 日以内に返信
評価
この issue はまだ評価されていません。
説明
Follow-up to #344/#345, which tie the C starters' struct Node comment to the C harness. The C++ starters document ListNode, TreeNode and Node in a comment as well, while web/compiler-explorer.js declares the classes the code actually compiles against, and nothing compares the two copies, so a member renamed, a constructor dropped, or an initializer lost in one copy goes unnoticed.
One such drift is already on main. Three C++ starters (fraud-rule-worst-case, right-to-left-layout, staging-drift-check) document TreeNode(int x) : val(x), left(nullptr) {}, which leaves right indeterminate, while the harness constructor sets both children to nullptr. A candidate who reads the comment as the contract has to assume a leaf built with one argument carries a garbage right pointer, which is not what the code runs against.
A test in tests/browser/compiler-explorer.test.js could read the C++ harness's ListNode, TreeNode and Node declarations and, for every C++ starter that documents one of them, check that:
- every documented member is declared by the harness with the same type;
- every documented constructor has a harness constructor accepting the same parameter types;
- every pointer member the matching harness constructor sets to null, the documented constructor initializes too.
Failures would name the page, the class and the member or constructor. I checked this by hand against the 36 starters (21 TreeNode, 11 ListNode, 4 Node): members and constructor signatures all agree today, and the initializer check reports right for the three pages above. Fixing their entries in problem-bank/problems.json and regenerating the pages makes it pass.
I would like to work on this.
- 主要言語
- Rust
- スター
- 223
- フォーク
- 148
- 平均マージ
- 1日 11時間
- マージ済み PR(30日)
- 224
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
sysprog21/codetrial のほかの issue
-
Transcript tab does not scroll to new turns対応中かも @henrylee1003 が今日担当しました。 オープン
sysprog21/codetrial#592 · コメント 1 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Let candidates save and switch between named session setups対応中かも @domin67 が今日担当しました。 オープン
sysprog21/codetrial#591 · コメント 1 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Let the candidate choose the editor indentation width対応中かも @princelu1009 が今日担当しました。 オープン
sysprog21/codetrial#589 · コメント 2 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
sysprog21/codetrial#587 · コメント 4 件 ·
メンテナーはふだん 1 日以内に返信
-
CODETRIAL_DURATION_MIN does not preselect the interview length in the lobby対応中かも @RWong04 が 1 日前に担当しました。 オープン
sysprog21/codetrial#582 · コメント 3 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
sysprog21/codetrial の issue をすべて見る
似ている issue
-
bug priority: low ui
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
storytold/gridcraft#3446 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
seabeectl verify exits 0 when verification fails対応中かも @theyottaboy が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
NationalSecurityAgency/seabee#73 ·
メンテナーはふだん 4 日以内に返信
-
ready-for-agent
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
neilsh/stunt-reel#220 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
メンテナーはふだん 1 日以内に返信