chore: apply some linter recommendations.

This commit is contained in:
Alexandre Pujol 2025-04-04 23:45:24 +02:00
parent 3b6b50cf63
commit 984cf28e61
No known key found for this signature in database
GPG key ID: C5469996F0DF68EC
37 changed files with 125 additions and 126 deletions

View file

@ -81,19 +81,19 @@ func (p *Profile) String() string {
return renderTemplate(p.Kind(), p)
}
func (r *Profile) Validate() error {
if err := validateValues(r.Kind(), tokFLAGS, r.Flags); err != nil {
return fmt.Errorf("profile %s: %w", r.Name, err)
func (p *Profile) Validate() error {
if err := validateValues(p.Kind(), tokFLAGS, p.Flags); err != nil {
return fmt.Errorf("profile %s: %w", p.Name, err)
}
return r.Rules.Validate()
return p.Rules.Validate()
}
func (r *Profile) Compare(other Rule) int {
func (p *Profile) Compare(other Rule) int {
o, _ := other.(*Profile)
if res := compare(r.Name, o.Name); res != 0 {
if res := compare(p.Name, o.Name); res != 0 {
return res
}
return compare(r.Attachments, o.Attachments)
return compare(p.Attachments, o.Attachments)
}
func (p *Profile) Merge(other Rule) bool {
@ -103,11 +103,11 @@ func (p *Profile) Merge(other Rule) bool {
return false
}
func (r *Profile) Lengths() []int {
func (p *Profile) Lengths() []int {
return []int{} // No len for profile
}
func (r *Profile) setPaddings(max []int) {} // No paddings for profile
func (p *Profile) setPaddings(max []int) {} // No paddings for profile
func (p *Profile) Sort() {
p.Rules = p.Rules.Sort()