Skip to content

Draft: Test code quality for docs diffs

Marcel Amirault requested to merge test-code-quality-documentation-diff into master

What does this MR do and why?

This MR is a proof of concept that shows how we can use can output vale errors, warnings, and suggestions into a format supported by code quality. When we do this, those messages can be displayed in the diff.

To see this in action, check the diff in this MR, and scroll down to the index2.md file, which should have icons showing the vale issues. Hover over the icons to see each vale message. The icon represents the severity (🛑 for errors, 🔻 for warnings, and 🔵 for suggestions).

One reason this wasn't working previously is that our vale rules use a lot of double quotes in the warning messages. The JSON also uses double quotes for strings, meaning we get lines like severity: "If possible, use "documentation" instead of "docs"." (too many double quotes), which is invalid and fails to parse. Flipping double quotes to single quotes in the vale rules results in severity: "If possible, use 'documentation' instead of 'docs'.", which is valid. GitLab starts parsing it, and it show up in the diff!

Related to #378718 (closed)

Screenshots or screen recordings

Screen_Shot_2022-10-23_at_23.03.40

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Marcel Amirault

Merge request reports

Loading