Skip to content

Fix tests by adding markdown tags #922

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

apiraino
Copy link
Contributor

@apiraino apiraino commented Jul 23, 2025

I noticed that we have a command mdbook test, I have run it and discovered a massive quantity of linting errors.

I did a random visual check and adding the console parameter to all these quoted texts does not seems to change anything but fixes the tests.

So maybe the question is, are we interested in fixing these tests? Are we using tests here anyway?

thanks for sharing an opinion :)

Note: I left out from this patch some lints failures because they involve Rust code and I suspect it's just not linting

Rendered

@rustbot
Copy link
Collaborator

rustbot commented Jul 23, 2025

r? @jieyouxu

rustbot has assigned @jieyouxu.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 23, 2025
Copy link
Member

@jieyouxu jieyouxu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think if they help with better codeblock hinting (or avoiding trying to use Rust syntax highlighting for non-Rust snippets), it seems fine

So maybe the question is, are we interested in fixing these tests? Are we using tests here anyway?

Note that AFAIK none of these are tests, and are only codeblocks for stylistic/illustrative reasons.

Comment on lines +49 to 51
```console
- [`std::ptr::null_mut`](https://doc.rust-lang.org/std/ptr/fn.null_mut.html)
```
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: this is actually md or markdown, right?

@@ -10,7 +10,7 @@ To transfer an issue to another repository, enter a comment with the form:

It is recommended to also include a comment explaining why you are transferring. For example:

```
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: this is more like text?

Comment on lines +160 to 162
```console
$ cargo run --bin prioritization-agenda
```
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remark: I usually use bash for these, not that it really matters, I think

Copy link
Member

@tshepang tshepang Jul 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bash (or sh) gives these wrong highlighting... I would say it should only be used for shell snippets, not command invocations

I would console (as done here) or text them

@@ -83,21 +83,21 @@ These types of procedural comments can be left on the issue (it's also good to l
Zulip). See the previous section. To facilitate a machine parsable scanning of the concerns
please use the following syntax to formally register a concern:

```
```console
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: these are probably better as text, because they're rustbot github comments

@jieyouxu
Copy link
Member

(BTW, what does console actually correspond to?)

@apiraino
Copy link
Contributor Author

(BTW, what does console actually correspond to?)

MDbook uses Highlight.js and it seems to be just an alias for shell
https://github.com/highlightjs/highlight.js/blob/main/SUPPORTED_LANGUAGES.md

console is the most used in our book so I just stuck to that 🤷‍♂️

$ rg -I "\`\`\`shell" | tr -d "^$" | wc
      7       7      63
$ rg -I "\`\`\`console" | tr -d "^$" | wc
     22      22     242
$ rg -I "\`\`\`bash" | tr -d "^$" | wc
      2       2      16

@apiraino
Copy link
Contributor Author

I think if they help with better codeblock hinting (or avoiding trying to use Rust syntax highlighting for non-Rust snippets), it seems fine

Yes, that's also my understanding (i.e. cosmetic linting)

@jieyouxu
Copy link
Member

Yes, that's also my understanding (i.e. cosmetic linting)

Alright, the changes in this PR seems fine in that case. Just wanted to note that I don't think we're running mdbook test on the Forge book nor was that ever intended AFAIK.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants