Documentation
¶
Index ¶
- Constants
- Variables
- func ExcludeWithGitignore(gitignorePath string, paths []string) ([]string, error)
- func IsMetadataType(mdValueStr string) bool
- func ReadMetadata(content []byte, path string) (collections.Set[Metadata], collections.Errors)
- type BasicContentAnalyzer
- type ContentAnalyzer
- type DoublestarCollector
- type Engine
- type Factory
- type Feature
- type FeatureApplyError
- type FeatureApplyMode
- type FeatureFunc
- type FeatureList
- type FileDiff
- type FileDiffs
- type FilepathCollector
- type FormatDiff
- type Formatter
- type LineBreakStyle
- type Metadata
- type MetadataError
- type MetadataType
- type Operation
- type PathCollector
- type Registry
- type UnsupportedLineBreakError
Constants ¶
View Source
const MetadataIdentifier = "!yamlfmt!"
Variables ¶
View Source
var ( ErrMalformedMetadata = errors.New("metadata: malformed string") ErrUnrecognizedMetadata = errors.New("metadata: unrecognized type") )
Functions ¶
func ExcludeWithGitignore ¶ added in v0.11.0
func IsMetadataType ¶ added in v0.9.0
func ReadMetadata ¶ added in v0.9.0
func ReadMetadata(content []byte, path string) (collections.Set[Metadata], collections.Errors)
Types ¶
type BasicContentAnalyzer ¶ added in v0.9.0
func NewBasicContentAnalyzer ¶ added in v0.9.0
func NewBasicContentAnalyzer(patterns []string) (BasicContentAnalyzer, error)
func (BasicContentAnalyzer) ExcludePathsByContent ¶ added in v0.9.0
func (a BasicContentAnalyzer) ExcludePathsByContent(paths []string) ([]string, []string, error)
type ContentAnalyzer ¶ added in v0.9.0
type DoublestarCollector ¶ added in v0.7.0
func (*DoublestarCollector) CollectPaths ¶ added in v0.7.0
func (c *DoublestarCollector) CollectPaths() ([]string, error)
type Feature ¶ added in v0.4.0
type Feature struct { Name string BeforeAction FeatureFunc AfterAction FeatureFunc }
type FeatureApplyError ¶ added in v0.4.0
type FeatureApplyError struct {
// contains filtered or unexported fields
}
func (*FeatureApplyError) Error ¶ added in v0.4.0
func (e *FeatureApplyError) Error() string
func (*FeatureApplyError) Unwrap ¶ added in v0.4.0
func (e *FeatureApplyError) Unwrap() error
type FeatureApplyMode ¶ added in v0.4.0
type FeatureApplyMode string
var ( FeatureApplyBefore FeatureApplyMode = "Before" FeatureApplyAfter FeatureApplyMode = "After" )
type FeatureFunc ¶ added in v0.4.0
type FeatureList ¶ added in v0.4.0
type FeatureList []Feature
func (FeatureList) ApplyFeatures ¶ added in v0.4.0
func (fl FeatureList) ApplyFeatures(ctx context.Context, input []byte, mode FeatureApplyMode) (context.Context, []byte, error)
type FileDiff ¶ added in v0.8.0
type FileDiff struct { Path string Diff *FormatDiff }
func (*FileDiff) StrOutputQuiet ¶ added in v0.8.0
type FileDiffs ¶ added in v0.8.0
func (FileDiffs) ChangedCount ¶ added in v0.8.0
func (FileDiffs) StrOutputQuiet ¶ added in v0.8.0
type FilepathCollector ¶ added in v0.7.0
func (*FilepathCollector) CollectPaths ¶ added in v0.7.0
func (c *FilepathCollector) CollectPaths() ([]string, error)
type FormatDiff ¶ added in v0.8.0
func (*FormatDiff) Changed ¶ added in v0.8.0
func (d *FormatDiff) Changed() bool
func (*FormatDiff) MultilineDiff ¶ added in v0.8.0
func (d *FormatDiff) MultilineDiff() (string, int)
type LineBreakStyle ¶ added in v0.5.0
type LineBreakStyle string
const ( LineBreakStyleLF LineBreakStyle = "lf" LineBreakStyleCRLF LineBreakStyle = "crlf" )
func (LineBreakStyle) Separator ¶ added in v0.5.0
func (s LineBreakStyle) Separator() (string, error)
type Metadata ¶ added in v0.9.0
type Metadata struct { Type MetadataType LineNum int }
type MetadataError ¶ added in v0.9.0
type MetadataError struct {
// contains filtered or unexported fields
}
func (*MetadataError) Error ¶ added in v0.9.0
func (e *MetadataError) Error() string
func (*MetadataError) Unwrap ¶ added in v0.9.0
func (e *MetadataError) Unwrap() error
type MetadataType ¶ added in v0.9.0
type MetadataType string
const (
MetadataIgnore MetadataType = "ignore"
)
type PathCollector ¶ added in v0.7.0
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
func NewFormatterRegistry ¶
func (*Registry) GetDefaultFactory ¶
type UnsupportedLineBreakError ¶ added in v0.5.0
type UnsupportedLineBreakError struct {
// contains filtered or unexported fields
}
func (UnsupportedLineBreakError) Error ¶ added in v0.5.0
func (e UnsupportedLineBreakError) Error() string
Source Files
¶
Click to show internal directories.
Click to hide internal directories.