redhat-documentation / vale-at-red-hat

Vale config files, styles, and docs to help individuals and teams roll out Vale
https://redhat-documentation.github.io/vale-at-red-hat/
MIT License
38 stars 58 forks source link

Create a Vale rule that promtps a user about merge conflict markers #767

Closed dfitzmau closed 6 months ago

dfitzmau commented 6 months ago

Describe the bug A recent PR was merged that included a missed merge conflict marker: https://github.com/openshift/openshift-docs/pull/74760

Examples:

These marker examples represent how GitHub flags a merge conflict location in a document.

To Reproduce Steps to reproduce the behavior:

1.Doc includes <<<<<<< HEAD

  1. Vale reports an illegitimate alert: error

Expected behavior A clear and concise description of what you expected to happen.

Additional context As per the GH docs, <<<<<<< HEAD is the offical syntax for the opening merge conflict marker.

Running grep --include=*.adoc -rnw . -e ">>>>>>>" against the openshift-docs repo show no results. Likewise with the reverse arrows. The equal signs could cause conflict so the regex restriction is important (7 x =).

bergerhoffer commented 6 months ago

Although I agree this is a good idea, we'd have to be careful what we check for, otherwise it will hit on things that are valid. For example, ======= can be valid AsciiDoc. Some people use more equal signs than necessary for table openings/closing, etc. Or could be regular code output.

At the very least, I believe <<<<<<< HEAD would be safe to check for. I'm less sure about whether >>>>>>> would also be safe, or if it's possible that could be a legitimate entry. Maybe they'd have to be warnings to be safe.

dfitzmau commented 6 months ago

PR https://github.com/openshift/openshift-docs/pull/74760 merged. Closing this issue.

dfitzmau commented 6 months ago

Test PR on docs-openshift repository: https://github.com/openshift/openshift-docs/pull/74936