forked from shiptest-ss13/Shiptest
-
Notifications
You must be signed in to change notification settings - Fork 0
/
check_regex.yaml
63 lines (57 loc) · 2.16 KB
/
check_regex.yaml
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
60
61
62
63
# There are two ways to configure/add standard cases to test:
# Short:
# - method: [num, 'name/message', 'regex pattern']
#
# Verbose:
# - target:
# method: num
# message: name/message
# pattern: regex pattern
#
# Short requires quotation marks for the strings, the verbose must not have quotation marks
# else the pattern and name/message will be parsed wrong and can break the script.
# Single-quotes are recommended because they allow special characters and won't parse escapes
#
# Verbose is more extensible and flexible, while short is not and is a fixed pattern as
# shown above.
#
# There are currently only two methods:
# exactly: result == target -- fail otherwise
# no_more: result <= target -- warn when below target, fail otherwise
#
standards:
- exactly: [0, "mangled characters", '[\u0000\uFFFF\uFFFD]']
- exactly: [8, "escapes", '\\\\(red|blue|green|black|b|i[^mc])']
- exactly: [8, "Del()s", '\WDel\(']
- exactly: [1, "/atom text paths", '"/atom']
- exactly: [1, "/area text paths", '"/area']
- exactly: [17, "/datum text paths", '"/datum']
- exactly: [4, "/mob text paths", '"/mob']
- exactly: [43, "/obj text paths", '"/obj']
- exactly: [0, "/turf text paths", '"/turf']
- exactly: [117, "text2path uses", "text2path"]
- exactly: [18, "world<< uses", 'world[ \t]*<<']
- exactly: [0, "world.log<< uses", 'world.log[ \t]*<<']
- exactly:
[
266,
"non-bitwise << uses",
'(?<!\d)(?<!\d\s)(?<!<)<<(?!=|\s\d|\d|<|\/)',
]
- exactly: [0, "incorrect indentations", '^(?: +)(?!\*)']
- exactly: [0, "superflous whitespace", '[ \t]+$']
- exactly: [0, "mixed indentation", '^( +\t+|\t+ +)']
- exactly:
[
21,
"padding inside parentheses",
'\(([\t ]+([^)"\n\\]*)|([^("\n]+)[\t ]+)\)',
]
- exactly: [1, "Old-style proc references", '\.proc/(\w+)']
- exactly: [0, "Old-style typed proc references", '([\w/]+?)/?\.proc/(\w+)']
- no_more:
[
34,
"indentions inside defines",
'^(\s*)#define (\w*)( {2,}| ?\t+)(?!(\/\/|\/\*))',
]