S018

package
v0.30.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 19, 2024 License: MPL-2.0 Imports: 5 Imported by: 2

README

S018

The S018 analyzer reports cases of Schema including MaxItems: 1 and Type: schema.TypeSet that should be simplified to Type: schema.TypeList.

Flagged Code

&schema.Schema{
    MaxItems: 1,
    Type:     schema.TypeSet,
}

Passing Code

&schema.Schema{
    MaxItems: 1,
    Type:     schema.TypeList,
}

Ignoring Reports

Singular reports can be ignored by adding the a //lintignore:S018 Go code comment at the end of the offending line or on the line immediately proceding, e.g.

//lintignore:S018
&schema.Schema{
    MaxItems: 1,
    Type:     schema.TypeSet,
}

Documentation

Overview

Package S018 defines an Analyzer that checks for Schema that should prefer TypeList with MaxItems 1

Index

Constants

View Source
const Doc = `` /* 163-byte string literal not displayed */

Variables

View Source
var Analyzer = &analysis.Analyzer{
	Name: analyzerName,
	Doc:  Doc,
	Requires: []*analysis.Analyzer{
		schemainfo.Analyzer,
		commentignore.Analyzer,
	},
	Run: run,
}

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL