[Linting] Check syntax and format code blocks in markdown with blacken-docs #5803
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
https://github.com/adamchainz/blacken-docs
This change introduces the following benefits:
Add a new phony target,
make fmt-docs
, and enforce it as part ofmake lint
, which runs in the CI workflow.Some examples of wrong syntax in the docs before this PR:
)
:mlrun/docs/monitoring/model-monitoring.md
Lines 38 to 45 in f72280d
,
in L61 and L62:mlrun/docs/data-prep/logging_datasets.md
Lines 60 to 64 in f72280d
mlrun/docs/install/kubernetes.md
Lines 378 to 380 in f72280d
...
placeholder) unindented:mlrun/docs/concepts/decorators-and-auto-logging.md
Lines 80 to 88 in f72280d
There are many more wrong syntax examples, but they are all fixed here.
Note: I previously configured Ruff to check and format code blocks inside Python/Jupyter Notebooks, such as code blocks in docstrings.
However, it's not designed to run on markdown files.