Documentation ¶
Index ¶
- Constants
- type Typo
- type TyposDatasetBuilder
- func (tdb *TyposDatasetBuilder) Configure(facts map[string]interface{}) error
- func (tdb *TyposDatasetBuilder) Consume(deps map[string]interface{}) (map[string]interface{}, error)
- func (tdb *TyposDatasetBuilder) Description() string
- func (tdb *TyposDatasetBuilder) Finalize() interface{}
- func (tdb *TyposDatasetBuilder) Flag() string
- func (tdb *TyposDatasetBuilder) Fork(n int) []core.PipelineItem
- func (tdb *TyposDatasetBuilder) Initialize(repository *git.Repository) error
- func (tdb *TyposDatasetBuilder) ListConfigurationOptions() []core.ConfigurationOption
- func (tdb *TyposDatasetBuilder) Name() string
- func (tdb *TyposDatasetBuilder) Provides() []string
- func (tdb *TyposDatasetBuilder) Requires() []string
- func (tdb *TyposDatasetBuilder) Serialize(result interface{}, binary bool, writer io.Writer) error
- type TyposResult
Constants ¶
const ( // DefaultMaximumAllowedTypoDistance is the default value of the maximum Levenshtein distance // between two identifiers to consider them a typo-fix pair. DefaultMaximumAllowedTypoDistance = 4 // ConfigTyposDatasetMaximumAllowedDistance is the name of the configuration option // (`TyposDatasetBuilder.Configure()`) which sets the maximum Levenshtein distance between // two identifiers to consider them a typo-fix pair. ConfigTyposDatasetMaximumAllowedDistance = "TyposDatasetBuilder.MaximumAllowedDistance" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Typo ¶
Typo carries the information about a typo-fix pair.
type TyposDatasetBuilder ¶
type TyposDatasetBuilder struct { core.NoopMerger // MaximumAllowedDistance is the maximum Levenshtein distance between two identifiers // to consider them a typo-fix pair. MaximumAllowedDistance int // contains filtered or unexported fields }
TyposDatasetBuilder collects pairs of typo-fix in source code identifiers.
func (*TyposDatasetBuilder) Configure ¶
func (tdb *TyposDatasetBuilder) Configure(facts map[string]interface{}) error
Configure sets the properties previously published by ListConfigurationOptions().
func (*TyposDatasetBuilder) Consume ¶
func (tdb *TyposDatasetBuilder) Consume(deps map[string]interface{}) (map[string]interface{}, error)
Consume runs this PipelineItem on the next commit data. `deps` contain all the results from upstream PipelineItem-s as requested by Requires(). Additionally, DependencyCommit is always present there and represents the analysed *object.Commit. This function returns the mapping with analysis results. The keys must be the same as in Provides(). If there was an error, nil is returned.
func (*TyposDatasetBuilder) Description ¶
func (tdb *TyposDatasetBuilder) Description() string
Description returns the text which explains what the analysis is doing.
func (*TyposDatasetBuilder) Finalize ¶
func (tdb *TyposDatasetBuilder) Finalize() interface{}
Finalize returns the result of the analysis. Further Consume() calls are not expected.
func (*TyposDatasetBuilder) Flag ¶
func (tdb *TyposDatasetBuilder) Flag() string
Flag for the command line switch which enables this analysis.
func (*TyposDatasetBuilder) Fork ¶
func (tdb *TyposDatasetBuilder) Fork(n int) []core.PipelineItem
Fork clones this pipeline item.
func (*TyposDatasetBuilder) Initialize ¶
func (tdb *TyposDatasetBuilder) Initialize(repository *git.Repository) error
Initialize resets the temporary caches and prepares this PipelineItem for a series of Consume() calls. The repository which is going to be analysed is supplied as an argument.
func (*TyposDatasetBuilder) ListConfigurationOptions ¶
func (tdb *TyposDatasetBuilder) ListConfigurationOptions() []core.ConfigurationOption
ListConfigurationOptions returns the list of changeable public properties of this PipelineItem.
func (*TyposDatasetBuilder) Name ¶
func (tdb *TyposDatasetBuilder) Name() string
Name of this PipelineItem. Uniquely identifies the type, used for mapping keys, etc.
func (*TyposDatasetBuilder) Provides ¶
func (tdb *TyposDatasetBuilder) Provides() []string
Provides returns the list of names of entities which are produced by this PipelineItem. Each produced entity will be inserted into `deps` of dependent Consume()-s according to this list. Also used by core.Registry to build the global map of providers.
func (*TyposDatasetBuilder) Requires ¶
func (tdb *TyposDatasetBuilder) Requires() []string
Requires returns the list of names of entities which are needed by this PipelineItem. Each requested entity will be inserted into `deps` of Consume(). In turn, those entities are Provides() upstream.