Skip to content

Commit e1eb133

Browse files
committed
Merge branch 'jc/userdiff-pattern-hint'
Remind developers that the userdiff patterns should be kept simple and permissive, assuming that the contents they apply are always syntactically correct. * jc/userdiff-pattern-hint: userdiff: comment on the builtin patterns
2 parents 669277c + b6029b3 commit e1eb133

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

userdiff.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,16 @@ static int drivers_alloc;
1313
#define IPATTERN(name, pattern, word_regex) \
1414
{ name, NULL, -1, { pattern, REG_EXTENDED | REG_ICASE }, \
1515
word_regex "|[^[:space:]]|[\xc0-\xff][\x80-\xbf]+" }
16+
17+
/*
18+
* Built-in drivers for various languages, sorted by their names
19+
* (except that the "default" is left at the end).
20+
*
21+
* When writing or updating patterns, assume that the contents these
22+
* patterns are applied to are syntactically correct. The patterns
23+
* can be simple without implementing all syntactical corner cases, as
24+
* long as they are sufficiently permissive.
25+
*/
1626
static struct userdiff_driver builtin_drivers[] = {
1727
IPATTERN("ada",
1828
"!^(.*[ \t])?(is[ \t]+new|renames|is[ \t]+separate)([ \t].*)?$\n"

0 commit comments

Comments
 (0)