Skip to content

Move linter invocations from CI job config to lint-doc.sh script

Matthias Käppler requested to merge move-markdownlint-to-lint-doc into master

What does this MR do?

I was working on #207993 (closed) which adds developer documentation, and I found it hard to run doc linting locally on my dev machine. Having to wait for CI makes for a long feedback loop.

I noticed that we already have scripts/lint-doc.sh, but for some reason markdown linting was a separate step that only ran in the CI container, and which wasn't immediately accessible for local development.

I therefore moved the markdownlint and vale steps into the script itself.

How it works:

  • The script checks whether both markdownlint and vale or alternatively docker are installed
  • If chooses either one available or fails fast with an error
  • It runs both linters

I also introduced an env var that allows you to narrow down which files should be linted, which makes for a very fast feedback loop prior to pushing doc changes.

You would use it like so:

$ MD_DOC_PATH=doc/development scripts/lint-doc.sh

This will now run markdownlint and vale on top of what it was doing before.

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

  • I already tested this locally by intentionally introducing lint problems, and it worked fine
  • Since this runs as part of CI as well, I checked that linting still works properly under the new structure. To that end I created a new test branch which branches off this one, and which introduced a markdown problem. Expectation: it will fail the build. I then fixed it and build turned green again.
Edited by 🤖 GitLab Bot 🤖

Merge request reports