Eliminate horizontal scrolling in rust code blocks
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- 説明が足りない
- 活発さ
- 停滞
- 技術スタック
- markdown, rust
調査の方向性
まず rustfmt.toml と、issue で説明されている編集可能な Rust コードブロックから始め、その後、行の長さと行数を変えてレンダリングされたブロックを比較します。インクルードされた Rust ファイル、翻訳されたコメント、use 式、マクロ、シェルコマンド、出力がどのように扱われるかを確認します。完了条件には、横スクロールを防ぐ合意済みのアプローチと検証手順、または残りのケースについて文書化された判断を含める必要があります。
索引モデルが issue の本文から書いたものです。
説明
The style guide mentiones presentation use case for the course. That means much inconvenience while dealing with very long lines in the code snippets.
The problem was addressed earlier as it can be seen from rustfmt.toml configuration:
# The code blocks get a scrollbar if they are wider than this.
max_width = 85
This works well for read only blocks, but fails for editable ones. Due to line numbering, there is less space left for the code. My observations are that the scrolling threshold is 83 for less than 10 line long code, 82 - less than 100 and 81 - above 100. There are no snippets above 1k and I suppose there must not be in the context of the course.
The following merge request adopts max 81-character width and eliminates detected scrolling in rust code blocks.
I suppose it is a partial solution though. But further steps require a discussion.
There should be an automated format validation step. rustfmt can do so with rust files, but not markdown. Across the course there are examples where rust code is separated from markdown files and included like:
{{#include testing/src/lib.rs:leftpad}}
But. Firstly, that means all the rust code should be excluded from md files and guides updated. Secondly, rust code contains comments that are translated. And translations can turn out to be longer than the source. And the result should also be tested. Thirdly, rustfmt seems to ignore long use expressions and long strings in macro arguments - leaves them as they are without errors.
Also the course has some code blocks with long shell commands and text output. Were left unchanged.
Summary questions:
- Should we exclude all rust code from markdown files?
- How can we validate rust code with translated comments?
- How to deal with
useand macros arguments that can still produce horizontal scrolling? - What to do with other code blocks with very long lines?
- 主要言語
- Rust
- スター
- 33.4k
- フォーク
- 2.1k
- 平均マージ
- 2日 9時間
- マージ済み PR(30日)
- 16
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
google/comprehensive-rust のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
google/comprehensive-rust#2955 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
google/comprehensive-rust#2733 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
google/comprehensive-rust#2732 ·
メンテナーはふだん 1 日以内に返信
-
Minor suggested updates to the Collatz Sequence exercise in section 6.8 and its solution in section 6.8.1対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
google/comprehensive-rust#2636 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
google/comprehensive-rust#3155 ·
メンテナーはふだん 1 日以内に返信
google/comprehensive-rust の issue をすべて見る
似ている issue
-
[Feature] 设置里面的同步功能オープンenhancement user-priority/P2
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
メンテナーはふだん 1 日以内に返信
-
agent:triaged bug bughunt pm:npm priority:p1
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
SocketDev/socket-patch#1127 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信