SamVerschueren / clinton

Project style linter
MIT License
122 stars 9 forks source link

Check files for merge conflicts #55

Closed SamVerschueren closed 7 years ago

SamVerschueren commented 8 years ago

Merge conflicts appear in a file like this

<<<<<<< HEAD
foo
=======
bar
>>>>>>> development

Questions I have for implementing this

  1. Would it be enough to only check for the <<<<<<< sequence, or should we really check the entire block with the ======== sequence and >>>>>>>>> as well?
  2. Is the first block always named HEAD or could it be something else as well?

// @jfmengels @sindresorhus

jfmengels commented 8 years ago
  1. I would check for each separately. If I resolved a merge conflict partially and forgot to remove the merge characters, I'd still want to be warned about it. The following is a probable trace of merge conflict resolution that went wrong.
bar
>>>>>>> development

Thus, I'd check for ^<<<<<<<\s, ^========$ and ^>>>>>>>>>\s.

  1. The first block can be named something else, so you should not check that.
SamVerschueren commented 8 years ago

Thanks for the feedback!