forked from deliciousinsights/dev-automation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
git-precommit-checks.config.js
59 lines (59 loc) · 1.47 KB
/
git-precommit-checks.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
module.exports = {
display: {
notifications: true,
offendingContent: true,
rulesSummary: false,
shortStats: true,
verbose: false,
},
rules: [
{
message: 'You’ve got leftover conflict markers',
regex: /^[<>|=]{4,}/m,
},
{
message: 'Discontinued because something should not be committed!',
regex: /do not commit/i,
},
{
message: 'You have unfinished devs',
nonBlocking: true,
regex: /(?:FIXME|TODO)/,
},
{
message: 'You’ve got leftover forced `true` conditions',
regex: /if\s+\(?(?:.*\|\|\s*)?true\)?/,
},
// JS specific
{
filter: /\.js$/,
message:
'😫 Damnit! Auto-imports failed with Material-UI components or styles',
regex: /^import \{ .* \} from '@material-ui\//,
},
{
filter: /\.js$/,
message:
'🤔 Hum! Did you forget to remove some logs?',
nonBlocking: true,
regex: /^\s*console\.log/,
},
// Ruby/Rails specific
{
filter: /_spec\.rb$/,
message: 'Your RSpec test suite is trimmed down by `focus` tags',
regex: /(?:focus: true|:focus => true)/,
},
{
filter: /_spec\.rb$/,
message:
'Your Ruby tests seems to have an active `save_and_open_page` call',
regex: /save_and_open_page/,
},
{
filter: /\.rb$/,
message: 'Your Ruby file seems to have an active `binding.pry` call',
regex: /^[^#]*\bbinding\.pry/,
},
],
}