فهرست منبع

Merge branch 'master' of https://github.com/src-d/hercules

Robert Lin 6 سال پیش
والد
کامیت
0cc6166281
8فایلهای تغییر یافته به همراه958 افزوده شده و 151 حذف شده
  1. 2 6
      core.go
  2. 238 123
      internal/pb/pb.pb.go
  3. 12 0
      internal/pb/pb.proto
  4. 113 5
      internal/pb/pb_pb2.py
  5. 59 15
      internal/plumbing/uast/uast.go
  6. 33 2
      internal/plumbing/uast/uast_test.go
  7. 291 0
      leaves/research/typos.go
  8. 210 0
      leaves/research/typos_test.go

+ 2 - 6
core.go

@@ -9,7 +9,8 @@ import (
 	"gopkg.in/src-d/hercules.v9/internal/plumbing/identity"
 	"gopkg.in/src-d/hercules.v9/internal/plumbing/identity"
 	"gopkg.in/src-d/hercules.v9/internal/plumbing/uast"
 	"gopkg.in/src-d/hercules.v9/internal/plumbing/uast"
 	"gopkg.in/src-d/hercules.v9/internal/yaml"
 	"gopkg.in/src-d/hercules.v9/internal/yaml"
-	"gopkg.in/src-d/hercules.v9/leaves"
+	_ "gopkg.in/src-d/hercules.v9/leaves"          // add burndown and other analyses
+	_ "gopkg.in/src-d/hercules.v9/leaves/research" // add "research" analyses
 )
 )
 
 
 // ConfigurationOptionType represents the possible types of a ConfigurationOption's value.
 // ConfigurationOptionType represents the possible types of a ConfigurationOption's value.
