Commit Graph

18 Commits

Author SHA1 Message Date
Anthony Sottile a49f812a96 py39+
Committed via https://github.com/asottile/all-repos
2024-10-11 19:30:07 -04:00
Anthony Sottile b13ff9b868 adjust error outputs to be more standardized 2022-04-06 16:59:53 -04:00
Anthony Sottile 8f6152921e drop python3.6 support
python 3.6 reached end of life on 2021-12-23

Committed via https://github.com/asottile/all-repos
2022-01-15 19:24:05 -05:00
Anthony Sottile 39ab2ed85e replace exit(main()) with raise SystemExit(main())
Committed via https://github.com/asottile/all-repos
2021-10-23 13:23:50 -04:00
Ersin Yildirim 07af54024c Adjust git dir when checking for merge in worktree 2021-10-15 18:23:43 -04:00
Anthony Sottile f5c42a050b pre-commit-hooks: python3.6+ 2020-02-05 11:22:18 -08:00
Anthony Sottile fea76b9ea1 Fix CI by upgrading AP templates 2020-02-03 08:41:48 -08:00
Anthony Sottile 030bfac7e4 Apply typing to all of pre-commit-hooks 2019-01-31 20:09:15 -08:00
Vinay Karanam 64b9f3dcf0 Added --assume-in-merge option for check-merge-conflict
Fixes #300
2018-06-26 23:59:40 +05:30
Anthony Sottile 2a902e0a07 Use asottile/add-trailing-comma 2017-07-12 18:58:30 -07:00
Anthony Sottile 6076fd1b15 Support rebase conflicts in check-merge-conflicts 2017-06-12 10:39:07 -07:00
Anthony Sottile 70e405ede2 Add a new hook to forbid new submodules 2016-11-30 09:56:42 -08:00
Anthony Sottile 4a01f64c8f Fix check-merge-conflict against binary files 2016-05-26 11:20:32 -07:00
Alexander Dupuy 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
Alexander Dupuy 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
Anthony Sottile 635fa7dd9d Only check merge conflicts on conflict commits 2015-03-20 16:21:02 -07:00
Guy Kisel 86d8446800 Fix off by one error in line number enumeration 2015-03-13 16:32:21 -07:00
Guy Kisel 779a42919a Add check-merge-conflict hook 2015-03-13 16:30:14 -07:00