S019

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: 4 Imported by: 2

README

S019

The S019 analyzer reports cases of schemas including Computed: false, Optional: false, or Required: false which are extraneous.

Flagged Code

&schema.Schema{
    Computed: false,
    Optional: true,
}

&schema.Schema{
    Optional: false,
    Required: true,
}

&schema.Schema{
    Computed: true,
    Required: false,
}

Passing Code

&schema.Schema{
    Optional: true,
}

&schema.Schema{
    Required: true,
}

&schema.Schema{
    Computed: true,
}

Ignoring Reports

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

//lintignore:S019
&schema.Schema{
    Computed: false,
    Optional: true,
}

Documentation

Overview

Package S019 defines an Analyzer that checks for Schema that should omit Computed, Optional, or Required set to false

Index

Constants

View Source
const Doc = `` /* 207-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