@@ -171,8 +172,3 @@ func PathifyFlagValue(flag *pflag.Flag) {
 func EnablePathFlagTypeMasquerade() {
 func EnablePathFlagTypeMasquerade() {
 	core.EnablePathFlagTypeMasquerade()
 	core.EnablePathFlagTypeMasquerade()
 }
 }
-
-func init() {
-	// hack to link with .leaves
-	_ = leaves.BurndownAnalysis{}
-}

+ 238 - 123
internal/pb/pb.pb.go

@@ -44,7 +44,7 @@ func (m *Metadata) Reset()         { *m = Metadata{} }
 func (m *Metadata) String() string { return proto.CompactTextString(m) }
 func (m *Metadata) String() string { return proto.CompactTextString(m) }
 func (*Metadata) ProtoMessage()    {}
 func (*Metadata) ProtoMessage()    {}
 func (*Metadata) Descriptor() ([]byte, []int) {
 func (*Metadata) Descriptor() ([]byte, []int) {
-	return fileDescriptor_pb_a943a983732e0793, []int{0}
+	return fileDescriptor_pb_07b4c5185d2fe6c6, []int{0}
 }
 }
 func (m *Metadata) XXX_Unmarshal(b []byte) error {
 func (m *Metadata) XXX_Unmarshal(b []byte) error {
 	return xxx_messageInfo_Metadata.Unmarshal(m, b)
 	return xxx_messageInfo_Metadata.Unmarshal(m, b)
@@ -133,7 +133,7 @@ func (m *BurndownSparseMatrixRow) Reset()         { *m = BurndownSparseMatrixRow
 func (m *BurndownSparseMatrixRow) String() string { return proto.CompactTextString(m) }
 func (m *BurndownSparseMatrixRow) String() string { return proto.CompactTextString(m) }
 func (*BurndownSparseMatrixRow) ProtoMessage()    {}
 func (*BurndownSparseMatrixRow) ProtoMessage()    {}
 func (*BurndownSparseMatrixRow) Descriptor() ([]byte, []int) {
 func (*BurndownSparseMatrixRow) Descriptor() ([]byte, []int) {
-	return fileDescriptor_pb_a943a983732e0793, []int{1}
+	return fileDescriptor_pb_07b4c5185d2fe6c6, []int{1}
 }
 }
 func (m *BurndownSparseMatrixRow) XXX_Unmarshal(b []byte) error {
 func (m *BurndownSparseMatrixRow) XXX_Unmarshal(b []byte) error {
 	return xxx_messageInfo_BurndownSparseMatrixRow.Unmarshal(m, b)
 	return xxx_messageInfo_BurndownSparseMatrixRow.Unmarshal(m, b)
@@ -175,7 +175,7 @@ func (m *BurndownSparseMatrix) Reset()         { *m = BurndownSparseMatrix{} }
 func (m *BurndownSparseMatrix) String() string { return proto.CompactTextString(m) }
 func (m *BurndownSparseMatrix) String() string { return proto.CompactTextString(m) }
 func (*BurndownSparseMatrix) ProtoMessage()    {}
 func (*BurndownSparseMatrix) ProtoMessage()    {}
 func (*BurndownSparseMatrix) Descriptor() ([]byte, []int) {
 func (*BurndownSparseMatrix) Descriptor() ([]byte, []int) {
-	return fileDescriptor_pb_a943a983732e0793, []int{2}
+	return fileDescriptor_pb_07b4c5185d2fe6c6, []int{2}
 }
 }
 func (m *BurndownSparseMatrix) XXX_Unmarshal(b []byte) error {
 func (m *BurndownSparseMatrix) XXX_Unmarshal(b []byte) error {
 	return xxx_messageInfo_BurndownSparseMatrix.Unmarshal(m, b)
 	return xxx_messageInfo_BurndownSparseMatrix.Unmarshal(m, b)
@@ -235,7 +235,7 @@ func (m *FilesOwnership) Reset()         { *m = FilesOwnership{} }
 func (m *FilesOwnership) String() string { return proto.CompactTextString(m) }
 func (m *FilesOwnership) String() string { return proto.CompactTextString(m) }
 func (*FilesOwnership) ProtoMessage()    {}
 func (*FilesOwnership) ProtoMessage()    {}
 func (*FilesOwnership) Descriptor() ([]byte, []int) {
 func (*FilesOwnership) Descriptor() ([]byte, []int) {
-	return fileDescriptor_pb_a943a983732e0793, []int{3}
+	return fileDescriptor_pb_07b4c5185d2fe6c6, []int{3}
 }
 }
 func (m *FilesOwnership) XXX_Unmarshal(b []byte) error {
 func (m *FilesOwnership) XXX_Unmarshal(b []byte) error {
 	return xxx_messageInfo_FilesOwnership.Unmarshal(m, b)
 	return xxx_messageInfo_FilesOwnership.Unmarshal(m, b)
@@ -286,7 +286,7 @@ func (m *BurndownAnalysisResults) Reset()         { *m = BurndownAnalysisResults
 func (m *BurndownAnalysisResults) String() string { return proto.CompactTextString(m) }
 func (m *BurndownAnalysisResults) String() string { return proto.CompactTextString(m) }
 func (*BurndownAnalysisResults) ProtoMessage()    {}
 func (*BurndownAnalysisResults) ProtoMessage()    {}
 func (*BurndownAnalysisResults) Descriptor() ([]byte, []int) {
 func (*BurndownAnalysisResults) Descriptor() ([]byte, []int) {
-	return fileDescriptor_pb_a943a983732e0793, []int{4}
+	return fileDescriptor_pb_07b4c5185d2fe6c6, []int{4}
 }
 }
 func (m *BurndownAnalysisResults) XXX_Unmarshal(b []byte) error {
 func (m *BurndownAnalysisResults) XXX_Unmarshal(b []byte) error {
 	return xxx_messageInfo_BurndownAnalysisResults.Unmarshal(m, b)
 	return xxx_messageInfo_BurndownAnalysisResults.Unmarshal(m, b)
@@ -371,7 +371,7 @@ func (m *CompressedSparseRowMatrix) Reset()         { *m = CompressedSparseRowMa
 func (m *CompressedSparseRowMatrix) String() string { return proto.CompactTextString(m) }
 func (m *CompressedSparseRowMatrix) String() string { return proto.CompactTextString(m) }
 func (*CompressedSparseRowMatrix) ProtoMessage()    {}
 func (*CompressedSparseRowMatrix) ProtoMessage()    {}
 func (*CompressedSparseRowMatrix) Descriptor() ([]byte, []int) {
 func (*CompressedSparseRowMatrix) Descriptor() ([]byte, []int) {
-	return fileDescriptor_pb_a943a983732e0793, []int{5}
+	return fileDescriptor_pb_07b4c5185d2fe6c6, []int{5}
 }
 }
 func (m *CompressedSparseRowMatrix) XXX_Unmarshal(b []byte) error {
 func (m *CompressedSparseRowMatrix) XXX_Unmarshal(b []byte) error {
 	return xxx_messageInfo_CompressedSparseRowMatrix.Unmarshal(m, b)
 	return xxx_messageInfo_CompressedSparseRowMatrix.Unmarshal(m, b)
@@ -440,7 +440,7 @@ func (m *Couples) Reset()         { *m = Couples{} }
 func (m *Couples) String() string { return proto.CompactTextString(m) }
 func (m *Couples) String() string { return proto.CompactTextString(m) }
 func (*Couples) ProtoMessage()    {}
 func (*Couples) ProtoMessage()    {}
 func (*Couples) Descriptor() ([]byte, []int) {
 func (*Couples) Descriptor() ([]byte, []int) {
-	return fileDescriptor_pb_a943a983732e0793, []int{6}
+	return fileDescriptor_pb_07b4c5185d2fe6c6, []int{6}
 }
 }
 func (m *Couples) XXX_Unmarshal(b []byte) error {
 func (m *Couples) XXX_Unmarshal(b []byte) error {
 	return xxx_messageInfo_Couples.Unmarshal(m, b)
 	return xxx_messageInfo_Couples.Unmarshal(m, b)
@@ -485,7 +485,7 @@ func (m *TouchedFiles) Reset()         { *m = TouchedFiles{} }
 func (m *TouchedFiles) String() string { return proto.CompactTextString(m) }
 func (m *TouchedFiles) String() string { return proto.CompactTextString(m) }
 func (*TouchedFiles) ProtoMessage()    {}
 func (*TouchedFiles) ProtoMessage()    {}
 func (*TouchedFiles) Descriptor() ([]byte, []int) {
 func (*TouchedFiles) Descriptor() ([]byte, []int) {
-	return fileDescriptor_pb_a943a983732e0793, []int{7}
+	return fileDescriptor_pb_07b4c5185d2fe6c6, []int{7}
 }
 }
 func (m *TouchedFiles) XXX_Unmarshal(b []byte) error {
 func (m *TouchedFiles) XXX_Unmarshal(b []byte) error {
 	return xxx_messageInfo_TouchedFiles.Unmarshal(m, b)
 	return xxx_messageInfo_TouchedFiles.Unmarshal(m, b)
@@ -528,7 +528,7 @@ func (m *CouplesAnalysisResults) Reset()         { *m = CouplesAnalysisResults{}
 func (m *CouplesAnalysisResults) String() string { return proto.CompactTextString(m) }
 func (m *CouplesAnalysisResults) String() string { return proto.CompactTextString(m) }
 func (*CouplesAnalysisResults) ProtoMessage()    {}
 func (*CouplesAnalysisResults) ProtoMessage()    {}
 func (*CouplesAnalysisResults) Descriptor() ([]byte, []int) {
 func (*CouplesAnalysisResults) Descriptor() ([]byte, []int) {
-	return fileDescriptor_pb_a943a983732e0793, []int{8}
+	return fileDescriptor_pb_07b4c5185d2fe6c6, []int{8}
 }
 }
 func (m *CouplesAnalysisResults) XXX_Unmarshal(b []byte) error {
 func (m *CouplesAnalysisResults) XXX_Unmarshal(b []byte) error {
 	return xxx_messageInfo_CouplesAnalysisResults.Unmarshal(m, b)
 	return xxx_messageInfo_CouplesAnalysisResults.Unmarshal(m, b)
@@ -591,7 +591,7 @@ func (m *UASTChange) Reset()         { *m = UASTChange{} }
 func (m *UASTChange) String() string { return proto.CompactTextString(m) }
 func (m *UASTChange) String() string { return proto.CompactTextString(m) }
 func (*UASTChange) ProtoMessage()    {}
 func (*UASTChange) ProtoMessage()    {}
 func (*UASTChange) Descriptor() ([]byte, []int) {
 func (*UASTChange) Descriptor() ([]byte, []int) {
-	return fileDescriptor_pb_a943a983732e0793, []int{9}
+	return fileDescriptor_pb_07b4c5185d2fe6c6, []int{9}
 }
 }
 func (m *UASTChange) XXX_Unmarshal(b []byte) error {
 func (m *UASTChange) XXX_Unmarshal(b []byte) error {
 	return xxx_messageInfo_UASTChange.Unmarshal(m, b)
 	return xxx_messageInfo_UASTChange.Unmarshal(m, b)
@@ -657,7 +657,7 @@ func (m *UASTChangesSaverResults) Reset()         { *m = UASTChangesSaverResults
 func (m *UASTChangesSaverResults) String() string { return proto.CompactTextString(m) }
 func (m *UASTChangesSaverResults) String() string { return proto.CompactTextString(m) }
 func (*UASTChangesSaverResults) ProtoMessage()    {}
 func (*UASTChangesSaverResults) ProtoMessage()    {}
 func (*UASTChangesSaverResults) Descriptor() ([]byte, []int) {
 func (*UASTChangesSaverResults) Descriptor() ([]byte, []int) {
-	return fileDescriptor_pb_a943a983732e0793, []int{10}
+	return fileDescriptor_pb_07b4c5185d2fe6c6, []int{10}
 }
 }
 func (m *UASTChangesSaverResults) XXX_Unmarshal(b []byte) error {
 func (m *UASTChangesSaverResults) XXX_Unmarshal(b []byte) error {
 	return xxx_messageInfo_UASTChangesSaverResults.Unmarshal(m, b)
 	return xxx_messageInfo_UASTChangesSaverResults.Unmarshal(m, b)
@@ -698,7 +698,7 @@ func (m *ShotnessRecord) Reset()         { *m = ShotnessRecord{} }
 func (m *ShotnessRecord) String() string { return proto.CompactTextString(m) }
 func (m *ShotnessRecord) String() string { return proto.CompactTextString(m) }
 func (*ShotnessRecord) ProtoMessage()    {}
 func (*ShotnessRecord) ProtoMessage()    {}
 func (*ShotnessRecord) Descriptor() ([]byte, []int) {
 func (*ShotnessRecord) Descriptor() ([]byte, []int) {
-	return fileDescriptor_pb_a943a983732e0793, []int{11}
+	return fileDescriptor_pb_07b4c5185d2fe6c6, []int{11}
 }
 }
 func (m *ShotnessRecord) XXX_Unmarshal(b []byte) error {
 func (m *ShotnessRecord) XXX_Unmarshal(b []byte) error {
 	return xxx_messageInfo_ShotnessRecord.Unmarshal(m, b)
 	return xxx_messageInfo_ShotnessRecord.Unmarshal(m, b)
@@ -757,7 +757,7 @@ func (m *ShotnessAnalysisResults) Reset()         { *m = ShotnessAnalysisResults
 func (m *ShotnessAnalysisResults) String() string { return proto.CompactTextString(m) }
 func (m *ShotnessAnalysisResults) String() string { return proto.CompactTextString(m) }
 func (*ShotnessAnalysisResults) ProtoMessage()    {}
 func (*ShotnessAnalysisResults) ProtoMessage()    {}
 func (*ShotnessAnalysisResults) Descriptor() ([]byte, []int) {
 func (*ShotnessAnalysisResults) Descriptor() ([]byte, []int) {
-	return fileDescriptor_pb_a943a983732e0793, []int{12}
+	return fileDescriptor_pb_07b4c5185d2fe6c6, []int{12}
 }
 }
 func (m *ShotnessAnalysisResults) XXX_Unmarshal(b []byte) error {
 func (m *ShotnessAnalysisResults) XXX_Unmarshal(b []byte) error {
 	return xxx_messageInfo_ShotnessAnalysisResults.Unmarshal(m, b)
 	return xxx_messageInfo_ShotnessAnalysisResults.Unmarshal(m, b)
@@ -796,7 +796,7 @@ func (m *FileHistory) Reset()         { *m = FileHistory{} }
 func (m *FileHistory) String() string { return proto.CompactTextString(m) }
 func (m *FileHistory) String() string { return proto.CompactTextString(m) }
 func (*FileHistory) ProtoMessage()    {}
 func (*FileHistory) ProtoMessage()    {}
 func (*FileHistory) Descriptor() ([]byte, []int) {
 func (*FileHistory) Descriptor() ([]byte, []int) {
-	return fileDescriptor_pb_a943a983732e0793, []int{13}
+	return fileDescriptor_pb_07b4c5185d2fe6c6, []int{13}
 }
 }
 func (m *FileHistory) XXX_Unmarshal(b []byte) error {
 func (m *FileHistory) XXX_Unmarshal(b []byte) error {
 	return xxx_messageInfo_FileHistory.Unmarshal(m, b)
 	return xxx_messageInfo_FileHistory.Unmarshal(m, b)
@@ -841,7 +841,7 @@ func (m *FileHistoryResultMessage) Reset()         { *m = FileHistoryResultMessa
 func (m *FileHistoryResultMessage) String() string { return proto.CompactTextString(m) }
 func (m *FileHistoryResultMessage) String() string { return proto.CompactTextString(m) }
 func (*FileHistoryResultMessage) ProtoMessage()    {}
 func (*FileHistoryResultMessage) ProtoMessage()    {}
 func (*FileHistoryResultMessage) Descriptor() ([]byte, []int) {
 func (*FileHistoryResultMessage) Descriptor() ([]byte, []int) {
-	return fileDescriptor_pb_a943a983732e0793, []int{14}
+	return fileDescriptor_pb_07b4c5185d2fe6c6, []int{14}
 }
 }
 func (m *FileHistoryResultMessage) XXX_Unmarshal(b []byte) error {
 func (m *FileHistoryResultMessage) XXX_Unmarshal(b []byte) error {
 	return xxx_messageInfo_FileHistoryResultMessage.Unmarshal(m, b)
 	return xxx_messageInfo_FileHistoryResultMessage.Unmarshal(m, b)
@@ -881,7 +881,7 @@ func (m *LineStats) Reset()         { *m = LineStats{} }
 func (m *LineStats) String() string { return proto.CompactTextString(m) }
 func (m *LineStats) String() string { return proto.CompactTextString(m) }
 func (*LineStats) ProtoMessage()    {}
 func (*LineStats) ProtoMessage()    {}
 func (*LineStats) Descriptor() ([]byte, []int) {
 func (*LineStats) Descriptor() ([]byte, []int) {
-	return fileDescriptor_pb_a943a983732e0793, []int{15}
+	return fileDescriptor_pb_07b4c5185d2fe6c6, []int{15}
 }
 }
 func (m *LineStats) XXX_Unmarshal(b []byte) error {
 func (m *LineStats) XXX_Unmarshal(b []byte) error {
 	return xxx_messageInfo_LineStats.Unmarshal(m, b)
 	return xxx_messageInfo_LineStats.Unmarshal(m, b)
@@ -935,7 +935,7 @@ func (m *DevTick) Reset()         { *m = DevTick{} }
 func (m *DevTick) String() string { return proto.CompactTextString(m) }
 func (m *DevTick) String() string { return proto.CompactTextString(m) }
 func (*DevTick) ProtoMessage()    {}
 func (*DevTick) ProtoMessage()    {}
 func (*DevTick) Descriptor() ([]byte, []int) {
 func (*DevTick) Descriptor() ([]byte, []int) {
-	return fileDescriptor_pb_a943a983732e0793, []int{16}
+	return fileDescriptor_pb_07b4c5185d2fe6c6, []int{16}
 }
 }
 func (m *DevTick) XXX_Unmarshal(b []byte) error {
 func (m *DevTick) XXX_Unmarshal(b []byte) error {
 	return xxx_messageInfo_DevTick.Unmarshal(m, b)
 	return xxx_messageInfo_DevTick.Unmarshal(m, b)
@@ -987,7 +987,7 @@ func (m *TickDevs) Reset()         { *m = TickDevs{} }
 func (m *TickDevs) String() string { return proto.CompactTextString(m) }
 func (m *TickDevs) String() string { return proto.CompactTextString(m) }
 func (*TickDevs) ProtoMessage()    {}
 func (*TickDevs) ProtoMessage()    {}
 func (*TickDevs) Descriptor() ([]byte, []int) {
 func (*TickDevs) Descriptor() ([]byte, []int) {
-	return fileDescriptor_pb_a943a983732e0793, []int{17}
+	return fileDescriptor_pb_07b4c5185d2fe6c6, []int{17}
 }
 }
 func (m *TickDevs) XXX_Unmarshal(b []byte) error {
 func (m *TickDevs) XXX_Unmarshal(b []byte) error {
 	return xxx_messageInfo_TickDevs.Unmarshal(m, b)
 	return xxx_messageInfo_TickDevs.Unmarshal(m, b)
@@ -1026,7 +1026,7 @@ func (m *DevsAnalysisResults) Reset()         { *m = DevsAnalysisResults{} }
 func (m *DevsAnalysisResults) String() string { return proto.CompactTextString(m) }
 func (m *DevsAnalysisResults) String() string { return proto.CompactTextString(m) }
 func (*DevsAnalysisResults) ProtoMessage()    {}
 func (*DevsAnalysisResults) ProtoMessage()    {}
 func (*DevsAnalysisResults) Descriptor() ([]byte, []int) {
 func (*DevsAnalysisResults) Descriptor() ([]byte, []int) {
-	return fileDescriptor_pb_a943a983732e0793, []int{18}
+	return fileDescriptor_pb_07b4c5185d2fe6c6, []int{18}
 }
 }
 func (m *DevsAnalysisResults) XXX_Unmarshal(b []byte) error {
 func (m *DevsAnalysisResults) XXX_Unmarshal(b []byte) error {
 	return xxx_messageInfo_DevsAnalysisResults.Unmarshal(m, b)
 	return xxx_messageInfo_DevsAnalysisResults.Unmarshal(m, b)
@@ -1073,7 +1073,7 @@ func (m *Sentiment) Reset()         { *m = Sentiment{} }
 func (m *Sentiment) String() string { return proto.CompactTextString(m) }
 func (m *Sentiment) String() string { return proto.CompactTextString(m) }
 func (*Sentiment) ProtoMessage()    {}
 func (*Sentiment) ProtoMessage()    {}
 func (*Sentiment) Descriptor() ([]byte, []int) {
 func (*Sentiment) Descriptor() ([]byte, []int) {
-	return fileDescriptor_pb_a943a983732e0793, []int{19}
+	return fileDescriptor_pb_07b4c5185d2fe6c6, []int{19}
 }
 }
 func (m *Sentiment) XXX_Unmarshal(b []byte) error {
 func (m *Sentiment) XXX_Unmarshal(b []byte) error {
 	return xxx_messageInfo_Sentiment.Unmarshal(m, b)
 	return xxx_messageInfo_Sentiment.Unmarshal(m, b)
@@ -1125,7 +1125,7 @@ func (m *CommentSentimentResults) Reset()         { *m = CommentSentimentResults
 func (m *CommentSentimentResults) String() string { return proto.CompactTextString(m) }
 func (m *CommentSentimentResults) String() string { return proto.CompactTextString(m) }
 func (*CommentSentimentResults) ProtoMessage()    {}
 func (*CommentSentimentResults) ProtoMessage()    {}
 func (*CommentSentimentResults) Descriptor() ([]byte, []int) {
 func (*CommentSentimentResults) Descriptor() ([]byte, []int) {
-	return fileDescriptor_pb_a943a983732e0793, []int{20}
+	return fileDescriptor_pb_07b4c5185d2fe6c6, []int{20}
 }
 }
 func (m *CommentSentimentResults) XXX_Unmarshal(b []byte) error {
 func (m *CommentSentimentResults) XXX_Unmarshal(b []byte) error {
 	return xxx_messageInfo_CommentSentimentResults.Unmarshal(m, b)
 	return xxx_messageInfo_CommentSentimentResults.Unmarshal(m, b)
@@ -1165,7 +1165,7 @@ func (m *CommitFile) Reset()         { *m = CommitFile{} }
 func (m *CommitFile) String() string { return proto.CompactTextString(m) }
 func (m *CommitFile) String() string { return proto.CompactTextString(m) }
 func (*CommitFile) ProtoMessage()    {}
 func (*CommitFile) ProtoMessage()    {}
 func (*CommitFile) Descriptor() ([]byte, []int) {
 func (*CommitFile) Descriptor() ([]byte, []int) {
-	return fileDescriptor_pb_a943a983732e0793, []int{21}
+	return fileDescriptor_pb_07b4c5185d2fe6c6, []int{21}
 }
 }
 func (m *CommitFile) XXX_Unmarshal(b []byte) error {
 func (m *CommitFile) XXX_Unmarshal(b []byte) error {
 	return xxx_messageInfo_CommitFile.Unmarshal(m, b)
 	return xxx_messageInfo_CommitFile.Unmarshal(m, b)
@@ -1220,7 +1220,7 @@ func (m *Commit) Reset()         { *m = Commit{} }
 func (m *Commit) String() string { return proto.CompactTextString(m) }
 func (m *Commit) String() string { return proto.CompactTextString(m) }
 func (*Commit) ProtoMessage()    {}
 func (*Commit) ProtoMessage()    {}
 func (*Commit) Descriptor() ([]byte, []int) {
 func (*Commit) Descriptor() ([]byte, []int) {
-	return fileDescriptor_pb_a943a983732e0793, []int{22}
+	return fileDescriptor_pb_07b4c5185d2fe6c6, []int{22}
 }
 }
 func (m *Commit) XXX_Unmarshal(b []byte) error {
 func (m *Commit) XXX_Unmarshal(b []byte) error {
 	return xxx_messageInfo_Commit.Unmarshal(m, b)
 	return xxx_messageInfo_Commit.Unmarshal(m, b)
@@ -1280,7 +1280,7 @@ func (m *CommitsAnalysisResults) Reset()         { *m = CommitsAnalysisResults{}
 func (m *CommitsAnalysisResults) String() string { return proto.CompactTextString(m) }
 func (m *CommitsAnalysisResults) String() string { return proto.CompactTextString(m) }
 func (*CommitsAnalysisResults) ProtoMessage()    {}
 func (*CommitsAnalysisResults) ProtoMessage()    {}
 func (*CommitsAnalysisResults) Descriptor() ([]byte, []int) {
 func (*CommitsAnalysisResults) Descriptor() ([]byte, []int) {
-	return fileDescriptor_pb_a943a983732e0793, []int{23}
+	return fileDescriptor_pb_07b4c5185d2fe6c6, []int{23}
 }
 }
 func (m *CommitsAnalysisResults) XXX_Unmarshal(b []byte) error {
 func (m *CommitsAnalysisResults) XXX_Unmarshal(b []byte) error {
 	return xxx_messageInfo_CommitsAnalysisResults.Unmarshal(m, b)
 	return xxx_messageInfo_CommitsAnalysisResults.Unmarshal(m, b)
@@ -1314,6 +1314,114 @@ func (m *CommitsAnalysisResults) GetAuthorIndex() []string {
 	return nil
 	return nil
 }
 }
 
 
+type Typo struct {
+	Wrong                string   `protobuf:"bytes,1,opt,name=wrong,proto3" json:"wrong,omitempty"`
+	Correct              string   `protobuf:"bytes,2,opt,name=correct,proto3" json:"correct,omitempty"`
+	Commit               string   `protobuf:"bytes,3,opt,name=commit,proto3" json:"commit,omitempty"`
+	File                 string   `protobuf:"bytes,4,opt,name=file,proto3" json:"file,omitempty"`
+	Line                 int32    `protobuf:"varint,5,opt,name=line,proto3" json:"line,omitempty"`
+	XXX_NoUnkeyedLiteral struct{} `json:"-"`
+	XXX_unrecognized     []byte   `json:"-"`
+	XXX_sizecache        int32    `json:"-"`
+}
+
+func (m *Typo) Reset()         { *m = Typo{} }
+func (m *Typo) String() string { return proto.CompactTextString(m) }
+func (*Typo) ProtoMessage()    {}
+func (*Typo) Descriptor() ([]byte, []int) {
+	return fileDescriptor_pb_07b4c5185d2fe6c6, []int{24}
+}
+func (m *Typo) XXX_Unmarshal(b []byte) error {
+	return xxx_messageInfo_Typo.Unmarshal(m, b)
+}
+func (m *Typo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+	return xxx_messageInfo_Typo.Marshal(b, m, deterministic)
+}
+func (dst *Typo) XXX_Merge(src proto.Message) {
+	xxx_messageInfo_Typo.Merge(dst, src)
+}
+func (m *Typo) XXX_Size() int {
+	return xxx_messageInfo_Typo.Size(m)
+}
+func (m *Typo) XXX_DiscardUnknown() {
+	xxx_messageInfo_Typo.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_Typo proto.InternalMessageInfo
+
+func (m *Typo) GetWrong() string {
+	if m != nil {
+		return m.Wrong
+	}
+	return ""
+}
+
+func (m *Typo) GetCorrect() string {
+	if m != nil {
+		return m.Correct
+	}
+	return ""
+}
+
+func (m *Typo) GetCommit() string {
+	if m != nil {
+		return m.Commit
+	}
+	return ""
+}
+
+func (m *Typo) GetFile() string {
+	if m != nil {
+		return m.File
+	}
+	return ""
+}
+
+func (m *Typo) GetLine() int32 {
+	if m != nil {
+		return m.Line
+	}
+	return 0
+}
+
+type TyposDataset struct {
+	Typos                []*Typo  `protobuf:"bytes,1,rep,name=typos,proto3" json:"typos,omitempty"`
+	XXX_NoUnkeyedLiteral struct{} `json:"-"`
+	XXX_unrecognized     []byte   `json:"-"`
+	XXX_sizecache        int32    `json:"-"`
+}
+
+func (m *TyposDataset) Reset()         { *m = TyposDataset{} }
+func (m *TyposDataset) String() string { return proto.CompactTextString(m) }
+func (*TyposDataset) ProtoMessage()    {}
+func (*TyposDataset) Descriptor() ([]byte, []int) {
+	return fileDescriptor_pb_07b4c5185d2fe6c6, []int{25}
+}
+func (m *TyposDataset) XXX_Unmarshal(b []byte) error {
+	return xxx_messageInfo_TyposDataset.Unmarshal(m, b)
+}
+func (m *TyposDataset) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+	return xxx_messageInfo_TyposDataset.Marshal(b, m, deterministic)
+}
+func (dst *TyposDataset) XXX_Merge(src proto.Message) {
+	xxx_messageInfo_TyposDataset.Merge(dst, src)
+}
+func (m *TyposDataset) XXX_Size() int {
+	return xxx_messageInfo_TyposDataset.Size(m)
+}
+func (m *TyposDataset) XXX_DiscardUnknown() {
+	xxx_messageInfo_TyposDataset.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_TyposDataset proto.InternalMessageInfo
+
+func (m *TyposDataset) GetTypos() []*Typo {
+	if m != nil {
+		return m.Typos
+	}
+	return nil
+}
+
 type AnalysisResults struct {
 type AnalysisResults struct {
 	Header *Metadata `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"`
 	Header *Metadata `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"`
 	// the mapped values are dynamic messages which require the second parsing pass.
 	// the mapped values are dynamic messages which require the second parsing pass.
@@ -1327,7 +1435,7 @@ func (m *AnalysisResults) Reset()         { *m = AnalysisResults{} }
 func (m *AnalysisResults) String() string { return proto.CompactTextString(m) }
 func (m *AnalysisResults) String() string { return proto.CompactTextString(m) }
 func (*AnalysisResults) ProtoMessage()    {}
 func (*AnalysisResults) ProtoMessage()    {}
 func (*AnalysisResults) Descriptor() ([]byte, []int) {
 func (*AnalysisResults) Descriptor() ([]byte, []int) {
-	return fileDescriptor_pb_a943a983732e0793, []int{24}
+	return fileDescriptor_pb_07b4c5185d2fe6c6, []int{26}
 }
 }
 func (m *AnalysisResults) XXX_Unmarshal(b []byte) error {
 func (m *AnalysisResults) XXX_Unmarshal(b []byte) error {
 	return xxx_messageInfo_AnalysisResults.Unmarshal(m, b)
 	return xxx_messageInfo_AnalysisResults.Unmarshal(m, b)
@@ -1395,106 +1503,113 @@ func init() {
 	proto.RegisterType((*CommitFile)(nil), "CommitFile")
 	proto.RegisterType((*CommitFile)(nil), "CommitFile")
 	proto.RegisterType((*Commit)(nil), "Commit")
 	proto.RegisterType((*Commit)(nil), "Commit")
 	proto.RegisterType((*CommitsAnalysisResults)(nil), "CommitsAnalysisResults")
 	proto.RegisterType((*CommitsAnalysisResults)(nil), "CommitsAnalysisResults")
+	proto.RegisterType((*Typo)(nil), "Typo")
+	proto.RegisterType((*TyposDataset)(nil), "TyposDataset")
 	proto.RegisterType((*AnalysisResults)(nil), "AnalysisResults")
 	proto.RegisterType((*AnalysisResults)(nil), "AnalysisResults")
 	proto.RegisterMapType((map[string][]byte)(nil), "AnalysisResults.ContentsEntry")
 	proto.RegisterMapType((map[string][]byte)(nil), "AnalysisResults.ContentsEntry")
 }
 }
 
 
-func init() { proto.RegisterFile("pb.proto", fileDescriptor_pb_a943a983732e0793) }
-
-var fileDescriptor_pb_a943a983732e0793 = []byte{
-	// 1501 bytes of a gzipped FileDescriptorProto
-	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x57, 0xdd, 0x6e, 0xdc, 0xc4,
-	0x17, 0x97, 0xf7, 0x7b, 0x8f, 0x37, 0x9b, 0x7f, 0xa6, 0xf9, 0x37, 0xee, 0xa2, 0xb4, 0x5b, 0x2b,
-	0x40, 0xa0, 0xd4, 0xad, 0x52, 0x55, 0x2a, 0xe5, 0x86, 0x64, 0x43, 0xd5, 0x48, 0xfd, 0x00, 0x27,
-	0x2d, 0xe2, 0xa6, 0x2b, 0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0x05, 0x7c, 0x97, 0x49, 0x90, 0xef, 0x58, 0xe0, 0xe7,
-	0x15, 0xc0, 0x48, 0x64, 0xc4, 0x0f, 0x62, 0xe5, 0xef, 0xf5, 0x00, 0x3a, 0xba, 0x83, 0xf5, 0x5d,
-	0xa5, 0xe5, 0xfc, 0xa4, 0x34, 0x2e, 0x39, 0x29, 0xf6, 0xf7, 0xd0, 0x92, 0xeb, 0x67, 0x4f, 0x29,
-	0xa3, 0xf0, 0x94, 0xda, 0x81, 0xfe, 0x62, 0x82, 0x8b, 0x2f, 0xa5, 0x9a, 0x78, 0xca, 0xf4, 0xb8,
-	0x36, 0x7b, 0x04, 0x5d, 0x85, 0x96, 0x97, 0x26, 0x93, 0x88, 0xaa, 0xe3, 0xac, 0x24, 0x74, 0xb3,
-	0xfc, 0xbf, 0x69, 0x3a, 0x79, 0x26, 0xfa, 0x07, 0xe4, 0x15, 0xff, 0xff, 0x10, 0x05, 0x5b, 0xed,
-	0xd8, 0x9b, 0xe5, 0x39, 0x6e, 0xee, 0xb5, 0x95, 0x7b, 0x3e, 0x07, 0x6e, 0x42, 0x4f, 0xee, 0x54,
-	0x6a, 0x50, 0x53, 0xea, 0x44, 0x8f, 0xda, 0x3f, 0x1b, 0xb0, 0xfe, 0xe6, 0xca, 0xad, 0x09, 0xf6,
-	0x02, 0x4c, 0x45, 0xaa, 0xbc, 0x31, 0xf5, 0x9b, 0xcb, 0x55, 0x06, 0xf4, 0x90, 0xb7, 0x1c, 0x49,
-	0xb2, 0x96, 0x33, 0xf7, 0xae, 0x3b, 0xab, 0xa7, 0x65, 0xa4, 0x00, 0xd9, 0x9d, 0x28, 0x45, 0x79,
-	0x27, 0x16, 0x4c, 0xff, 0xf6, 0x1a, 0xeb, 0x15, 0xca, 0x7d, 0xda, 0x12, 0xaf, 0xdf, 0x7b, 0xff,
-	0x04, 0x00, 0x00, 0xff, 0xff, 0xa3, 0x15, 0xf8, 0x6c, 0x09, 0x0f, 0x00, 0x00,
+func init() { proto.RegisterFile("pb.proto", fileDescriptor_pb_07b4c5185d2fe6c6) }
+
+var fileDescriptor_pb_07b4c5185d2fe6c6 = []byte{
+	// 1574 bytes of a gzipped FileDescriptorProto
+	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x57, 0xdd, 0x6e, 0xdb, 0xc6,
+	0x12, 0x06, 0xf5, 0xaf, 0x91, 0x2c, 0x1f, 0x6f, 0x7c, 0x62, 0x46, 0x81, 0x13, 0x85, 0xf0, 0x39,
+	0x75, 0x9b, 0x86, 0x09, 0x1c, 0x04, 0x48, 0xd3, 0x9b, 0xda, 0x72, 0x83, 0x18, 0xc8, 0x4f, 0x4b,
+	0x3b, 0x29, 0x7a, 0x13, 0x81, 0x26, 0xd7, 0x16, 0x1b, 0x69, 0x49, 0xec, 0x2e, 0x25, 0x0b, 0x68,
+	0x5f, 0xa5, 0x77, 0xbd, 0x29, 0xd0, 0xde, 0xf4, 0x15, 0x8a, 0x02, 0xbd, 0xed, 0x43, 0x14, 0xe8,
+	0x5b, 0x14, 0xfb, 0x47, 0x91, 0x0a, 0x9d, 0xa6, 0x77, 0x9c, 0x99, 0x6f, 0x76, 0x67, 0xbe, 0x99,
+	0x9d, 0x5d, 0x42, 0x2b, 0x39, 0x75, 0x13, 0x1a, 0xf3, 0xd8, 0xf9, 0xb3, 0x02, 0xad, 0x67, 0x98,
+	0xfb, 0xa1, 0xcf, 0x7d, 0x64, 0x43, 0x73, 0x86, 0x29, 0x8b, 0x62, 0x62, 0x5b, 0x03, 0x6b, 0xb7,
+	0xee, 0x19, 0x11, 0x21, 0xa8, 0x8d, 0x7d, 0x36, 0xb6, 0x2b, 0x03, 0x6b, 0xb7, 0xed, 0xc9, 0x6f,
+	0x74, 0x03, 0x80, 0xe2, 0x24, 0x66, 0x11, 0x8f, 0xe9, 0xc2, 0xae, 0x4a, 0x4b, 0x4e, 0x83, 0xfe,
+	0x0f, 0xeb, 0xa7, 0xf8, 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64, 0x8f, 0x3a, 0x33, 0xa8, 0x9d, 0x2c, 0x92, 0x58, 0x74, 0xd6,
+	0x9c, 0xc6, 0xe4, 0x5c, 0x67, 0xa7, 0x04, 0xd5, 0x3d, 0x94, 0x8a, 0x17, 0xb4, 0xba, 0x24, 0x8d,
+	0x28, 0x52, 0x52, 0xbb, 0x68, 0x4a, 0xb5, 0x94, 0xdd, 0x9f, 0xb5, 0xdc, 0xfd, 0x89, 0xa0, 0x26,
+	0xde, 0x24, 0xf2, 0xa6, 0xaf, 0x7b, 0xf2, 0xdb, 0xb9, 0x0d, 0x5d, 0xb1, 0x2f, 0x3b, 0xf4, 0xb9,
+	0xcf, 0x30, 0x47, 0xd7, 0xa1, 0xce, 0x85, 0xac, 0x73, 0xa9, 0xbb, 0xc2, 0xea, 0x29, 0x9d, 0xf3,
+	0x93, 0x05, 0xeb, 0x6f, 0xa7, 0xdf, 0x18, 0x63, 0x3f, 0xc4, 0x54, 0x46, 0x2c, 0x4e, 0x8f, 0xf9,
+	0x31, 0xf4, 0xb4, 0x01, 0x3d, 0x12, 0xe7, 0x82, 0xf0, 0xec, 0x5c, 0x74, 0xf6, 0x6e, 0xb8, 0xab,
+	0x47, 0x7a, 0xa8, 0x01, 0xd9, 0xc5, 0xad, 0x44, 0x75, 0x71, 0xe7, 0x4c, 0xff, 0xf4, 0xcb, 0xd8,
+	0xcd, 0xf5, 0xe4, 0x69, 0x43, 0xfe, 0xa2, 0xdf, 0xff, 0x3b, 0x00, 0x00, 0xff, 0xff, 0xb0, 0x4a,
+	0x70, 0x50, 0xae, 0x0f, 0x00, 0x00,
 }
 }

+ 12 - 0
internal/pb/pb.proto

@@ -165,6 +165,18 @@ message CommitsAnalysisResults {
     repeated string author_index = 2;
     repeated string author_index = 2;
 }
 }
 
 
+message Typo {
+    string wrong = 1;
+    string correct = 2;
+    string commit = 3;
+    string file = 4;
+    int32 line = 5;
+}
+
+message TyposDataset {
+    repeated Typo typos = 1;
+}
+
 message AnalysisResults {
 message AnalysisResults {
     Metadata header = 1;
     Metadata header = 1;
     // the mapped values are dynamic messages which require the second parsing pass.
     // the mapped values are dynamic messages which require the second parsing pass.

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 113 - 5
internal/pb/pb_pb2.py


+ 59 - 15
internal/plumbing/uast/uast.go

@@ -32,11 +32,12 @@ import (
 // It is a PipelineItem.
 // It is a PipelineItem.
 type Extractor struct {
 type Extractor struct {
 	core.NoopMerger
 	core.NoopMerger
-	Endpoint       string
-	Context        func() (context.Context, context.CancelFunc)
-	PoolSize       int
-	FailOnErrors   bool
-	ProcessedFiles map[string]int
+	Endpoint              string
+	Context               func() (context.Context, context.CancelFunc)
+	PoolSize              int
+	FailOnErrors          bool
+	ProcessedFiles        map[string]int
+	IgnoredMissingDrivers map[string]bool
 
 
 	clients []*bblfsh.Client
 	clients []*bblfsh.Client
 	pool    *tunny.Pool
 	pool    *tunny.Pool
@@ -45,22 +46,36 @@ type Extractor struct {
 const (
 const (
 	// ConfigUASTEndpoint is the name of the configuration option (Extractor.Configure())
 	// ConfigUASTEndpoint is the name of the configuration option (Extractor.Configure())
 	// which sets the Babelfish server address.
 	// which sets the Babelfish server address.
-	ConfigUASTEndpoint = "ConfigUASTEndpoint"
+	ConfigUASTEndpoint = "UAST.Endpoint"
 	// ConfigUASTTimeout is the name of the configuration option (Extractor.Configure())
 	// ConfigUASTTimeout is the name of the configuration option (Extractor.Configure())
 	// which sets the maximum amount of time to wait for a Babelfish server response.
 	// which sets the maximum amount of time to wait for a Babelfish server response.
-	ConfigUASTTimeout = "ConfigUASTTimeout"
+	ConfigUASTTimeout = "UAST.Timeout"
 	// ConfigUASTPoolSize is the name of the configuration option (Extractor.Configure())
 	// ConfigUASTPoolSize is the name of the configuration option (Extractor.Configure())
 	// which sets the number of goroutines to run for UAST parse queries.
 	// which sets the number of goroutines to run for UAST parse queries.
-	ConfigUASTPoolSize = "ConfigUASTPoolSize"
+	ConfigUASTPoolSize = "UAST.PoolSize"
 	// ConfigUASTFailOnErrors is the name of the configuration option (Extractor.Configure())
 	// ConfigUASTFailOnErrors is the name of the configuration option (Extractor.Configure())
 	// which enables early exit in case of any Babelfish UAST parsing errors.
 	// which enables early exit in case of any Babelfish UAST parsing errors.
-	ConfigUASTFailOnErrors = "ConfigUASTFailOnErrors"
+	ConfigUASTFailOnErrors = "UAST.FailOnErrors"
+	// ConfigUASTIgnoreMissingDrivers is the name of the configuration option (Extractor.Configure())
+	// which sets the ignored missing driver names.
+	ConfigUASTIgnoreMissingDrivers = "UAST.IgnoreMissingDrivers"
+	// DefaultBabelfishEndpoint is the default address of the Babelfish parsing server.
+	DefaultBabelfishEndpoint = "0.0.0.0:9432"
+	// DefaultBabelfishTimeout is the default value of the RPC timeout in seconds.
+	DefaultBabelfishTimeout = 20
 	// FeatureUast is the name of the Pipeline feature which activates all the items related to UAST.
 	// FeatureUast is the name of the Pipeline feature which activates all the items related to UAST.
 	FeatureUast = "uast"
 	FeatureUast = "uast"
 	// DependencyUasts is the name of the dependency provided by Extractor.
 	// DependencyUasts is the name of the dependency provided by Extractor.
 	DependencyUasts = "uasts"
 	DependencyUasts = "uasts"
 )
 )
 
 
+var (
+	// DefaultBabelfishWorkers is the default number of parsing RPC goroutines.
+	DefaultBabelfishWorkers = runtime.NumCPU() * 2
+	// DefaultIgnoredMissingDrivers is the languages which are ignored if the Babelfish driver is missing.
+	DefaultIgnoredMissingDrivers = []string{"markdown", "text", "yaml", "json"}
+)
+
 type uastTask struct {
 type uastTask struct {
 	Lock   *sync.RWMutex
 	Lock   *sync.RWMutex
 	Dest   map[plumbing.Hash]nodes.Node
 	Dest   map[plumbing.Hash]nodes.Node
@@ -117,22 +132,27 @@ func (exr *Extractor) ListConfigurationOptions() []core.ConfigurationOption {
 		Description: "How many days there are in a single band.",
 		Description: "How many days there are in a single band.",
 		Flag:        "bblfsh",
 		Flag:        "bblfsh",
 		Type:        core.StringConfigurationOption,
 		Type:        core.StringConfigurationOption,
-		Default:     "0.0.0.0:9432"}, {
+		Default:     DefaultBabelfishEndpoint}, {
 		Name:        ConfigUASTTimeout,
 		Name:        ConfigUASTTimeout,
 		Description: "Babelfish's server timeout in seconds.",
 		Description: "Babelfish's server timeout in seconds.",
 		Flag:        "bblfsh-timeout",
 		Flag:        "bblfsh-timeout",
 		Type:        core.IntConfigurationOption,
 		Type:        core.IntConfigurationOption,
-		Default:     20}, {
+		Default:     DefaultBabelfishTimeout}, {
 		Name:        ConfigUASTPoolSize,
 		Name:        ConfigUASTPoolSize,
 		Description: "Number of goroutines to extract UASTs.",
 		Description: "Number of goroutines to extract UASTs.",
 		Flag:        "bblfsh-pool-size",
 		Flag:        "bblfsh-pool-size",
 		Type:        core.IntConfigurationOption,
 		Type:        core.IntConfigurationOption,
-		Default:     runtime.NumCPU() * 2}, {
+		Default:     DefaultBabelfishWorkers}, {
 		Name:        ConfigUASTFailOnErrors,
 		Name:        ConfigUASTFailOnErrors,
 		Description: "Panic if there is a UAST extraction error.",
 		Description: "Panic if there is a UAST extraction error.",
 		Flag:        "bblfsh-fail-on-error",
 		Flag:        "bblfsh-fail-on-error",
 		Type:        core.BoolConfigurationOption,
 		Type:        core.BoolConfigurationOption,
-		Default:     false},
+		Default:     false}, {
+		Name:        ConfigUASTIgnoreMissingDrivers,
+		Description: "Do not warn about missing drivers for the specified languages.",
+		Flag:        "bblfsh-ignored-drivers",
+		Type:        core.StringsConfigurationOption,
+		Default:     DefaultIgnoredMissingDrivers},
 	}
 	}
 	return options[:]
 	return options[:]
 }
 }
@@ -154,6 +174,12 @@ func (exr *Extractor) Configure(facts map[string]interface{}) error {
 	if val, exists := facts[ConfigUASTFailOnErrors].(bool); exists {
 	if val, exists := facts[ConfigUASTFailOnErrors].(bool); exists {
 		exr.FailOnErrors = val
 		exr.FailOnErrors = val
 	}
 	}
+	if val, exists := facts[ConfigUASTIgnoreMissingDrivers].([]string); exists {
+		exr.IgnoredMissingDrivers = map[string]bool{}
+		for _, name := range val {
+			exr.IgnoredMissingDrivers[name] = true
+		}
+	}
 	return nil
 	return nil
 }
 }
 
 
@@ -162,9 +188,16 @@ func (exr *Extractor) Configure(facts map[string]interface{}) error {
 func (exr *Extractor) Initialize(repository *git.Repository) error {
 func (exr *Extractor) Initialize(repository *git.Repository) error {
 	if exr.Context == nil {
 	if exr.Context == nil {
 		exr.Context = func() (context.Context, context.CancelFunc) {
 		exr.Context = func() (context.Context, context.CancelFunc) {
-			return context.Background(), nil
+			return context.WithTimeout(context.Background(),
+				time.Duration(DefaultBabelfishTimeout)*time.Second)
 		}
 		}
 	}
 	}
+	if exr.Endpoint == "" {
+		exr.Endpoint = DefaultBabelfishEndpoint
+	}
+	if exr.PoolSize == 0 {
+		exr.PoolSize = DefaultBabelfishWorkers
+	}
 	poolSize := exr.PoolSize
 	poolSize := exr.PoolSize
 	if poolSize == 0 {
 	if poolSize == 0 {
 		poolSize = runtime.NumCPU()
 		poolSize = runtime.NumCPU()
@@ -196,6 +229,12 @@ func (exr *Extractor) Initialize(repository *git.Repository) error {
 		panic("UAST goroutine pool was not created")
 		panic("UAST goroutine pool was not created")
 	}
 	}
 	exr.ProcessedFiles = map[string]int{}
 	exr.ProcessedFiles = map[string]int{}
+	if exr.IgnoredMissingDrivers == nil {
+		exr.IgnoredMissingDrivers = map[string]bool{}
+		for _, name := range DefaultIgnoredMissingDrivers {
+			exr.IgnoredMissingDrivers[name] = true
+		}
+	}
 	return nil
 	return nil
 }
 }
 
 
@@ -250,7 +289,7 @@ func (exr *Extractor) Consume(deps map[string]interface{}) (map[string]interface
 		if exr.FailOnErrors {
 		if exr.FailOnErrors {
 			return nil, errors.New(joined)
 			return nil, errors.New(joined)
 		}
 		}
-		fmt.Fprintln(os.Stderr, joined)
+		log.Println(joined)
 	}
 	}
 	return map[string]interface{}{DependencyUasts: uasts}, nil
 	return map[string]interface{}{DependencyUasts: uasts}, nil
 }
 }
@@ -284,6 +323,11 @@ func (exr *Extractor) extractTask(client *bblfsh.Client, data interface{}) inter
 	task.Lock.Lock()
 	task.Lock.Lock()
 	defer task.Lock.Unlock()
 	defer task.Lock.Unlock()
 	if err != nil {
 	if err != nil {
+		for lang := range exr.IgnoredMissingDrivers {
+			if strings.HasSuffix(err.Error(), "\""+lang+"\"") {
+				return nil
+			}
+		}
 		*task.Errors = append(*task.Errors,
 		*task.Errors = append(*task.Errors,
 			fmt.Errorf("\nfile %s, blob %s: %v", task.Name, task.Hash.String(), err))
 			fmt.Errorf("\nfile %s, blob %s: %v", task.Name, task.Hash.String(), err))
 		return nil
 		return nil

+ 33 - 2
internal/plumbing/uast/uast_test.go

@@ -50,11 +50,12 @@ func TestUASTExtractorMeta(t *testing.T) {
 	assert.Equal(t, exr.Requires()[0], items.DependencyTreeChanges)
 	assert.Equal(t, exr.Requires()[0], items.DependencyTreeChanges)
 	assert.Equal(t, exr.Requires()[1], items.DependencyBlobCache)
 	assert.Equal(t, exr.Requires()[1], items.DependencyBlobCache)
 	opts := exr.ListConfigurationOptions()
 	opts := exr.ListConfigurationOptions()
-	assert.Len(t, opts, 4)
+	assert.Len(t, opts, 5)
 	assert.Equal(t, opts[0].Name, ConfigUASTEndpoint)
 	assert.Equal(t, opts[0].Name, ConfigUASTEndpoint)
 	assert.Equal(t, opts[1].Name, ConfigUASTTimeout)
 	assert.Equal(t, opts[1].Name, ConfigUASTTimeout)
 	assert.Equal(t, opts[2].Name, ConfigUASTPoolSize)
 	assert.Equal(t, opts[2].Name, ConfigUASTPoolSize)
 	assert.Equal(t, opts[3].Name, ConfigUASTFailOnErrors)
 	assert.Equal(t, opts[3].Name, ConfigUASTFailOnErrors)
+	assert.Equal(t, opts[4].Name, ConfigUASTIgnoreMissingDrivers)
 	feats := exr.Features()
 	feats := exr.Features()
 	assert.Len(t, feats, 1)
 	assert.Len(t, feats, 1)
 	assert.Equal(t, feats[0], FeatureUast)
 	assert.Equal(t, feats[0], FeatureUast)
@@ -68,11 +69,13 @@ func TestUASTExtractorConfiguration(t *testing.T) {
 	facts[ConfigUASTTimeout] = 15
 	facts[ConfigUASTTimeout] = 15
 	facts[ConfigUASTPoolSize] = 7
 	facts[ConfigUASTPoolSize] = 7
 	facts[ConfigUASTFailOnErrors] = true
 	facts[ConfigUASTFailOnErrors] = true
+	facts[ConfigUASTIgnoreMissingDrivers] = []string{"test"}
 	exr.Configure(facts)
 	exr.Configure(facts)
 	assert.Equal(t, exr.Endpoint, facts[ConfigUASTEndpoint])
 	assert.Equal(t, exr.Endpoint, facts[ConfigUASTEndpoint])
 	assert.NotNil(t, exr.Context)
 	assert.NotNil(t, exr.Context)
 	assert.Equal(t, exr.PoolSize, facts[ConfigUASTPoolSize])
 	assert.Equal(t, exr.PoolSize, facts[ConfigUASTPoolSize])
 	assert.Equal(t, exr.FailOnErrors, true)
 	assert.Equal(t, exr.FailOnErrors, true)
+	assert.Equal(t, exr.IgnoredMissingDrivers, map[string]bool{"test": true})
 }
 }
 
 
 func TestUASTExtractorRegistration(t *testing.T) {
 func TestUASTExtractorRegistration(t *testing.T) {
@@ -92,7 +95,7 @@ func TestUASTExtractorNoBabelfish(t *testing.T) {
 
 
 func TestUASTExtractorConsume(t *testing.T) {
 func TestUASTExtractorConsume(t *testing.T) {
 	exr := fixtureUASTExtractor()
 	exr := fixtureUASTExtractor()
-	changes := make(object.Changes, 3)
+	changes := make(object.Changes, 4)
 	// 2b1ed978194a94edeabbca6de7ff3b5771d4d665
 	// 2b1ed978194a94edeabbca6de7ff3b5771d4d665
 	treeFrom, _ := test.Repository.TreeObject(plumbing.NewHash(
 	treeFrom, _ := test.Repository.TreeObject(plumbing.NewHash(
 		"96c6ece9b2f3c7c51b83516400d278dea5605100"))
 		"96c6ece9b2f3c7c51b83516400d278dea5605100"))
@@ -136,6 +139,16 @@ func TestUASTExtractorConsume(t *testing.T) {
 		},
 		},
 	},
 	},
 	}
 	}
+	changes[3] = &object.Change{From: object.ChangeEntry{}, To: object.ChangeEntry{
+		Name: "README.md",
+		Tree: treeTo,
+		TreeEntry: object.TreeEntry{
+			Name: "README.md",
+			Mode: 0100644,
+			Hash: plumbing.NewHash("5248c86995f6d60eb57730da18b5e020a4341863"),
+		},
+	},
+	}
 	cache := map[plumbing.Hash]*items.CachedBlob{}
 	cache := map[plumbing.Hash]*items.CachedBlob{}
 	for _, hash := range []string{
 	for _, hash := range []string{
 		"baa64828831d174f40140e4b3cfa77d1e917a2c1",
 		"baa64828831d174f40140e4b3cfa77d1e917a2c1",
@@ -143,6 +156,7 @@ func TestUASTExtractorConsume(t *testing.T) {
 		"c29112dbd697ad9b401333b80c18a63951bc18d9",
 		"c29112dbd697ad9b401333b80c18a63951bc18d9",
 		"f7d918ec500e2f925ecde79b51cc007bac27de72",
 		"f7d918ec500e2f925ecde79b51cc007bac27de72",
 		"81f2b6d1fa5357f90e9dead150cd515720897545",
 		"81f2b6d1fa5357f90e9dead150cd515720897545",
+		"5248c86995f6d60eb57730da18b5e020a4341863",
 	} {
 	} {
 		AddHash(t, cache, hash)
 		AddHash(t, cache, hash)
 	}
 	}
@@ -158,6 +172,12 @@ func TestUASTExtractorConsume(t *testing.T) {
 	assert.Len(t, res[DependencyUasts], 1)
 	assert.Len(t, res[DependencyUasts], 1)
 	assert.Nil(t, err)
 	assert.Nil(t, err)
 
 
+	exr.FailOnErrors = true
+	res, err = exr.Consume(deps)
+	assert.Nil(t, res)
+	assert.NotNil(t, err)
+	exr.FailOnErrors = false
+
 	hash := plumbing.NewHash("5d78f57d732aed825764347ec6f3ab74d50d0619")
 	hash := plumbing.NewHash("5d78f57d732aed825764347ec6f3ab74d50d0619")
 	changes[1] = &object.Change{From: object.ChangeEntry{}, To: object.ChangeEntry{
 	changes[1] = &object.Change{From: object.ChangeEntry{}, To: object.ChangeEntry{
 		Name: "labours.py",
 		Name: "labours.py",
@@ -176,6 +196,17 @@ func TestUASTExtractorConsume(t *testing.T) {
 	uasts := res[DependencyUasts].(map[plumbing.Hash]nodes.Node)
 	uasts := res[DependencyUasts].(map[plumbing.Hash]nodes.Node)
 	assert.Equal(t, len(uasts), 1)
 	assert.Equal(t, len(uasts), 1)
 	assert.Equal(t, len(uasts[hash].(nodes.Object)["body"].(nodes.Array)), 24)
 	assert.Equal(t, len(uasts[hash].(nodes.Object)["body"].(nodes.Array)), 24)
+
+	exr.IgnoredMissingDrivers = map[string]bool{}
+	changes[2] = changes[3]
+	deps[items.DependencyTreeChanges] = changes[:3]
+	res, err = exr.Consume(deps)
+	assert.Nil(t, err)
+	exr.FailOnErrors = true
+	res, err = exr.Consume(deps)
+	assert.Nil(t, res)
+	assert.NotNil(t, err)
+	exr.FailOnErrors = false
 }
 }
 
 
 func TestUASTExtractorFork(t *testing.T) {
 func TestUASTExtractorFork(t *testing.T) {

+ 291 - 0
leaves/research/typos.go

@@ -0,0 +1,291 @@
+package research
+
+import (
+	"bytes"
+	"fmt"
+	"io"
+	"unicode/utf8"
+
+	"github.com/gogo/protobuf/proto"
+	"github.com/sergi/go-diff/diffmatchpatch"
+	"gopkg.in/bblfsh/sdk.v2/uast"
+	"gopkg.in/bblfsh/sdk.v2/uast/nodes"
+	"gopkg.in/src-d/go-git.v4"
+	"gopkg.in/src-d/go-git.v4/plumbing"
+	"gopkg.in/src-d/go-git.v4/plumbing/object"
+	"gopkg.in/src-d/hercules.v9/internal/core"
+	"gopkg.in/src-d/hercules.v9/internal/levenshtein"
+	"gopkg.in/src-d/hercules.v9/internal/pb"
+	items "gopkg.in/src-d/hercules.v9/internal/plumbing"
+	uast_items "gopkg.in/src-d/hercules.v9/internal/plumbing/uast"
+)
+
+// TyposDatasetBuilder collects pairs of typo-fix in source code identifiers.
+type TyposDatasetBuilder struct {
+	core.NoopMerger
+
+	// MaximumAllowedDistance is the maximum Levenshtein distance between two identifiers
+	// to consider them a typo-fix pair.
+	MaximumAllowedDistance int
+
+	// typos stores the found typo-fix pairs.
+	typos []Typo
+	// lcontext is the Context for measuring Levenshtein distance between lines.
+	lcontext *levenshtein.Context
+	// xpather filters identifiers.
+	xpather uast_items.ChangesXPather
+}
+
+// TyposResult is returned by TyposDatasetBuilder.Finalize() and carries the found typo-fix
+// pairs of identifiers.
+type TyposResult struct {
+	Typos []Typo
+}
+
+// Typo carries the information about a typo-fix pair.
+type Typo struct {
+	Wrong   string
+	Correct string
+	Commit  plumbing.Hash
+	File    string
+	Line    int
+}
+
+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"
+)
+
+// Name of this PipelineItem. Uniquely identifies the type, used for mapping keys, etc.
+func (tdb *TyposDatasetBuilder) Name() string {
+	return "TyposDataset"
+}
+
+// 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 (tdb *TyposDatasetBuilder) Provides() []string {
+	return []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.
+func (tdb *TyposDatasetBuilder) Requires() []string {
+	arr := [...]string{
+		uast_items.DependencyUastChanges, items.DependencyFileDiff, items.DependencyBlobCache}
+	return arr[:]
+}
+
+// ListConfigurationOptions returns the list of changeable public properties of this PipelineItem.
+func (tdb *TyposDatasetBuilder) ListConfigurationOptions() []core.ConfigurationOption {
+	options := [...]core.ConfigurationOption{{
+		Name: ConfigTyposDatasetMaximumAllowedDistance,
+		Description: "Maximum Levenshtein distance between two identifiers to consider them " +
+			"a typo-fix pair.",
+		Flag:    "typos-max-distance",
+		Type:    core.IntConfigurationOption,
+		Default: DefaultMaximumAllowedTypoDistance},
+	}
+	return options[:]
+}
+
+// Configure sets the properties previously published by ListConfigurationOptions().
+func (tdb *TyposDatasetBuilder) Configure(facts map[string]interface{}) error {
+	if val, exists := facts[ConfigTyposDatasetMaximumAllowedDistance].(int); exists {
+		tdb.MaximumAllowedDistance = val
+	}
+	return nil
+}
+
+// Flag for the command line switch which enables this analysis.
+func (tdb *TyposDatasetBuilder) Flag() string {
+	return "typos-dataset"
+}
+
+// Description returns the text which explains what the analysis is doing.
+func (tdb *TyposDatasetBuilder) Description() string {
+	return "Extracts typo-fix identifier pairs from source code in commit diffs."
+}
+
+// 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 (tdb *TyposDatasetBuilder) Initialize(repository *git.Repository) error {
+	if tdb.MaximumAllowedDistance <= 0 {
+		tdb.MaximumAllowedDistance = DefaultMaximumAllowedTypoDistance
+	}
+	tdb.lcontext = &levenshtein.Context{}
+	tdb.xpather.XPath = "//uast:Identifier"
+	return nil
+}
+
+type candidate struct {
+	Before int
+	After  int
+}
+
+// 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 (tdb *TyposDatasetBuilder) Consume(deps map[string]interface{}) (map[string]interface{}, error) {
+	if deps[core.DependencyIsMerge].(bool) {
+		return nil, nil
+	}
+	commit := deps[core.DependencyCommit].(*object.Commit).Hash
+	cache := deps[items.DependencyBlobCache].(map[plumbing.Hash]*items.CachedBlob)
+	diffs := deps[items.DependencyFileDiff].(map[string]items.FileDiffData)
+	changes := deps[uast_items.DependencyUastChanges].([]uast_items.Change)
+	for _, change := range changes {
+		if change.Before == nil || change.After == nil {
+			continue
+		}
+		linesBefore := bytes.Split(cache[change.Change.From.TreeEntry.Hash].Data, []byte{'\n'})
+		linesAfter := bytes.Split(cache[change.Change.To.TreeEntry.Hash].Data, []byte{'\n'})
+		diff := diffs[change.Change.To.Name]
+		var lineNumBefore, lineNumAfter int
+		clear := false
+		var candidates []candidate
+		focusedLinesBefore := map[int]bool{}
+		focusedLinesAfter := map[int]bool{}
+		for _, edit := range diff.Diffs {
+			size := utf8.RuneCountInString(edit.Text)
+			switch edit.Type {
+			case diffmatchpatch.DiffDelete:
+				lineNumBefore += size
+				clear = size == 1
+			case diffmatchpatch.DiffInsert:
+				if size == 1 && clear {
+					dist := tdb.lcontext.Distance(
+						string(linesBefore[lineNumBefore-1]),
+						string(linesAfter[lineNumAfter]))
+					if dist <= tdb.MaximumAllowedDistance {
+						candidates = append(candidates, candidate{lineNumBefore - 1, lineNumAfter})
+						focusedLinesBefore[lineNumBefore-1] = true
+						focusedLinesAfter[lineNumAfter] = true
+					}
+				}
+				lineNumAfter += size
+				clear = false
+			case diffmatchpatch.DiffEqual:
+				lineNumBefore += size
+				lineNumAfter += size
+				clear = false
+			}
+		}
+		if len(candidates) == 0 {
+			continue
+		}
+		// at this point we have pairs of very similar lines
+		// we need to build the line mappings of the identifiers before/after the change
+		// we should keep only those which are present on those focused lines
+		nodesAdded, nodesRemoved := tdb.xpather.Extract([]uast_items.Change{change})
+		addedIdentifiers := map[int][]nodes.Node{}
+		removedIdentifiers := map[int][]nodes.Node{}
+		for _, n := range nodesAdded {
+			pos := uast.PositionsOf(n.(nodes.Object))
+			if pos.Start() != nil {
+				line := int(pos.Start().Line) - 1
+				if focusedLinesAfter[line] {
+					addedIdentifiers[line] = append(addedIdentifiers[line], n)
+				}
+			}
+		}
+		for _, n := range nodesRemoved {
+			pos := uast.PositionsOf(n.(nodes.Object))
+			line := int(pos.Start().Line) - 1
+			if pos.Start() != nil {
+				if focusedLinesBefore[line] {
+					removedIdentifiers[line] = append(removedIdentifiers[line], n)
+				}
+			}
+		}
+		for _, c := range candidates {
+			nodesBefore := addedIdentifiers[c.Before]
+			nodesAfter := removedIdentifiers[c.After]
+			if len(nodesBefore) == 1 && len(nodesAfter) == 1 {
+				idBefore := string(nodesBefore[0].(nodes.Object)["Name"].(nodes.String))
+				idAfter := string(nodesAfter[0].(nodes.Object)["Name"].(nodes.String))
+				tdb.typos = append(tdb.typos, Typo{
+					Wrong:   idBefore,
+					Correct: idAfter,
+					Commit:  commit,
+					File:    change.Change.To.Name,
+					Line:    c.After,
+				})
+			}
+		}
+	}
+	return nil, nil
+}
+
+// Finalize returns the result of the analysis. Further Consume() calls are not expected.
+func (tdb *TyposDatasetBuilder) Finalize() interface{} {
+	// deduplicate
+	typos := make([]Typo, 0, len(tdb.typos))
+	pairs := map[string]bool{}
+	for _, t := range tdb.typos {
+		id := t.Wrong + "|" + t.Correct
+		if _, exists := pairs[id]; !exists {
+			pairs[id] = true
+			typos = append(typos, t)
+		}
+	}
+	return TyposResult{Typos: typos}
+}
+
+// Fork clones this pipeline item.
+func (tdb *TyposDatasetBuilder) Fork(n int) []core.PipelineItem {
+	return core.ForkSamePipelineItem(tdb, n)
+}
+
+// Serialize converts the analysis result as returned by Finalize() to text or bytes.
+// The text format is YAML and the bytes format is Protocol Buffers.
+func (tdb *TyposDatasetBuilder) Serialize(result interface{}, binary bool, writer io.Writer) error {
+	commitsResult := result.(TyposResult)
+	if binary {
+		return tdb.serializeBinary(&commitsResult, writer)
+	}
+	tdb.serializeText(&commitsResult, writer)
+	return nil
+}
+
+func (tdb *TyposDatasetBuilder) serializeText(result *TyposResult, writer io.Writer) {
+	for _, t := range result.Typos {
+		fmt.Fprintf(writer, "  - wrong: %s\n", t.Wrong)
+		fmt.Fprintf(writer, "    correct: %s\n", t.Correct)
+		fmt.Fprintf(writer, "    commit: %s\n", t.Commit.String())
+		fmt.Fprintf(writer, "    file: %s\n", t.File)
+		fmt.Fprintf(writer, "    line: %d\n", t.Line)
+	}
+}
+
+func (tdb *TyposDatasetBuilder) serializeBinary(result *TyposResult, writer io.Writer) error {
+	message := pb.TyposDataset{}
+	message.Typos = make([]*pb.Typo, len(result.Typos))
+	for i, t := range result.Typos {
+		message.Typos[i] = &pb.Typo{
+			Wrong:   t.Wrong,
+			Correct: t.Correct,
+			Commit:  t.Commit.String(),
+			File:    t.File,
+			Line:    int32(t.Line),
+		}
+	}
+	serialized, err := proto.Marshal(&message)
+	if err != nil {
+		return err
+	}
+	_, err = writer.Write(serialized)
+	return err
+}
+
+func init() {
+	core.Registry.Register(&TyposDatasetBuilder{})
+}

+ 210 - 0
leaves/research/typos_test.go

@@ -0,0 +1,210 @@
+// +build !disable_babelfish
+
+package research
+
+import (
+	"bytes"
+	"testing"
+
+	"github.com/gogo/protobuf/proto"
+	"github.com/stretchr/testify/assert"
+	"gopkg.in/src-d/go-git.v4/plumbing"
+	"gopkg.in/src-d/go-git.v4/plumbing/object"
+	"gopkg.in/src-d/hercules.v9/internal/core"
+	"gopkg.in/src-d/hercules.v9/internal/pb"
+	items "gopkg.in/src-d/hercules.v9/internal/plumbing"
+	uast_items "gopkg.in/src-d/hercules.v9/internal/plumbing/uast"
+	"gopkg.in/src-d/hercules.v9/internal/test"
+)
+
+func TestTyposDatasetMeta(t *testing.T) {
+	tdb := TyposDatasetBuilder{}
+	assert.Equal(t, tdb.Name(), "TyposDataset")
+	assert.Len(t, tdb.Provides(), 0)
+	required := [...]string{
+		uast_items.DependencyUastChanges, items.DependencyFileDiff, items.DependencyBlobCache}
+	for _, name := range required {
+		assert.Contains(t, tdb.Requires(), name)
+	}
+	opts := tdb.ListConfigurationOptions()
+	assert.Len(t, opts, 1)
+	assert.Equal(t, opts[0].Name, ConfigTyposDatasetMaximumAllowedDistance)
+	assert.Equal(t, opts[0].Type, core.IntConfigurationOption)
+	assert.Equal(t, tdb.Flag(), "typos-dataset")
+}
+
+func TestTyposDatasetRegistration(t *testing.T) {
+	summoned := core.Registry.Summon((&TyposDatasetBuilder{}).Name())
+	assert.Len(t, summoned, 1)
+	assert.Equal(t, summoned[0].Name(), "TyposDataset")
+	leaves := core.Registry.GetLeaves()
+	matched := false
+	for _, tp := range leaves {
+		if tp.Flag() == (&TyposDatasetBuilder{}).Flag() {
+			matched = true
+			break
+		}
+	}
+	assert.True(t, matched)
+}
+
+func TestTyposDatasetConfigure(t *testing.T) {
+	tdb := TyposDatasetBuilder{}
+	facts := map[string]interface{}{}
+	facts[ConfigTyposDatasetMaximumAllowedDistance] = 5
+	assert.Nil(t, tdb.Configure(facts))
+	assert.Equal(t, tdb.MaximumAllowedDistance, 5)
+	facts = map[string]interface{}{}
+	assert.Nil(t, tdb.Configure(facts))
+	assert.Equal(t, tdb.MaximumAllowedDistance, 5)
+}
+
+func AddHash(t *testing.T, cache map[plumbing.Hash]*items.CachedBlob, hash string) {
+	objhash := plumbing.NewHash(hash)
+	blob, err := test.Repository.BlobObject(objhash)
+	assert.Nil(t, err)
+	cb := &items.CachedBlob{Blob: *blob}
+	err = cb.Cache()
+	assert.Nil(t, err)
+	cache[objhash] = cb
+}
+
+func TestTyposDatasetConsume(t *testing.T) {
+	deps := map[string]interface{}{}
+	cache := map[plumbing.Hash]*items.CachedBlob{}
+	AddHash(t, cache, "b9a12fd144274c99c7c9a0a32a0268f8b36d2f2c")
+	AddHash(t, cache, "d5f8e61069136f3578457a3131800ede353527b8")
+	AddHash(t, cache, "75bb0a09fc01db55d7322f0fae523453edba7846")
+	deps[items.DependencyBlobCache] = cache
+	changes := make(object.Changes, 2)
+	treeFrom, _ := test.Repository.TreeObject(plumbing.NewHash(
+		"eac25f9126db00e38fa72a59d49773a84580d4ce"))
+	treeTo, _ := test.Repository.TreeObject(plumbing.NewHash(
+		"828467b465864b1f757dcec9a034be49030fc8b9"))
+	changes[0] = &object.Change{From: object.ChangeEntry{
+		Name: "file_test.go",
+		Tree: treeFrom,
+		TreeEntry: object.TreeEntry{
+			Name: "file_test.go",
+			Mode: 0100644,
+			Hash: plumbing.NewHash("75bb0a09fc01db55d7322f0fae523453edba7846"),
+		},
+	}, To: object.ChangeEntry{
+		Name: "file_test.go",
+		Tree: treeTo,
+		TreeEntry: object.TreeEntry{
+			Name: "file_test.go",
+			Mode: 0100644,
+			Hash: plumbing.NewHash("75bb0a09fc01db55d7322f0fae523453edba7846"),
+		},
+	}}
+	changes[1] = &object.Change{From: object.ChangeEntry{}, To: object.ChangeEntry{
+		Name: "blob_cache_test.go",
+		Tree: treeTo,
+		TreeEntry: object.TreeEntry{
+			Name: "blob_cache_test.go",
+			Mode: 0100644,
+			Hash: plumbing.NewHash("b9a12fd144274c99c7c9a0a32a0268f8b36d2f2c"),
+		},
+	},
+	}
+	deps[items.DependencyTreeChanges] = changes
+	deps[core.DependencyCommit], _ = test.Repository.CommitObject(plumbing.NewHash(
+		"84165d3b02647fae12cc026c7a580045246e8c98"))
+	deps[core.DependencyIsMerge] = false
+	uastItem := &uast_items.Extractor{}
+	assert.Nil(t, uastItem.Initialize(test.Repository))
+	uastResult, err := uastItem.Consume(deps)
+	assert.Nil(t, err)
+	deps[uast_items.DependencyUasts] = uastResult[uast_items.DependencyUasts]
+	uastChanges := &uast_items.Changes{}
+	assert.Nil(t, uastChanges.Initialize(test.Repository))
+	_, err = uastChanges.Consume(deps)
+	assert.Nil(t, err)
+	changes[0].To.TreeEntry.Hash = plumbing.NewHash("d5f8e61069136f3578457a3131800ede353527b8")
+	uastResult, err = uastItem.Consume(deps)
+	assert.Nil(t, err)
+	deps[uast_items.DependencyUasts] = uastResult[uast_items.DependencyUasts]
+	changesResult, err := uastChanges.Consume(deps)
+	assert.Nil(t, err)
+	deps[uast_items.DependencyUastChanges] = changesResult[uast_items.DependencyUastChanges]
+	fd := &items.FileDiff{}
+	assert.Nil(t, fd.Initialize(test.Repository))
+	diffResult, err := fd.Consume(deps)
+	assert.Nil(t, err)
+	deps[items.DependencyFileDiff] = diffResult[items.DependencyFileDiff]
+
+	tbd := &TyposDatasetBuilder{}
+	assert.Nil(t, tbd.Initialize(test.Repository))
+	res, err := tbd.Consume(deps)
+	assert.Nil(t, res)
+	assert.Nil(t, err)
+	assert.Len(t, tbd.typos, 4)
+	assert.Equal(t, tbd.typos[0].Wrong, "TestZeroInitializeFile")
+	assert.Equal(t, tbd.typos[0].Correct, "TestZeroInitialize")
+	assert.Equal(t, tbd.typos[0].Commit, plumbing.NewHash(
+		"84165d3b02647fae12cc026c7a580045246e8c98"))
+	assert.Equal(t, tbd.typos[0].File, "file_test.go")
+	assert.Equal(t, tbd.typos[0].Line, 74)
+
+	deps[core.DependencyIsMerge] = true
+	res, err = tbd.Consume(deps)
+	assert.Nil(t, res)
+	assert.Nil(t, err)
+	assert.Len(t, tbd.typos, 4)
+}
+
+func fixtureTyposDataset() *TyposDatasetBuilder {
+	tdb := TyposDatasetBuilder{}
+	tdb.Initialize(test.Repository)
+	tdb.typos = append(tdb.typos, Typo{
+		Wrong:   "Fo",
+		Correct: "Foo",
+		Commit:  plumbing.ZeroHash,
+		File:    "bar.go",
+		Line:    7,
+	})
+	return &tdb
+}
+
+func TestTyposDatasetFinalize(t *testing.T) {
+	tdb := fixtureTyposDataset()
+	tdb.typos = append(tdb.typos, tdb.typos[0])
+	x := tdb.Finalize().(TyposResult)
+	assert.Len(t, x.Typos, 1)
+	assert.Equal(t, x.Typos[0], Typo{
+		Wrong:   "Fo",
+		Correct: "Foo",
+		Commit:  plumbing.ZeroHash,
+		File:    "bar.go",
+		Line:    7,
+	})
+}
+
+func TestTyposDatasetSerialize(t *testing.T) {
+	ca := fixtureTyposDataset()
+	res := ca.Finalize().(TyposResult)
+	buffer := &bytes.Buffer{}
+	err := ca.Serialize(res, false, buffer)
+	assert.Nil(t, err)
+	assert.Equal(t, `  - wrong: Fo
+    correct: Foo
+    commit: 0000000000000000000000000000000000000000
+    file: bar.go
+    line: 7
+`, buffer.String())
+
+	buffer = &bytes.Buffer{}
+	err = ca.Serialize(res, true, buffer)
+	assert.Nil(t, err)
+	msg := pb.TyposDataset{}
+	assert.Nil(t, proto.Unmarshal(buffer.Bytes(), &msg))
+	assert.Len(t, msg.Typos, 1)
+	assert.Equal(t, *msg.Typos[0], pb.Typo{
+		Wrong:   "Fo",
+		Correct: "Foo",
+		Commit:  "0000000000000000000000000000000000000000",
+		File:    "bar.go",
+		Line:    7,
+	})
+}