forked from voidcrew/Voidcrew-LRP
-
Notifications
You must be signed in to change notification settings - Fork 0
/
check_regex.yaml
44 lines (39 loc) · 1.7 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
# 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: [9, 'Del()s', '\WDel\(']
- exactly: [0, '/atom text paths', '"/atom']
- exactly: [1, '/area text paths', '"/area']
- exactly: [16, '/datum text paths', '"/datum']
- exactly: [4, '/mob text paths', '"/mob']
- exactly: [55, '/obj text paths', '"/obj']
- exactly: [0, '/turf text paths', '"/turf']
- exactly: [128, 'text2path uses', 'text2path']
- exactly: [22, 'world<< uses', 'world[ \t]*<<']
- exactly: [0, 'world.log<< uses', 'world.log[ \t]*<<']
- exactly: [303, 'non-bitwise << uses', '(?<!\d)(?<!\d\s)(?<!<)<<(?!=|\s\d|\d|<|\/)']
- exactly: [0, 'incorrect indentations', '^(?: +)(?!\*)']
- exactly: [0, 'superflous whitespace', '[ \t]+$']
- exactly: [36, 'mixed indentation', '^( +\t+|\t+ +)']
- no_more: [0, 'indentions inside defines', '^(\s*)#define (\w*)( {2,}| ?\t+)(?!(\/\/|\/\*))']