-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathpattern.go
30 lines (27 loc) · 1.25 KB
/
pattern.go
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
package codacytool
// Pattern corresponds to a rule (pattern) inspected by the tool.
type Pattern struct {
ID string `json:"patternId"`
Category string `json:"category,omitempty"`
SubCategory string `json:"subcategory,omitempty"`
ScanType string `json:"scanType,omitempty"`
Level string `json:"level,omitempty"`
Parameters []PatternParameter `json:"parameters,omitempty"`
Languages []string `json:"languages,omitempty"`
Enabled bool `json:"enabled"`
}
// PatternParameter represents a parameter that can be used to customize a pattern.
type PatternParameter struct {
Name string `json:"name"`
Value interface{} `json:"value,omitempty"`
Default interface{} `json:"default,omitempty"`
Description string `json:"description,omitempty"`
}
// PatternDescription represents the exhaustive description of a pattern.
type PatternDescription struct {
PatternID string `json:"patternId"`
Title string `json:"title"`
Description string `json:"description,omitempty"`
Parameters []PatternParameter `json:"parameters,omitempty"`
TimeToFix int `json:"timeToFix,omitempty"`
}