-
Notifications
You must be signed in to change notification settings - Fork 11
/
monite.section2-language.yaml
88 lines (80 loc) · 2.8 KB
/
monite.section2-language.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# ###########################################################################################
# Section 2: Language #
# This ruleset covers the Language rules from the Monite API Style guide #
# https://github.com/team-monite/api-style-guide/blob/main/Guidelines.md#section-2-language #
# ###########################################################################################
functions:
- check-spelling
- check-spelling-code
rules:
monite-language-spelling-names:
message: "{{error}}"
severity: error
given:
- "$.paths.*~"
- "$.paths.*.*.parameters[?(@.in==='query' || @.in==='path' || @.in==='cookie')].name"
- "$..properties.*~"
then:
function: check-spelling-code
monite-language-spelling-texts:
message: "{{error}}"
severity: warn
given:
- "$.info.title"
- "$.info.summary"
- "$.info.description"
- "$.paths.*.*.parameters[?(@.in==='query' || @.in==='path' || @.in==='cookie')].description"
- "$..properties.*.description"
then:
function: check-spelling
monite-language-spelling-schema-names:
message: "{{error}}"
severity: warn
given:
- "$.components.schemas.*~"
then:
function: check-spelling
monite-language-avoid-jargon:
message: Try to avoid jargon and use commonly used terms instead
severity: warn
given:
- "$.info.title"
- "$.info.summary"
- "$.info.description"
- "$.paths.*~"
- "$.paths.*.*.parameters[?(@.in==='query' || @.in==='path' || @.in==='cookie')].name"
- "$.paths.*.*.parameters[?(@.in==='query' || @.in==='path' || @.in==='cookie')].description"
- "$.components.schemas.*~"
- "$..properties.*~"
then:
function: pattern
functionOptions:
notMatch: (pan)
monite-language-non-inclusive:
message: Non-inclusive terms have been found
severity: error
given:
- "$.info.title"
- "$.info.summary"
- "$.info.description"
- "$.paths.*~"
- "$.paths.*.*.parameters[?(@.in==='query' || @.in==='path' || @.in==='cookie')].name"
- "$.paths.*.*.parameters[?(@.in==='query' || @.in==='path' || @.in==='cookie')].description"
- "$.components.schemas.*~"
- "$..properties.*~"
then:
function: pattern
functionOptions:
notMatch: (blacklist|Blacklist|black_list|whitelist|Whitelist|white_list|slave|Slave)
monite-language-filler-words:
message: Filler words
severity: warn
given:
- "$.paths.*~"
- "$.paths.*.*.parameters[?(@.in==='query' || @.in==='path' || @.in==='cookie')].name"
- "$.components.schemas.*~"
- "$..properties.*~"
then:
function: pattern
functionOptions:
notMatch: (_info|_details)