Qiskit / Qiskit/documentation

Consider linting line length in code blocks

Open
#1,806 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

infra 🏗️
Dominant language
Jupyter Notebook
Stars
106
Forks
223
Avg merge
1d 8h
Merged PRs (30d)
72

Description

Long lines are annoying because they result in horizontal scrolling inside the code block. We should consider using a linter (like Ruff or Pylint) to ensure that code blocks are not too long. Although, this would be hard to run on MDX files, so it might be simpler to implement our own linter that uses our markdownReader.ts.

TBD what the line length should be. It'd be helpful to experiment with what is an optimal size when using our docs size, where we avoid scrolling but still use all the real estate. This experiment should consider different screen sizes.

Don't apply this to API docs.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading markdownReader.ts to understand how documentation code blocks are processed. Experiment with line lengths across different screen sizes and determine a limit that avoids horizontal scrolling without wasting space. The work is done when code blocks, excluding API docs, are checked by a linter with an agreed limit.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
documentation, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.