Skip to content

docs: format code snippets in markdown files #1324

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

Merged
merged 2 commits into from
May 24, 2025

Conversation

alexandear
Copy link
Collaborator

@alexandear alexandear commented Apr 25, 2025

The PR fixes the formatting of code blocks in all Markdown files.md. It also adds mdsf to lint formatting in CI.

The following formatters were chosen:

Caveats and Workarounds

Some Go code snippets can't be formatted with goimports. I marked them with golang - this way, GitHub displays them as Go code, but mdsf will skip them. The similar for shellsession - shfmt can't format it, so I disabled.

Updates #1350

@alexandear alexandear force-pushed the docs/format-readme-code branch from 83c8652 to 8189af0 Compare April 25, 2025 09:11
@ccoVeille
Copy link
Contributor

You can also add the mdsf GHA action that @housegen added recently to mdsf

@alexandear alexandear force-pushed the docs/format-readme-code branch 6 times, most recently from 61fd240 to 3d7458b Compare April 25, 2025 09:54
@alexandear alexandear marked this pull request as ready for review April 25, 2025 09:55
@alexandear
Copy link
Collaborator Author

You can also add the mdsf GHA action that @housegen added recently to mdsf

Added using the manual from https://mdsf.mhouge.dk/#github-action

@ccoVeille
Copy link
Contributor

ccoVeille commented Apr 25, 2025

You can also add the mdsf GHA action that @housegen added recently to mdsf

Added using the manual from https://mdsf.mhouge.dk/#github-action

I'm tired … and sorry.

Everything is fine. I through I had read the mdsf was installed via cargo 🤦‍♂️

@alexandear alexandear marked this pull request as draft May 1, 2025 09:28
@ccoVeille
Copy link
Contributor

Is there anything blocking you @alexandear ?

@alexandear
Copy link
Collaborator Author

Is there anything blocking you @alexandear ?

Yes. I'm thinking about formatting .sh and .toml files and need to find a suitable formatter.

@ccoVeille
Copy link
Contributor

Most of them are listed on mdsf pages

sh: shfmt
toml: taplo

@ccoVeille
Copy link
Contributor

I found tombi to format TOML files.

And asked @hougesen to add it to mdsf, and he did (thanks again)

So now you can use taplo or tombi for the TOML code blocks

@alexandear alexandear force-pushed the docs/format-readme-code branch 9 times, most recently from 4f03273 to 8d15990 Compare May 22, 2025 13:51
@alexandear alexandear marked this pull request as ready for review May 22, 2025 13:52
@alexandear alexandear force-pushed the docs/format-readme-code branch 4 times, most recently from c3276c0 to 1fe8119 Compare May 23, 2025 09:36
@alexandear alexandear force-pushed the docs/format-readme-code branch 4 times, most recently from 8320552 to 4e56d92 Compare May 23, 2025 09:55
@alexandear alexandear force-pushed the docs/format-readme-code branch from 4e56d92 to d1d5ea4 Compare May 23, 2025 09:57
@alexandear alexandear requested a review from ccoVeille May 23, 2025 10:01
@alexandear alexandear merged commit a56cf72 into mgechev:master May 24, 2025
8 checks passed
@alexandear alexandear deleted the docs/format-readme-code branch May 24, 2025 19:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants