Skip to content
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

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

Closed
dfitzmau opened this issue Apr 18, 2024 · 3 comments
Closed

Comments

@dfitzmau
Copy link
Contributor

dfitzmau commented Apr 18, 2024

Describe the bug
A recent PR was merged that included a missed merge conflict marker: openshift/openshift-docs#74760

Examples:

  • <<<<<<< triggers a merge conflict marker vale alert.
  • >>>>>>> triggers a merge conflict marker vale alert.
  • ======= triggers a merge conflict marker vale alert.

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
2. 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
Copy link

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
Copy link
Contributor Author

PR openshift/openshift-docs#74760 merged. Closing this issue.

@dfitzmau
Copy link
Contributor Author

Test PR on docs-openshift repository: openshift/openshift-docs#74936

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

No branches or pull requests

2 participants