Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Eliminate horizontal scrolling in rust code blocks

オープン
#2,012 コメント 18 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
markdown, rust
領域
documentation

調査の方向性

まず 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 use and 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

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

google/comprehensive-rust のほかの issue

google/comprehensive-rust の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。