Documentation ¶
Index ¶
Constants ¶
View Source
const ( // ImportGroupVerificationSchemeSingle allows for a single, sorted group ImportGroupVerificationSchemeSingle = ImportGroupVerificationScheme(iota) // ImportGroupVerificationSchemeStdNonStd allows for up to two groups in the following order: // - standard imports // - non-standard imports ImportGroupVerificationSchemeStdNonStd // ImportGroupVerificationSchemeStdLocalThirdParty allows for up to three groups in the following order: // - standard imports // - local imports (where local prefix is specified in verification options) // - non-standard imports ImportGroupVerificationSchemeStdLocalThirdParty // ImportGroupVerificationSchemeStdThirdPartyLocal allows for up to three groups in the following order: // - standard imports // - non-standard imports // - local imports (where local prefix is specified in verification options) ImportGroupVerificationSchemeStdThirdPartyLocal )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ErrorReporter ¶
type ErrorReporter interface {
Report(VerificationError)
}
ErrorReporter receives error reports as they are detected by the workers
type Impi ¶
Impi is a single instance that can perform verification on a path
func (*Impi) Verify ¶
func (i *Impi) Verify(rootPath string, verifyOptions *VerifyOptions, errorReporter ErrorReporter) error
Verify will iterate over the path and start verifying import correctness within all .go files in the path. Path follows go tool semantics (e.g. ./...)
type ImportGroupVerificationScheme ¶
type ImportGroupVerificationScheme int
ImportGroupVerificationScheme specifies what to check when inspecting import groups
type VerificationError ¶
type VerificationError struct { FilePath string // contains filtered or unexported fields }
VerificationError holds an error and a file path on which the error occurred
type VerifyOptions ¶
type VerifyOptions struct { SkipTests bool Scheme ImportGroupVerificationScheme LocalPrefix string SkipPaths []string IgnoreGenerated bool }
VerifyOptions specifies how to perform verification
Source Files ¶
Click to show internal directories.
Click to hide internal directories.