Skip to content

Commit e97a66b

Browse files
committed
Show example commit for adding rule
1 parent 99b5183 commit e97a66b

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,3 +184,25 @@ To match a commit where any file is not a text file and includes "42":
184184
```
185185
!is_txt && has_42
186186
```
187+
188+
### Submitting Your Rules
189+
190+
To submit a rule to this project, use this commit as an example: [https://github.com/srcclr/commit-watcher/commit/3ae9e2d340f1ac4d10c9ebffae64c22b0a6ac706](https://github.com/srcclr/commit-watcher/commit/3ae9e2d340f1ac4d10c9ebffae64c22b0a6ac706)
191+
192+
Let's break down the rule a bit:
193+
194+
```
195+
{
196+
name: 'markdown_file',
197+
rule_type_id: 1,
198+
value: '(?i)\.(md|markdown)\z',
199+
description: 'Markdown file'
200+
}
201+
```
202+
203+
There are four different values for the rule:
204+
205+
1. name - unique name, valid characters are alpha numeric, '-', '_', and '.'
206+
2. rule\_type\_id - this is the ID for a rule type described above
207+
3. value - regular expression; this example could be read as "case insensitive, starts with a '.' and is followed either by 'md' or 'markdown' and then the end of the string"
208+
4. description - free text field for describing the rule

0 commit comments

Comments
 (0)