github.com/ferretdb/golangci-lint@v1.10.1/pkg/report/data.go (about)

     1  package report
     2  
     3  type Warning struct {
     4  	Tag  string `json:",omitempty"`
     5  	Text string
     6  }
     7  
     8  type LinterData struct {
     9  	Name             string
    10  	Enabled          bool `json:",omitempty"`
    11  	EnabledByDefault bool `json:",omitempty"`
    12  }
    13  
    14  type Data struct {
    15  	Warnings []Warning    `json:",omitempty"`
    16  	Linters  []LinterData `json:",omitempty"`
    17  	Error    string       `json:",omitempty"`
    18  }
    19  
    20  func (d *Data) AddLinter(name string, enabled, enabledByDefault bool) {
    21  	d.Linters = append(d.Linters, LinterData{
    22  		Name:             name,
    23  		Enabled:          enabled,
    24  		EnabledByDefault: enabledByDefault,
    25  	})
    26  }