12 Commits

Author SHA1 Message Date
fea76b9ea1 Fix CI by upgrading AP templates 2020-02-03 08:41:48 -08:00
030bfac7e4 Apply typing to all of pre-commit-hooks 2019-01-31 20:09:15 -08:00
64b9f3dcf0 Added --assume-in-merge option for check-merge-conflict
Fixes #300
2018-06-26 23:59:40 +05:30
2a902e0a07 Use asottile/add-trailing-comma 2017-07-12 18:58:30 -07:00
6076fd1b15 Support rebase conflicts in check-merge-conflicts 2017-06-12 10:39:07 -07:00
70e405ede2 Add a new hook to forbid new submodules 2016-11-30 09:56:42 -08:00
4a01f64c8f Fix check-merge-conflict against binary files 2016-05-26 11:20:32 -07:00
5c752935fd Refactor check-merge-conflicts tests
Do a straight test of detecting a real merge conflict as generated by git.
Test artificial conflict detection while pending merge without a real conflict.
Test artificial non-conflict non-detection in a resolved merge conflict.
Rename test_does_not_care... function to reflect what we want to care about.
Rename is_in_merge_conflict to is_in_merge since that is what it checks.
2015-05-09 04:29:38 +02:00
eefc46f901 Don't report markup titles as merge conflicts
Several markup formats, such as Markdown or Re(Structured)Text
can format titles as text with '=' characters as double underlining,
like this:
```
My Page Title
=============

Lorem ipsum...
```

Rather that considering any line starting with seven '=' as a conflict marker,
require a space (or line-ending newline) after the equals.
This could still create a false positive for a seven character title,
like "Problem", but the markup formats generally allow extra '=' characters,
so by formatting the text like this:
```
Problem
========

Not...
```
these pre-commit warnings can be avoided.

Also updates the tests to add newlines for more realistic conflict files
(while a file might not end with a newline, conflict markers will).
Prevent false negative on test_does_not_care_when_not_in_a_conflict()
by making sure that README.md contains a line identical to a conflict string
(exactly seven '=' followed by a newline).
2015-05-09 04:20:38 +02:00
635fa7dd9d Only check merge conflicts on conflict commits 2015-03-20 16:21:02 -07:00
86d8446800 Fix off by one error in line number enumeration 2015-03-13 16:32:21 -07:00
779a42919a Add check-merge-conflict hook 2015-03-13 16:30:14 -07:00