Преглед изворни кода

v6: PipelineItem interface changed

- Configure() and Initialize() return errors
- handle invalid identity paths gracefully
- handle errors gracefully

Signed-off-by: Vadim Markovtsev <vadim@sourced.tech>
Vadim Markovtsev пре 6 година
родитељ
комит
4aa4fb125b
51 измењених фајлова са 346 додато и 225 уклоњено
  1. 5 5
      .appveyor.yml
  2. 8 8
      .travis.yml
  3. 4 4
      Dockerfile
  4. 2 4
      Gopkg.lock
  5. 1 1
      Gopkg.toml
  6. 2 2
      Makefile
  7. 3 3
      README.md
  8. 2 2
      cmd/hercules/combine.go
  9. 5 3
      cmd/hercules/plugin.template
  10. 8 5
      cmd/hercules/root.go
  11. 5 3
      contrib/_plugin_example/churn_analysis.go
  12. 6 6
      core.go
  13. 2 2
      internal/burndown/file.go
  14. 1 1
      internal/burndown/file_test.go
  15. 1 1
      internal/core/forks.go
  16. 6 3
      internal/core/forks_test.go
  17. 15 8
      internal/core/pipeline.go
  18. 46 15
      internal/core/pipeline_test.go
  19. 11 5
      internal/core/registry_test.go
  20. 4 4
      internal/global_test.go
  21. 6 4
      internal/plumbing/blob_cache.go
  22. 3 3
      internal/plumbing/blob_cache_test.go
  23. 5 3
      internal/plumbing/day.go
  24. 2 2
      internal/plumbing/day_test.go
  25. 8 4
      internal/plumbing/diff.go
  26. 6 6
      internal/plumbing/diff_test.go
  27. 14 6
      internal/plumbing/identity/identity.go
  28. 8 2
      internal/plumbing/identity/identity_test.go
  29. 6 4
      internal/plumbing/renames.go
  30. 2 2
      internal/plumbing/renames_test.go
  31. 5 3
      internal/plumbing/tree_diff.go
  32. 2 2
      internal/plumbing/tree_diff_test.go
  33. 2 2
      internal/plumbing/uast/changes_xpather_test.go
  34. 7 4
      internal/plumbing/uast/diff_refiner.go
  35. 3 3
      internal/plumbing/uast/diff_refiner_test.go
  36. 2 2
      internal/plumbing/uast/test/utils.go
  37. 16 9
      internal/plumbing/uast/uast.go
  38. 4 4
      internal/plumbing/uast/uast_test.go
  39. 2 2
      internal/test/fixtures/fixtures.go
  40. 16 8
      leaves/burndown.go
  41. 22 6
      leaves/burndown_test.go
  42. 8 6
      leaves/comment_sentiment.go
  43. 6 6
      leaves/comment_sentiment_test.go
  44. 9 7
      leaves/couples.go
  45. 5 5
      leaves/couples_test.go
  46. 9 7
      leaves/devs.go
  47. 6 6
      leaves/devs_test.go
  48. 7 5
      leaves/file_history.go
  49. 4 4
      leaves/file_history_test.go
  50. 8 6
      leaves/shotness.go
  51. 6 7
      leaves/shotness_test.go

+ 5 - 5
.appveyor.yml

@@ -2,7 +2,7 @@ version: "{build}"
 platform: x64
 image: Visual Studio 2017
 
-clone_folder: c:\gopath\src\gopkg.in\src-d\hercules.v5
+clone_folder: c:\gopath\src\gopkg.in\src-d\hercules.v6
 
 environment:
   GOPATH: c:\gopath
@@ -16,14 +16,14 @@ build_script:
   - go version
   - set PATH=C:\mingw-w64\x86_64-7.2.0-posix-seh-rt_v5-rev1\mingw64\bin;C:\msys64\usr\bin;C:\msys64\mingw64\bin;%GOPATH%\bin;%PATH%
   - set PATH=%PATH:C:\Program Files\Git\usr\bin;=%
-  - cd %GOPATH%\src\gopkg.in\src-d\hercules.v5
+  - cd %GOPATH%\src\gopkg.in\src-d\hercules.v6
   - go get -v github.com/golang/dep/cmd/dep
   - make
-  - 7z a c:\gopath\src\gopkg.in\src-d\hercules.v5\hercules.win64.zip %GOPATH%\bin\hercules.exe
+  - 7z a c:\gopath\src\gopkg.in\src-d\hercules.v6\hercules.win64.zip %GOPATH%\bin\hercules.exe
 
 test_script:
-  - go get -v -t -d gopkg.in/src-d/hercules.v5/...
-  - go test -v -tags disable_babelfish gopkg.in/src-d/hercules.v5/...
+  - go get -v -t -d gopkg.in/src-d/hercules.v6/...
+  - go test -v -tags disable_babelfish gopkg.in/src-d/hercules.v6/...
 
 artifacts:
   - name: hercules.win64.zip

+ 8 - 8
.travis.yml

@@ -5,7 +5,7 @@ git:
   depth: 9999999
 
 language: go
-go_import_path: gopkg.in/src-d/hercules.v5
+go_import_path: gopkg.in/src-d/hercules.v6
 go:
 - 1.10.x
 - 1.11.x
@@ -24,10 +24,10 @@ cache:
     - $HOME/gopath/src
 before_cache:
   - cd $HOME/gopath
-  - mv $HOME/gopath/src/gopkg.in/src-d/hercules.v5/vendor $HOME/gopath/src/gopkg.in/src-d/.vendor
-  - rm -rf $HOME/gopath/src/gopkg.in/src-d/hercules.v5
-  - mkdir $HOME/gopath/src/gopkg.in/src-d/hercules.v5
-  - mv $HOME/gopath/src/gopkg.in/src-d/.vendor $HOME/gopath/src/gopkg.in/src-d/hercules.v5/vendor
+  - mv $HOME/gopath/src/gopkg.in/src-d/hercules.v6/vendor $HOME/gopath/src/gopkg.in/src-d/.vendor
+  - rm -rf $HOME/gopath/src/gopkg.in/src-d/hercules.v6
+  - mkdir $HOME/gopath/src/gopkg.in/src-d/hercules.v6
+  - mv $HOME/gopath/src/gopkg.in/src-d/.vendor $HOME/gopath/src/gopkg.in/src-d/hercules.v6/vendor
 
 matrix:
   fast_finish: true
@@ -69,7 +69,7 @@ script:
   - go vet -tags tensorflow ./...
   - golint -set_exit_status $(go list ./... | grep -v /vendor/)
   - flake8
-  - go test -coverpkg=all -v -coverprofile=coverage.txt -covermode=count gopkg.in/src-d/hercules.v5/... && sed -i '/cmd\/hercules\|core.go/d' coverage.txt
+  - go test -coverpkg=all -v -coverprofile=coverage.txt -covermode=count gopkg.in/src-d/hercules.v6/... && sed -i '/cmd\/hercules\|core.go/d' coverage.txt
   - $GOPATH/bin/hercules version
   - $GOPATH/bin/hercules --burndown --couples --devs --quiet --pb https://github.com/src-d/hercules > 1.pb
   - cp 1.pb 2.pb
@@ -95,7 +95,7 @@ jobs:
       os: osx
       osx_image: xcode9.3
       go: 1.11.x
-      go_import_path: gopkg.in/src-d/hercules.v5
+      go_import_path: gopkg.in/src-d/hercules.v6
       before_install:
         - wget -O protoc.zip https://github.com/google/protobuf/releases/download/v$PROTOC_VERSION/protoc-$PROTOC_VERSION-osx-x86_64.zip
         - unzip -d ~/.local protoc.zip && rm protoc.zip
@@ -117,7 +117,7 @@ jobs:
     - stage: deploy
       os: linux
       go: 1.11.x
-      go_import_path: gopkg.in/src-d/hercules.v5
+      go_import_path: gopkg.in/src-d/hercules.v6
       before_install:
         - wget -O protoc.zip https://github.com/google/protobuf/releases/download/v$PROTOC_VERSION/protoc-$PROTOC_VERSION-linux-x86_64.zip
         - unzip -d ~/.local protoc.zip && rm protoc.zip

+ 4 - 4
Dockerfile

@@ -3,7 +3,7 @@ FROM ubuntu:18.04
 ENV GOPATH /root
 ENV PROTOBUF_VERSION 3.5.1
 
-COPY . /root/src/gopkg.in/src-d/hercules.v5
+COPY . /root/src/gopkg.in/src-d/hercules.v6
 RUN apt-get update && \
     apt-get install -y --no-install-suggests --no-install-recommends software-properties-common && \
     add-apt-repository -y ppa:gophers/archive && \
@@ -14,13 +14,13 @@ RUN apt-get update && \
     locale-gen en_US.UTF-8 && \
     export PATH=/usr/lib/go-1.10/bin:/root/bin:$PATH && \
     go get -v github.com/golang/dep/cmd/dep && \
-    cd /root/src/gopkg.in/src-d/hercules.v5 && \
+    cd /root/src/gopkg.in/src-d/hercules.v6 && \
     export CGO_CXXFLAGS=-std=c++14 && \
     curl -L "https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-cpu-$(go env GOOS)-x86_64-1.7.0.tar.gz" | tar -C /usr/local -xz && \
     make && \
     rm /usr/local/bin/protoc && rm /usr/local/readme.txt && rm -rf /usr/local/include/google && \
     cp /root/bin/hercules /usr/local/bin && \
-    cp -r /root/src/gopkg.in/src-d/hercules.v5/*.py /root/src/gopkg.in/src-d/hercules.v5/internal /usr/local/bin && \
+    cp -r /root/src/gopkg.in/src-d/hercules.v6/*.py /root/src/gopkg.in/src-d/hercules.v6/internal /usr/local/bin && \
     sed -i 's/parser.add_argument("--backend",/parser.add_argument("--backend", default="Agg",/' /usr/local/bin/labours.py && \
     echo '#!/bin/bash\n\
 \n\
@@ -30,7 +30,7 @@ echo\n\' > /browser && \
     chmod +x /browser && \
     curl https://bootstrap.pypa.io/get-pip.py | python3 && \
     pip3 install --no-cache-dir --no-build-isolation cython && \
-    pip3 install --no-cache-dir --no-build-isolation -r /root/src/gopkg.in/src-d/hercules.v5/requirements.txt https://github.com/mind/wheels/releases/download/tf1.7-cpu/tensorflow-1.7.0-cp36-cp36m-linux_x86_64.whl && \
+    pip3 install --no-cache-dir --no-build-isolation -r /root/src/gopkg.in/src-d/hercules.v6/requirements.txt https://github.com/mind/wheels/releases/download/tf1.7-cpu/tensorflow-1.7.0-cp36-cp36m-linux_x86_64.whl && \
     rm -rf /root/* && \
     apt-get remove -y software-properties-common golang-1.10-go python3-dev libyaml-dev libxml2-dev curl git make unzip g++ && \
     apt-get remove -y *-doc *-man && \

+ 2 - 4
Gopkg.lock

@@ -213,7 +213,6 @@
   version = "v1.0.0"
 
 [[projects]]
-  branch = "master"
   digest = "1:d0d418e1c02e6fc00259ef09d0d4f5135fc6aedac356ff0a11f4e5ef0c447270"
   name = "github.com/sergi/go-diff"
   packages = ["diffmatchpatch"]
@@ -250,12 +249,11 @@
   revision = "f187355171c936ac84a82793659ebb4936bc1c23"
 
 [[projects]]
-  branch = "master"
-  digest = "1:b566bbc018497ffb47060cab752ed1b899dea649c9cf1c6b54ae13b4f81f4d10"
+  digest = "1:e7e3141ecc5f7eeae9a1a4438044614049ccdd57a302b8793dec0c29202cadce"
   name = "github.com/stretchr/testify"
   packages = ["assert"]
   pruneopts = "UT"
-  revision = "4d4bfba8f1d1027c4fdbe371823030df51419987"
+  revision = "5b93e2dc01fd8fbf32aa74a198b0ebe78f6f6b6f"
 
 [[projects]]
   branch = "master"

+ 1 - 1
Gopkg.toml

@@ -43,7 +43,7 @@
   version = "1.0.2"
 
 [[constraint]]
-  branch = "master"
+  revision = "5b93e2dc01fd8fbf32aa74a198b0ebe78f6f6b6f"
   name = "github.com/stretchr/testify"
 
 [[constraint]]

+ 2 - 2
Makefile

@@ -11,7 +11,7 @@ BBLFSH_DEP =
 all: ${GOPATH}/bin/hercules${EXE}
 
 test: all
-	go test gopkg.in/src-d/hercules.v5
+	go test gopkg.in/src-d/hercules.v6
 
 ${GOPATH}/bin/protoc-gen-gogo${EXE}:
 	go get -v github.com/gogo/protobuf/protoc-gen-gogo
@@ -42,4 +42,4 @@ vendor/gopkg.in/bblfsh/client-go.v2/tools/include:
 endif
 
 ${GOPATH}/bin/hercules${EXE}: vendor *.go */*.go */*/*.go */*/*/*.go internal/pb/pb.pb.go internal/pb/pb_pb2.py cmd/hercules/plugin_template_source.go ${BBLFSH_DEP}
-	go get -tags "$(TAGS)" -ldflags "-X gopkg.in/src-d/hercules.v5.BinaryGitHash=$(shell git rev-parse HEAD)" gopkg.in/src-d/hercules.v5/cmd/hercules
+	go get -tags "$(TAGS)" -ldflags "-X gopkg.in/src-d/hercules.v6.BinaryGitHash=$(shell git rev-parse HEAD)" gopkg.in/src-d/hercules.v6/cmd/hercules

+ 3 - 3
README.md

@@ -4,7 +4,7 @@
 <h1 align="center">Hercules</h1>
 <p align="center">
       Fast, insightful and highly customizable Git history analysis.<br><br>
-      <a href="http://godoc.org/gopkg.in/src-d/hercules.v5"><img src="https://godoc.org/gopkg.in/src-d/hercules.v5?status.svg" alt="GoDoc"></a>
+      <a href="http://godoc.org/gopkg.in/src-d/hercules.v6"><img src="https://godoc.org/gopkg.in/src-d/hercules.v6?status.svg" alt="GoDoc"></a>
       <a href="https://travis-ci.org/src-d/hercules"><img src="https://travis-ci.org/src-d/hercules.svg?branch=master" alt="Travis build Status"></a>
       <a href="https://ci.appveyor.com/project/vmarkovtsev/hercules"><img src="https://ci.appveyor.com/api/projects/status/49f0lm3v2y6xyph3?svg=true" alt="AppVeyor build status"></a>
       <a href="https://hub.docker.com/r/srcd/hercules"><img src="https://img.shields.io/docker/build/srcd/hercules.svg" alt="Docker build status"></a>
@@ -59,8 +59,8 @@ Numpy and Scipy can be installed on Windows using http://www.lfd.uci.edu/~gohlke
 You are going to need Go (>= v1.10), [`protoc`](https://github.com/google/protobuf/releases),
 and [`dep`](https://github.com/golang/dep).
 ```
-go get -d gopkg.in/src-d/hercules.v5/cmd/hercules
-cd $GOPATH/src/gopkg.in/src-d/hercules.v5
+go get -d gopkg.in/src-d/hercules.v6/cmd/hercules
+cd $GOPATH/src/gopkg.in/src-d/hercules.v6
 make
 ```
 

+ 2 - 2
cmd/hercules/combine.go

@@ -12,8 +12,8 @@ import (
 
 	"github.com/gogo/protobuf/proto"
 	"github.com/spf13/cobra"
-	"gopkg.in/src-d/hercules.v5"
-	"gopkg.in/src-d/hercules.v5/internal/pb"
+	"gopkg.in/src-d/hercules.v6"
+	"gopkg.in/src-d/hercules.v6/internal/pb"
 )
 
 // combineCmd represents the combine command

+ 5 - 3
cmd/hercules/plugin.template

@@ -24,7 +24,7 @@ import (
 
   "github.com/gogo/protobuf/proto"
   "gopkg.in/src-d/go-git.v4"
-  "gopkg.in/src-d/hercules.v5"
+  "gopkg.in/src-d/hercules.v6"
 )
 
 // {{.name}} contains the intermediate state which is mutated by Consume(). It should implement
@@ -80,12 +80,14 @@ func ({{.varname}} *{{.name}}) Description() string {
 }
 
 // Configure applies the parameters specified in the command line. Map keys correspond to "Name".
-func ({{.varname}} *{{.name}}) Configure(facts map[string]interface{}) {
+func ({{.varname}} *{{.name}}) Configure(facts map[string]interface{}) error {
+  return nil
 }
 
 // Initialize resets the internal temporary data structures and prepares the object for Consume().
-func ({{.varname}} *{{.name}}) Initialize(repository *git.Repository) {
+func ({{.varname}} *{{.name}}) Initialize(repository *git.Repository) error {
   {{.varname}}.OneShotMergeProcessor.Initialize()
+  return nil
 }
 
 // Consume is called for every commit in the sequence.

+ 8 - 5
cmd/hercules/root.go

@@ -34,8 +34,8 @@ import (
 	"gopkg.in/src-d/go-git.v4/storage"
 	"gopkg.in/src-d/go-git.v4/storage/filesystem"
 	"gopkg.in/src-d/go-git.v4/storage/memory"
-	"gopkg.in/src-d/hercules.v5"
-	"gopkg.in/src-d/hercules.v5/internal/pb"
+	"gopkg.in/src-d/hercules.v6"
+	"gopkg.in/src-d/hercules.v6/internal/pb"
 )
 
 // oneLineWriter splits the output data by lines and outputs one on top of another using '\r'.
@@ -223,7 +223,7 @@ targets can be added using the --plugin system.`,
 			commits, err = hercules.LoadCommitsFromFile(commitsFile, repository)
 		}
 		if err != nil {
-			log.Panicf("failed to list the commits: %v", err)
+			log.Fatalf("failed to list the commits: %v", err)
 		}
 		cmdlineFacts[hercules.ConfigPipelineCommits] = commits
 		var deployed []hercules.LeafPipelineItem
@@ -233,13 +233,16 @@ targets can be added using the --plugin system.`,
 				deployed = append(deployed, item.(hercules.LeafPipelineItem))
 			}
 		}
-		pipeline.Initialize(cmdlineFacts)
+		err = pipeline.Initialize(cmdlineFacts)
+		if err != nil {
+			log.Fatal(err)
+		}
 		if dryRun, _ := cmdlineFacts[hercules.ConfigPipelineDryRun].(bool); dryRun {
 			return
 		}
 		results, err := pipeline.Run(commits)
 		if err != nil {
-			panic(err)
+			log.Fatalf("failed to run the pipeline: %v", err)
 		}
 		if !disableStatus {
 			fmt.Fprint(os.Stderr, "\r"+strings.Repeat(" ", 80)+"\r")

+ 5 - 3
contrib/_plugin_example/churn_analysis.go

@@ -13,7 +13,7 @@ import (
 	"gopkg.in/src-d/go-git.v4/plumbing"
 	"gopkg.in/src-d/go-git.v4/plumbing/object"
 	"gopkg.in/src-d/go-git.v4/utils/merkletrie"
-	"gopkg.in/src-d/hercules.v5"
+	"gopkg.in/src-d/hercules.v6"
 )
 
 // ChurnAnalysis contains the intermediate state which is mutated by Consume(). It should implement
@@ -104,20 +104,22 @@ func (churn *ChurnAnalysis) Description() string {
 }
 
 // Configure applies the parameters specified in the command line. Map keys correspond to "Name".
-func (churn *ChurnAnalysis) Configure(facts map[string]interface{}) {
+func (churn *ChurnAnalysis) Configure(facts map[string]interface{}) error {
 	if val, exists := facts[ConfigChurnTrackPeople].(bool); exists {
 		churn.TrackPeople = val
 	}
 	if churn.TrackPeople {
 		churn.reversedPeopleDict = facts[hercules.FactIdentityDetectorReversedPeopleDict].([]string)
 	}
+	return nil
 }
 
 // Initialize resets the internal temporary data structures and prepares the object for Consume().
-func (churn *ChurnAnalysis) Initialize(repository *git.Repository) {
+func (churn *ChurnAnalysis) Initialize(repository *git.Repository) error {
 	churn.global = []editInfo{}
 	churn.people = map[int][]editInfo{}
 	churn.OneShotMergeProcessor.Initialize()
+	return nil
 }
 
 func (churn *ChurnAnalysis) Consume(deps map[string]interface{}) (map[string]interface{}, error) {

+ 6 - 6
core.go

@@ -3,12 +3,12 @@ package hercules
 import (
 	"gopkg.in/src-d/go-git.v4"
 	"gopkg.in/src-d/go-git.v4/plumbing/object"
-	"gopkg.in/src-d/hercules.v5/internal/core"
-	"gopkg.in/src-d/hercules.v5/internal/plumbing"
-	"gopkg.in/src-d/hercules.v5/internal/plumbing/identity"
-	"gopkg.in/src-d/hercules.v5/internal/plumbing/uast"
-	"gopkg.in/src-d/hercules.v5/internal/yaml"
-	"gopkg.in/src-d/hercules.v5/leaves"
+	"gopkg.in/src-d/hercules.v6/internal/core"
+	"gopkg.in/src-d/hercules.v6/internal/plumbing"
+	"gopkg.in/src-d/hercules.v6/internal/plumbing/identity"
+	"gopkg.in/src-d/hercules.v6/internal/plumbing/uast"
+	"gopkg.in/src-d/hercules.v6/internal/yaml"
+	"gopkg.in/src-d/hercules.v6/leaves"
 )
 
 // ConfigurationOptionType represents the possible types of a ConfigurationOption's value.

+ 2 - 2
internal/burndown/file.go

@@ -4,8 +4,8 @@ import (
 	"fmt"
 	"log"
 
-	"gopkg.in/src-d/hercules.v5/internal"
-	"gopkg.in/src-d/hercules.v5/internal/rbtree"
+	"gopkg.in/src-d/hercules.v6/internal"
+	"gopkg.in/src-d/hercules.v6/internal/rbtree"
 )
 
 // Updater is the function which is called back on File.Update().

+ 1 - 1
internal/burndown/file_test.go

@@ -5,7 +5,7 @@ import (
 	"testing"
 
 	"github.com/stretchr/testify/assert"
-	"gopkg.in/src-d/hercules.v5/internal/rbtree"
+	"gopkg.in/src-d/hercules.v6/internal/rbtree"
 )
 
 func updateStatusFile(status map[int]int64, _, previousTime, delta int) {

+ 1 - 1
internal/core/forks.go

@@ -7,7 +7,7 @@ import (
 
 	"gopkg.in/src-d/go-git.v4/plumbing"
 	"gopkg.in/src-d/go-git.v4/plumbing/object"
-	"gopkg.in/src-d/hercules.v5/internal/toposort"
+	"gopkg.in/src-d/hercules.v6/internal/toposort"
 )
 
 // OneShotMergeProcessor provides the convenience method to consume merges only once.

+ 6 - 3
internal/core/forks_test.go

@@ -1,9 +1,10 @@
 package core
 
 import (
+	"testing"
+
 	"github.com/stretchr/testify/assert"
 	"gopkg.in/src-d/go-git.v4"
-	"testing"
 )
 
 type testForkPipelineItem struct {
@@ -25,7 +26,8 @@ func (item *testForkPipelineItem) Requires() []string {
 	return []string{}
 }
 
-func (item *testForkPipelineItem) Configure(facts map[string]interface{}) {
+func (item *testForkPipelineItem) Configure(facts map[string]interface{}) error {
+	return nil
 }
 
 func (item *testForkPipelineItem) ListConfigurationOptions() []ConfigurationOption {
@@ -40,8 +42,9 @@ func (item *testForkPipelineItem) Features() []string {
 	return nil
 }
 
-func (item *testForkPipelineItem) Initialize(repository *git.Repository) {
+func (item *testForkPipelineItem) Initialize(repository *git.Repository) error {
 	item.Mutable = map[int]bool{}
+	return nil
 }
 
 func (item *testForkPipelineItem) Consume(deps map[string]interface{}) (map[string]interface{}, error) {

+ 15 - 8
internal/core/pipeline.go

@@ -17,8 +17,8 @@ import (
 	"gopkg.in/src-d/go-git.v4/plumbing"
 	"gopkg.in/src-d/go-git.v4/plumbing/object"
 	"gopkg.in/src-d/go-git.v4/plumbing/storer"
-	"gopkg.in/src-d/hercules.v5/internal/pb"
-	"gopkg.in/src-d/hercules.v5/internal/toposort"
+	"gopkg.in/src-d/hercules.v6/internal/pb"
+	"gopkg.in/src-d/hercules.v6/internal/toposort"
 )
 
 // ConfigurationOptionType represents the possible types of a ConfigurationOption's value.
@@ -95,10 +95,10 @@ type PipelineItem interface {
 	ListConfigurationOptions() []ConfigurationOption
 	// Configure performs the initial setup of the object by applying parameters from facts.
 	// It allows to create PipelineItems in a universal way.
-	Configure(facts map[string]interface{})
+	Configure(facts map[string]interface{}) error
 	// Initialize prepares and resets the item. Consume() requires Initialize()
 	// to be called at least once beforehand.
-	Initialize(*git.Repository)
+	Initialize(*git.Repository) error
 	// Consume processes the next commit.
 	// deps contains the required entities which match Depends(). Besides, it always includes
 	// DependencyCommit and DependencyIndex.
@@ -577,7 +577,7 @@ func (pipeline *Pipeline) resolve(dumpPath string) {
 // Initialize prepares the pipeline for the execution (Run()). This function
 // resolves the execution DAG, Configure()-s and Initialize()-s the items in it in the
 // topological dependency order. `facts` are passed inside Configure(). They are mutable.
-func (pipeline *Pipeline) Initialize(facts map[string]interface{}) {
+func (pipeline *Pipeline) Initialize(facts map[string]interface{}) error {
 	if facts == nil {
 		facts = map[string]interface{}{}
 	}
@@ -591,14 +591,21 @@ func (pipeline *Pipeline) Initialize(facts map[string]interface{}) {
 	dumpPath, _ := facts[ConfigPipelineDumpPath].(string)
 	pipeline.resolve(dumpPath)
 	if dryRun, _ := facts[ConfigPipelineDryRun].(bool); dryRun {
-		return
+		return nil
 	}
 	for _, item := range pipeline.items {
-		item.Configure(facts)
+		err := item.Configure(facts)
+		if err != nil {
+			return errors.Wrapf(err, "%s failed to configure", item.Name())
+		}
 	}
 	for _, item := range pipeline.items {
-		item.Initialize(pipeline.repository)
+		err := item.Initialize(pipeline.repository)
+		if err != nil {
+			return errors.Wrapf(err, "%s failed to initialize", item.Name())
+		}
 	}
+	return nil
 }
 
 // Run method executes the pipeline.

+ 46 - 15
internal/core/pipeline_test.go

@@ -13,19 +13,21 @@ import (
 	"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.v5/internal/pb"
-	"gopkg.in/src-d/hercules.v5/internal/test"
+	"gopkg.in/src-d/hercules.v6/internal/pb"
+	"gopkg.in/src-d/hercules.v6/internal/test"
 )
 
 type testPipelineItem struct {
-	Initialized   bool
-	DepsConsumed  bool
-	Forked        bool
-	Merged        *bool
-	CommitMatches bool
-	IndexMatches  bool
-	MergeState    *int
-	TestError     bool
+	Initialized      bool
+	DepsConsumed     bool
+	Forked           bool
+	Merged           *bool
+	CommitMatches    bool
+	IndexMatches     bool
+	MergeState       *int
+	TestError        bool
+	ConfigureRaises  bool
+	InitializeRaises bool
 }
 
 func (item *testPipelineItem) Name() string {
@@ -41,7 +43,11 @@ func (item *testPipelineItem) Requires() []string {
 	return []string{}
 }
 
-func (item *testPipelineItem) Configure(facts map[string]interface{}) {
+func (item *testPipelineItem) Configure(facts map[string]interface{}) error {
+	if item.ConfigureRaises {
+		return errors.New("test1")
+	}
+	return nil
 }
 
 func (item *testPipelineItem) ListConfigurationOptions() []ConfigurationOption {
@@ -68,10 +74,14 @@ func (item *testPipelineItem) Features() []string {
 	return f[:]
 }
 
-func (item *testPipelineItem) Initialize(repository *git.Repository) {
+func (item *testPipelineItem) Initialize(repository *git.Repository) error {
 	item.Initialized = repository != nil
 	item.Merged = new(bool)
 	item.MergeState = new(int)
+	if item.InitializeRaises {
+		return errors.New("test2")
+	}
+	return nil
 }
 
 func (item *testPipelineItem) Consume(deps map[string]interface{}) (map[string]interface{}, error) {
@@ -150,10 +160,12 @@ func (item *dependingTestPipelineItem) ListConfigurationOptions() []Configuratio
 	return options[:]
 }
 
-func (item *dependingTestPipelineItem) Configure(facts map[string]interface{}) {
+func (item *dependingTestPipelineItem) Configure(facts map[string]interface{}) error {
+	return nil
 }
 
-func (item *dependingTestPipelineItem) Initialize(repository *git.Repository) {
+func (item *dependingTestPipelineItem) Initialize(repository *git.Repository) error {
+	return nil
 }
 
 func (item *dependingTestPipelineItem) Flag() string {
@@ -214,11 +226,30 @@ func TestPipelineFeatures(t *testing.T) {
 	})
 }
 
+func TestPipelineErrors(t *testing.T) {
+	pipeline := NewPipeline(test.Repository)
+	pipeline.SetFact("fact", "value")
+	assert.Equal(t, pipeline.GetFact("fact"), "value")
+	item := &testPipelineItem{}
+	pipeline.AddItem(item)
+	item.ConfigureRaises = true
+	err := pipeline.Initialize(map[string]interface{}{})
+	assert.NotNil(t, err)
+	assert.Contains(t, err.Error(), "configure")
+	assert.Contains(t, err.Error(), "test1")
+	item.ConfigureRaises = false
+	item.InitializeRaises = true
+	err = pipeline.Initialize(map[string]interface{}{})
+	assert.NotNil(t, err)
+	assert.Contains(t, err.Error(), "initialize")
+	assert.Contains(t, err.Error(), "test2")
+}
+
 func TestPipelineRun(t *testing.T) {
 	pipeline := NewPipeline(test.Repository)
 	item := &testPipelineItem{}
 	pipeline.AddItem(item)
-	pipeline.Initialize(map[string]interface{}{})
+	assert.Nil(t, pipeline.Initialize(map[string]interface{}{}))
 	assert.True(t, item.Initialized)
 	commits := make([]*object.Commit, 1)
 	commits[0], _ = test.Repository.CommitObject(plumbing.NewHash(

+ 11 - 5
internal/core/registry_test.go

@@ -7,7 +7,7 @@ import (
 	"github.com/spf13/cobra"
 	"github.com/stretchr/testify/assert"
 	"gopkg.in/src-d/go-git.v4"
-	"gopkg.in/src-d/hercules.v5/internal/test"
+	"gopkg.in/src-d/hercules.v6/internal/test"
 )
 
 func getRegistry() *PipelineItemRegistry {
@@ -39,7 +39,8 @@ func (item *dummyPipelineItem) Features() []string {
 	return arr[:]
 }
 
-func (item *dummyPipelineItem) Configure(facts map[string]interface{}) {
+func (item *dummyPipelineItem) Configure(facts map[string]interface{}) error {
+	return nil
 }
 
 func (item *dummyPipelineItem) ListConfigurationOptions() []ConfigurationOption {
@@ -53,7 +54,9 @@ func (item *dummyPipelineItem) ListConfigurationOptions() []ConfigurationOption
 	return options[:]
 }
 
-func (item *dummyPipelineItem) Initialize(repository *git.Repository) {}
+func (item *dummyPipelineItem) Initialize(repository *git.Repository) error {
+	return nil
+}
 
 func (item *dummyPipelineItem) Consume(deps map[string]interface{}) (map[string]interface{}, error) {
 	return map[string]interface{}{"dummy": nil}, nil
@@ -86,14 +89,17 @@ func (item *dummyPipelineItem2) Features() []string {
 	return arr[:]
 }
 
-func (item *dummyPipelineItem2) Configure(facts map[string]interface{}) {
+func (item *dummyPipelineItem2) Configure(facts map[string]interface{}) error {
+	return nil
 }
 
 func (item *dummyPipelineItem2) ListConfigurationOptions() []ConfigurationOption {
 	return []ConfigurationOption{}
 }
 
-func (item *dummyPipelineItem2) Initialize(repository *git.Repository) {}
+func (item *dummyPipelineItem2) Initialize(repository *git.Repository) error {
+	return nil
+}
 
 func (item *dummyPipelineItem2) Consume(deps map[string]interface{}) (map[string]interface{}, error) {
 	return map[string]interface{}{"dummy2": nil}, nil

+ 4 - 4
internal/global_test.go

@@ -7,10 +7,10 @@ import (
 	"testing"
 
 	"github.com/stretchr/testify/assert"
-	"gopkg.in/src-d/hercules.v5/internal/core"
-	uast_items "gopkg.in/src-d/hercules.v5/internal/plumbing/uast"
-	"gopkg.in/src-d/hercules.v5/internal/test"
-	"gopkg.in/src-d/hercules.v5/leaves"
+	"gopkg.in/src-d/hercules.v6/internal/core"
+	uast_items "gopkg.in/src-d/hercules.v6/internal/plumbing/uast"
+	"gopkg.in/src-d/hercules.v6/internal/test"
+	"gopkg.in/src-d/hercules.v6/leaves"
 )
 
 func TestPipelineSerialize(t *testing.T) {

+ 6 - 4
internal/plumbing/blob_cache.go

@@ -13,8 +13,8 @@ import (
 	"gopkg.in/src-d/go-git.v4/plumbing"
 	"gopkg.in/src-d/go-git.v4/plumbing/object"
 	"gopkg.in/src-d/go-git.v4/utils/merkletrie"
-	"gopkg.in/src-d/hercules.v5/internal"
-	"gopkg.in/src-d/hercules.v5/internal/core"
+	"gopkg.in/src-d/hercules.v6/internal"
+	"gopkg.in/src-d/hercules.v6/internal/core"
 )
 
 // ErrorBinary is raised in CachedBlob.CountLines() if the file is binary.
@@ -132,17 +132,19 @@ func (blobCache *BlobCache) ListConfigurationOptions() []core.ConfigurationOptio
 }
 
 // Configure sets the properties previously published by ListConfigurationOptions().
-func (blobCache *BlobCache) Configure(facts map[string]interface{}) {
+func (blobCache *BlobCache) Configure(facts map[string]interface{}) error {
 	if val, exists := facts[ConfigBlobCacheFailOnMissingSubmodules].(bool); exists {
 		blobCache.FailOnMissingSubmodules = val
 	}
+	return nil
 }
 
 // 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 (blobCache *BlobCache) Initialize(repository *git.Repository) {
+func (blobCache *BlobCache) Initialize(repository *git.Repository) error {
 	blobCache.repository = repository
 	blobCache.cache = map[plumbing.Hash]*CachedBlob{}
+	return nil
 }
 
 // Consume runs this PipelineItem on the next commit data.

+ 3 - 3
internal/plumbing/blob_cache_test.go

@@ -6,9 +6,9 @@ import (
 	"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.v5/internal"
-	"gopkg.in/src-d/hercules.v5/internal/core"
-	"gopkg.in/src-d/hercules.v5/internal/test"
+	"gopkg.in/src-d/hercules.v6/internal"
+	"gopkg.in/src-d/hercules.v6/internal/core"
+	"gopkg.in/src-d/hercules.v6/internal/test"
 )
 
 func fixtureBlobCache() *BlobCache {

+ 5 - 3
internal/plumbing/day.go

@@ -6,7 +6,7 @@ import (
 	"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.v5/internal/core"
+	"gopkg.in/src-d/hercules.v6/internal/core"
 )
 
 // DaysSinceStart provides the relative date information for every commit.
@@ -53,16 +53,17 @@ func (days *DaysSinceStart) ListConfigurationOptions() []core.ConfigurationOptio
 }
 
 // Configure sets the properties previously published by ListConfigurationOptions().
-func (days *DaysSinceStart) Configure(facts map[string]interface{}) {
+func (days *DaysSinceStart) Configure(facts map[string]interface{}) error {
 	if days.commits == nil {
 		days.commits = map[int][]plumbing.Hash{}
 	}
 	facts[FactCommitsByDay] = days.commits
+	return nil
 }
 
 // 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 (days *DaysSinceStart) Initialize(repository *git.Repository) {
+func (days *DaysSinceStart) Initialize(repository *git.Repository) error {
 	days.day0 = &time.Time{}
 	days.previousDay = 0
 	if len(days.commits) > 0 {
@@ -74,6 +75,7 @@ func (days *DaysSinceStart) Initialize(repository *git.Repository) {
 			delete(days.commits, key)
 		}
 	}
+	return nil
 }
 
 // Consume runs this PipelineItem on the next commit data.

+ 2 - 2
internal/plumbing/day_test.go

@@ -5,8 +5,8 @@ import (
 
 	"github.com/stretchr/testify/assert"
 	"gopkg.in/src-d/go-git.v4/plumbing"
-	"gopkg.in/src-d/hercules.v5/internal/core"
-	"gopkg.in/src-d/hercules.v5/internal/test"
+	"gopkg.in/src-d/hercules.v6/internal/core"
+	"gopkg.in/src-d/hercules.v6/internal/test"
 )
 
 func fixtureDaysSinceStart() *DaysSinceStart {

+ 8 - 4
internal/plumbing/diff.go

@@ -1,13 +1,14 @@
 package plumbing
 
 import (
+	"strings"
+
 	"github.com/sergi/go-diff/diffmatchpatch"
 	"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/go-git.v4/utils/merkletrie"
-	"gopkg.in/src-d/hercules.v5/internal/core"
-	"strings"
+	"gopkg.in/src-d/hercules.v6/internal/core"
 )
 
 // FileDiff calculates the difference of files which were modified.
@@ -81,18 +82,21 @@ func (diff *FileDiff) ListConfigurationOptions() []core.ConfigurationOption {
 }
 
 // Configure sets the properties previously published by ListConfigurationOptions().
-func (diff *FileDiff) Configure(facts map[string]interface{}) {
+func (diff *FileDiff) Configure(facts map[string]interface{}) error {
 	if val, exists := facts[ConfigFileDiffDisableCleanup].(bool); exists {
 		diff.CleanupDisabled = val
 	}
 	if val, exists := facts[ConfigFileWhitespaceIgnore].(bool); exists {
 		diff.WhitespaceIgnore = val
 	}
+	return nil
 }
 
 // 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 (diff *FileDiff) Initialize(repository *git.Repository) {}
+func (diff *FileDiff) Initialize(repository *git.Repository) error {
+	return nil
+}
 
 func stripWhitespace(str string, ignoreWhitespace bool) string {
 	if ignoreWhitespace {

+ 6 - 6
internal/plumbing/diff_test.go

@@ -8,12 +8,12 @@ import (
 	"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.v5"
-	"gopkg.in/src-d/hercules.v5/internal"
-	"gopkg.in/src-d/hercules.v5/internal/core"
-	items "gopkg.in/src-d/hercules.v5/internal/plumbing"
-	"gopkg.in/src-d/hercules.v5/internal/test"
-	"gopkg.in/src-d/hercules.v5/internal/test/fixtures"
+	"gopkg.in/src-d/hercules.v6"
+	"gopkg.in/src-d/hercules.v6/internal"
+	"gopkg.in/src-d/hercules.v6/internal/core"
+	items "gopkg.in/src-d/hercules.v6/internal/plumbing"
+	"gopkg.in/src-d/hercules.v6/internal/test"
+	"gopkg.in/src-d/hercules.v6/internal/test/fixtures"
 )
 
 func TestFileDiffMeta(t *testing.T) {

+ 14 - 6
internal/plumbing/identity/identity.go

@@ -2,13 +2,15 @@ package identity
 
 import (
 	"bufio"
+	"fmt"
 	"os"
 	"sort"
 	"strings"
 
+	"github.com/pkg/errors"
 	"gopkg.in/src-d/go-git.v4"
 	"gopkg.in/src-d/go-git.v4/plumbing/object"
-	"gopkg.in/src-d/hercules.v5/internal/core"
+	"gopkg.in/src-d/hercules.v6/internal/core"
 )
 
 // Detector determines the author of a commit. Same person can commit under different
@@ -73,7 +75,7 @@ func (detector *Detector) Requires() []string {
 func (detector *Detector) ListConfigurationOptions() []core.ConfigurationOption {
 	options := [...]core.ConfigurationOption{{
 		Name:        ConfigIdentityDetectorPeopleDictPath,
-		Description: "Path to the developers' email associations.",
+		Description: "Path to the file with developer -> name|email associations.",
 		Flag:        "people-dict",
 		Type:        core.StringConfigurationOption,
 		Default:     ""},
@@ -82,7 +84,7 @@ func (detector *Detector) ListConfigurationOptions() []core.ConfigurationOption
 }
 
 // Configure sets the properties previously published by ListConfigurationOptions().
-func (detector *Detector) Configure(facts map[string]interface{}) {
+func (detector *Detector) Configure(facts map[string]interface{}) error {
 	if val, exists := facts[FactIdentityDetectorPeopleDict].(map[string]int); exists {
 		detector.PeopleDict = val
 	}
@@ -92,7 +94,10 @@ func (detector *Detector) Configure(facts map[string]interface{}) {
 	if detector.PeopleDict == nil || detector.ReversedPeopleDict == nil {
 		peopleDictPath, _ := facts[ConfigIdentityDetectorPeopleDictPath].(string)
 		if peopleDictPath != "" {
-			detector.LoadPeopleDict(peopleDictPath)
+			err := detector.LoadPeopleDict(peopleDictPath)
+			if err != nil {
+				return errors.Errorf("failed to load %s: %v", peopleDictPath, err)
+			}
 			facts[FactIdentityDetectorPeopleCount] = len(detector.ReversedPeopleDict) - 1
 		} else {
 			if _, exists := facts[core.ConfigPipelineCommits]; !exists {
@@ -106,11 +111,13 @@ func (detector *Detector) Configure(facts map[string]interface{}) {
 	}
 	facts[FactIdentityDetectorPeopleDict] = detector.PeopleDict
 	facts[FactIdentityDetectorReversedPeopleDict] = detector.ReversedPeopleDict
+	return nil
 }
 
 // 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 (detector *Detector) Initialize(repository *git.Repository) {
+func (detector *Detector) Initialize(repository *git.Repository) error {
+	return nil
 }
 
 // Consume runs this PipelineItem on the next commit data.
@@ -147,7 +154,7 @@ func (detector *Detector) LoadPeopleDict(path string) error {
 	defer file.Close()
 	scanner := bufio.NewScanner(file)
 	dict := make(map[string]int)
-	reverseDict := []string{}
+	var reverseDict []string
 	size := 0
 	for scanner.Scan() {
 		ids := strings.Split(scanner.Text(), "|")
@@ -160,6 +167,7 @@ func (detector *Detector) LoadPeopleDict(path string) error {
 	reverseDict = append(reverseDict, AuthorMissingName)
 	detector.PeopleDict = dict
 	detector.ReversedPeopleDict = reverseDict
+	fmt.Println(detector.ReversedPeopleDict)
 	return nil
 }
 

+ 8 - 2
internal/plumbing/identity/identity_test.go

@@ -14,8 +14,8 @@ import (
 	"gopkg.in/src-d/go-git.v4/plumbing"
 	"gopkg.in/src-d/go-git.v4/plumbing/object"
 	"gopkg.in/src-d/go-git.v4/plumbing/storer"
-	"gopkg.in/src-d/hercules.v5/internal/core"
-	"gopkg.in/src-d/hercules.v5/internal/test"
+	"gopkg.in/src-d/hercules.v6/internal/core"
+	"gopkg.in/src-d/hercules.v6/internal/test"
 )
 
 func fixtureIdentityDetector() *Detector {
@@ -164,6 +164,12 @@ func TestIdentityDetectorLoadPeopleDict(t *testing.T) {
 	assert.Equal(t, id.ReversedPeopleDict[3], AuthorMissingName)
 }
 
+func TestIdentityDetectorLoadPeopleDictWrongPath(t *testing.T) {
+	id := fixtureIdentityDetector()
+	err := id.LoadPeopleDict(path.Join("identities"))
+	assert.NotNil(t, err)
+}
+
 /*
 // internal compiler error in 1.8
 func TestGeneratePeopleDict(t *testing.T) {

+ 6 - 4
internal/plumbing/renames.go

@@ -12,8 +12,8 @@ import (
 	"gopkg.in/src-d/go-git.v4/plumbing"
 	"gopkg.in/src-d/go-git.v4/plumbing/object"
 	"gopkg.in/src-d/go-git.v4/utils/merkletrie"
-	"gopkg.in/src-d/hercules.v5/internal"
-	"gopkg.in/src-d/hercules.v5/internal/core"
+	"gopkg.in/src-d/hercules.v6/internal"
+	"gopkg.in/src-d/hercules.v6/internal/core"
 )
 
 // RenameAnalysis improves TreeDiff's results by searching for changed blobs under different
@@ -80,21 +80,23 @@ func (ra *RenameAnalysis) ListConfigurationOptions() []core.ConfigurationOption
 }
 
 // Configure sets the properties previously published by ListConfigurationOptions().
-func (ra *RenameAnalysis) Configure(facts map[string]interface{}) {
+func (ra *RenameAnalysis) Configure(facts map[string]interface{}) error {
 	if val, exists := facts[ConfigRenameAnalysisSimilarityThreshold].(int); exists {
 		ra.SimilarityThreshold = val
 	}
+	return nil
 }
 
 // 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 (ra *RenameAnalysis) Initialize(repository *git.Repository) {
+func (ra *RenameAnalysis) Initialize(repository *git.Repository) error {
 	if ra.SimilarityThreshold < 0 || ra.SimilarityThreshold > 100 {
 		log.Printf("Warning: adjusted the similarity threshold to %d\n",
 			RenameAnalysisDefaultThreshold)
 		ra.SimilarityThreshold = RenameAnalysisDefaultThreshold
 	}
 	ra.repository = repository
+	return nil
 }
 
 // Consume runs this PipelineItem on the next commit data.

+ 2 - 2
internal/plumbing/renames_test.go

@@ -6,8 +6,8 @@ import (
 	"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.v5/internal/core"
-	"gopkg.in/src-d/hercules.v5/internal/test"
+	"gopkg.in/src-d/hercules.v6/internal/core"
+	"gopkg.in/src-d/hercules.v6/internal/test"
 )
 
 func fixtureRenameAnalysis() *RenameAnalysis {

+ 5 - 3
internal/plumbing/tree_diff.go

@@ -12,7 +12,7 @@ import (
 	"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.v5/internal/core"
+	"gopkg.in/src-d/hercules.v6/internal/core"
 )
 
 // TreeDiff generates the list of changes for a commit. A change can be either one or two blobs
@@ -117,7 +117,7 @@ func (treediff *TreeDiff) ListConfigurationOptions() []core.ConfigurationOption
 }
 
 // Configure sets the properties previously published by ListConfigurationOptions().
-func (treediff *TreeDiff) Configure(facts map[string]interface{}) {
+func (treediff *TreeDiff) Configure(facts map[string]interface{}) error {
 	if val, exist := facts[ConfigTreeDiffEnableBlacklist]; exist && val.(bool) {
 		treediff.SkipDirs = facts[ConfigTreeDiffBlacklistedPrefixes].([]string)
 	}
@@ -134,17 +134,19 @@ func (treediff *TreeDiff) Configure(facts map[string]interface{}) {
 	if val, exists := facts[ConfigTreeDiffFilterRegexp].(string); exists {
 		treediff.NameFilter = regexp.MustCompile(val)
 	}
+	return nil
 }
 
 // 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 (treediff *TreeDiff) Initialize(repository *git.Repository) {
+func (treediff *TreeDiff) Initialize(repository *git.Repository) error {
 	treediff.previousTree = nil
 	treediff.repository = repository
 	if treediff.Languages == nil {
 		treediff.Languages = map[string]bool{}
 		treediff.Languages[allLanguages] = true
 	}
+	return nil
 }
 
 // Consume runs this PipelineItem on the next commit data.

+ 2 - 2
internal/plumbing/tree_diff_test.go

@@ -7,8 +7,8 @@ import (
 	"gopkg.in/src-d/go-git.v4/plumbing"
 	"gopkg.in/src-d/go-git.v4/plumbing/object"
 	"gopkg.in/src-d/go-git.v4/utils/merkletrie"
-	"gopkg.in/src-d/hercules.v5/internal/core"
-	"gopkg.in/src-d/hercules.v5/internal/test"
+	"gopkg.in/src-d/hercules.v6/internal/core"
+	"gopkg.in/src-d/hercules.v6/internal/test"
 )
 
 func fixtureTreeDiff() *TreeDiff {

+ 2 - 2
internal/plumbing/uast/changes_xpather_test.go

@@ -8,8 +8,8 @@ import (
 
 	"github.com/stretchr/testify/assert"
 	"gopkg.in/bblfsh/client-go.v2"
-	uast_test "gopkg.in/src-d/hercules.v5/internal/plumbing/uast/test"
-	"gopkg.in/src-d/hercules.v5/internal/test"
+	uast_test "gopkg.in/src-d/hercules.v6/internal/plumbing/uast/test"
+	"gopkg.in/src-d/hercules.v6/internal/test"
 )
 
 func TestChangesXPatherExtractChanged(t *testing.T) {

+ 7 - 4
internal/plumbing/uast/diff_refiner.go

@@ -6,8 +6,8 @@ import (
 	"github.com/sergi/go-diff/diffmatchpatch"
 	"gopkg.in/bblfsh/sdk.v1/uast"
 	"gopkg.in/src-d/go-git.v4"
-	"gopkg.in/src-d/hercules.v5/internal/core"
-	"gopkg.in/src-d/hercules.v5/internal/plumbing"
+	"gopkg.in/src-d/hercules.v6/internal/core"
+	"gopkg.in/src-d/hercules.v6/internal/plumbing"
 )
 
 // FileDiffRefiner uses UASTs to improve the human interpretability of diffs.
@@ -51,11 +51,14 @@ func (ref *FileDiffRefiner) ListConfigurationOptions() []core.ConfigurationOptio
 }
 
 // Configure sets the properties previously published by ListConfigurationOptions().
-func (ref *FileDiffRefiner) Configure(facts map[string]interface{}) {}
+func (ref *FileDiffRefiner) Configure(facts map[string]interface{}) error {
+	return nil
+}
 
 // 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 (ref *FileDiffRefiner) Initialize(repository *git.Repository) {
+func (ref *FileDiffRefiner) Initialize(repository *git.Repository) error {
+	return nil
 }
 
 // Consume runs this PipelineItem on the next commit data.

+ 3 - 3
internal/plumbing/uast/diff_refiner_test.go

@@ -11,9 +11,9 @@ import (
 	"github.com/stretchr/testify/assert"
 	"gopkg.in/bblfsh/sdk.v1/uast"
 	"gopkg.in/src-d/go-git.v4/plumbing/object"
-	"gopkg.in/src-d/hercules.v5/internal/core"
-	"gopkg.in/src-d/hercules.v5/internal/plumbing"
-	"gopkg.in/src-d/hercules.v5/internal/test"
+	"gopkg.in/src-d/hercules.v6/internal/core"
+	"gopkg.in/src-d/hercules.v6/internal/plumbing"
+	"gopkg.in/src-d/hercules.v6/internal/test"
 )
 
 func fixtureFileDiffRefiner() *FileDiffRefiner {

+ 2 - 2
internal/plumbing/uast/test/utils.go

@@ -4,10 +4,10 @@ import (
 	"fmt"
 	"io/ioutil"
 
-	bblfsh "gopkg.in/bblfsh/client-go.v2"
+	"gopkg.in/bblfsh/client-go.v2"
 	"gopkg.in/bblfsh/sdk.v1/uast"
 	"gopkg.in/src-d/go-git.v4/plumbing"
-	core_test "gopkg.in/src-d/hercules.v5/internal/test"
+	core_test "gopkg.in/src-d/hercules.v6/internal/test"
 )
 
 // ParseBlobFromTestRepo extracts the UAST from the file by it's hash and name.

+ 16 - 9
internal/plumbing/uast/uast.go

@@ -22,9 +22,9 @@ import (
 	"gopkg.in/src-d/go-git.v4/plumbing"
 	"gopkg.in/src-d/go-git.v4/plumbing/object"
 	"gopkg.in/src-d/go-git.v4/utils/merkletrie"
-	"gopkg.in/src-d/hercules.v5/internal/core"
-	"gopkg.in/src-d/hercules.v5/internal/pb"
-	items "gopkg.in/src-d/hercules.v5/internal/plumbing"
+	"gopkg.in/src-d/hercules.v6/internal/core"
+	"gopkg.in/src-d/hercules.v6/internal/pb"
+	items "gopkg.in/src-d/hercules.v6/internal/plumbing"
 )
 
 // Extractor retrieves UASTs from Babelfish server which correspond to changed files in a commit.
@@ -137,7 +137,7 @@ func (exr *Extractor) ListConfigurationOptions() []core.ConfigurationOption {
 }
 
 // Configure sets the properties previously published by ListConfigurationOptions().
-func (exr *Extractor) Configure(facts map[string]interface{}) {
+func (exr *Extractor) Configure(facts map[string]interface{}) error {
 	if val, exists := facts[ConfigUASTEndpoint].(string); exists {
 		exr.Endpoint = val
 	}
@@ -153,11 +153,12 @@ func (exr *Extractor) Configure(facts map[string]interface{}) {
 	if val, exists := facts[ConfigUASTFailOnErrors].(bool); exists {
 		exr.FailOnErrors = val
 	}
+	return nil
 }
 
 // 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 (exr *Extractor) Initialize(repository *git.Repository) {
+func (exr *Extractor) Initialize(repository *git.Repository) error {
 	if exr.Context == nil {
 		exr.Context = func() (context.Context, context.CancelFunc) {
 			return context.Background(), nil
@@ -190,6 +191,7 @@ func (exr *Extractor) Initialize(repository *git.Repository) {
 		panic("UAST goroutine pool was not created")
 	}
 	exr.ProcessedFiles = map[string]int{}
+	return nil
 }
 
 // Consume runs this PipelineItem on the next commit data.
@@ -346,12 +348,15 @@ func (uc *Changes) ListConfigurationOptions() []core.ConfigurationOption {
 }
 
 // Configure sets the properties previously published by ListConfigurationOptions().
-func (uc *Changes) Configure(facts map[string]interface{}) {}
+func (uc *Changes) Configure(facts map[string]interface{}) error {
+	return nil
+}
 
 // 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 (uc *Changes) Initialize(repository *git.Repository) {
+func (uc *Changes) Initialize(repository *git.Repository) error {
 	uc.cache = map[plumbing.Hash]*uast.Node{}
+	return nil
 }
 
 // Consume runs this PipelineItem on the next commit data.
@@ -472,18 +477,20 @@ func (saver *ChangesSaver) Description() string {
 }
 
 // Configure sets the properties previously published by ListConfigurationOptions().
-func (saver *ChangesSaver) Configure(facts map[string]interface{}) {
+func (saver *ChangesSaver) Configure(facts map[string]interface{}) error {
 	if val, exists := facts[ConfigUASTChangesSaverOutputPath]; exists {
 		saver.OutputPath = val.(string)
 	}
+	return nil
 }
 
 // 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 (saver *ChangesSaver) Initialize(repository *git.Repository) {
+func (saver *ChangesSaver) Initialize(repository *git.Repository) error {
 	saver.repository = repository
 	saver.result = [][]Change{}
 	saver.OneShotMergeProcessor.Initialize()
+	return nil
 }
 
 // Consume runs this PipelineItem on the next commit data.

+ 4 - 4
internal/plumbing/uast/uast_test.go

@@ -15,10 +15,10 @@ import (
 	"gopkg.in/bblfsh/sdk.v1/uast"
 	"gopkg.in/src-d/go-git.v4/plumbing"
 	"gopkg.in/src-d/go-git.v4/plumbing/object"
-	"gopkg.in/src-d/hercules.v5/internal/core"
-	"gopkg.in/src-d/hercules.v5/internal/pb"
-	items "gopkg.in/src-d/hercules.v5/internal/plumbing"
-	"gopkg.in/src-d/hercules.v5/internal/test"
+	"gopkg.in/src-d/hercules.v6/internal/core"
+	"gopkg.in/src-d/hercules.v6/internal/pb"
+	items "gopkg.in/src-d/hercules.v6/internal/plumbing"
+	"gopkg.in/src-d/hercules.v6/internal/test"
 )
 
 func fixtureUASTExtractor() *Extractor {

+ 2 - 2
internal/test/fixtures/fixtures.go

@@ -1,8 +1,8 @@
 package fixtures
 
 import (
-	"gopkg.in/src-d/hercules.v5/internal/plumbing"
-	"gopkg.in/src-d/hercules.v5/internal/test"
+	"gopkg.in/src-d/hercules.v6/internal/plumbing"
+	"gopkg.in/src-d/hercules.v6/internal/test"
 )
 
 // FileDiff initializes a new plumbing.FileDiff item for testing.

+ 16 - 8
leaves/burndown.go

@@ -15,12 +15,12 @@ import (
 	"gopkg.in/src-d/go-git.v4/plumbing"
 	"gopkg.in/src-d/go-git.v4/plumbing/object"
 	"gopkg.in/src-d/go-git.v4/utils/merkletrie"
-	"gopkg.in/src-d/hercules.v5/internal/burndown"
-	"gopkg.in/src-d/hercules.v5/internal/core"
-	"gopkg.in/src-d/hercules.v5/internal/pb"
-	items "gopkg.in/src-d/hercules.v5/internal/plumbing"
-	"gopkg.in/src-d/hercules.v5/internal/plumbing/identity"
-	"gopkg.in/src-d/hercules.v5/internal/yaml"
+	"gopkg.in/src-d/hercules.v6/internal/burndown"
+	"gopkg.in/src-d/hercules.v6/internal/core"
+	"gopkg.in/src-d/hercules.v6/internal/pb"
+	items "gopkg.in/src-d/hercules.v6/internal/plumbing"
+	"gopkg.in/src-d/hercules.v6/internal/plumbing/identity"
+	"gopkg.in/src-d/hercules.v6/internal/yaml"
 )
 
 // BurndownAnalysis allows to gather the line burndown statistics for a Git repository.
@@ -193,7 +193,7 @@ func (analyser *BurndownAnalysis) ListConfigurationOptions() []core.Configuratio
 }
 
 // Configure sets the properties previously published by ListConfigurationOptions().
-func (analyser *BurndownAnalysis) Configure(facts map[string]interface{}) {
+func (analyser *BurndownAnalysis) Configure(facts map[string]interface{}) error {
 	if val, exists := facts[ConfigBurndownGranularity].(int); exists {
 		analyser.Granularity = val
 	}
@@ -205,6 +205,9 @@ func (analyser *BurndownAnalysis) Configure(facts map[string]interface{}) {
 	}
 	if people, exists := facts[ConfigBurndownTrackPeople].(bool); people {
 		if val, exists := facts[identity.FactIdentityDetectorPeopleCount].(int); exists {
+			if val < 0 {
+				return fmt.Errorf("PeopleNumber is negative: %d", val)
+			}
 			analyser.PeopleNumber = val
 			analyser.reversedPeopleDict = facts[identity.FactIdentityDetectorReversedPeopleDict].([]string)
 		}
@@ -214,6 +217,7 @@ func (analyser *BurndownAnalysis) Configure(facts map[string]interface{}) {
 	if val, exists := facts[ConfigBurndownDebug].(bool); exists {
 		analyser.Debug = val
 	}
+	return nil
 }
 
 // Flag for the command line switch which enables this analysis.
@@ -229,7 +233,7 @@ func (analyser *BurndownAnalysis) Description() string {
 
 // 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 (analyser *BurndownAnalysis) Initialize(repository *git.Repository) {
+func (analyser *BurndownAnalysis) Initialize(repository *git.Repository) error {
 	if analyser.Granularity <= 0 {
 		log.Printf("Warning: adjusted the granularity to %d days\n",
 			DefaultBurndownGranularity)
@@ -248,6 +252,9 @@ func (analyser *BurndownAnalysis) Initialize(repository *git.Repository) {
 	analyser.repository = repository
 	analyser.globalHistory = sparseHistory{}
 	analyser.fileHistories = map[string]sparseHistory{}
+	if analyser.PeopleNumber < 0 {
+		return fmt.Errorf("PeopleNumber is negative: %d", analyser.PeopleNumber)
+	}
 	analyser.peopleHistories = make([]sparseHistory, analyser.PeopleNumber)
 	analyser.files = map[string]*burndown.File{}
 	analyser.mergedFiles = map[string]bool{}
@@ -256,6 +263,7 @@ func (analyser *BurndownAnalysis) Initialize(repository *git.Repository) {
 	analyser.matrix = make([]map[int]int64, analyser.PeopleNumber)
 	analyser.day = 0
 	analyser.previousDay = 0
+	return nil
 }
 
 // Consume runs this PipelineItem on the next commit's data.

+ 22 - 6
leaves/burndown_test.go

@@ -7,17 +7,17 @@ import (
 	"path"
 	"testing"
 
-	"gopkg.in/src-d/hercules.v5/internal/core"
-	"gopkg.in/src-d/hercules.v5/internal/test/fixtures"
+	"gopkg.in/src-d/hercules.v6/internal/core"
+	"gopkg.in/src-d/hercules.v6/internal/test/fixtures"
 
 	"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.v5/internal/pb"
-	items "gopkg.in/src-d/hercules.v5/internal/plumbing"
-	"gopkg.in/src-d/hercules.v5/internal/plumbing/identity"
-	"gopkg.in/src-d/hercules.v5/internal/test"
+	"gopkg.in/src-d/hercules.v6/internal/pb"
+	items "gopkg.in/src-d/hercules.v6/internal/plumbing"
+	"gopkg.in/src-d/hercules.v6/internal/plumbing/identity"
+	"gopkg.in/src-d/hercules.v6/internal/test"
 )
 
 func AddHash(t *testing.T, cache map[plumbing.Hash]*items.CachedBlob, hash string) {
@@ -1185,3 +1185,19 @@ func TestBurndownEmptyFileHistory(t *testing.T) {
 	assert.Len(t, res.PeopleHistories, 0)
 	assert.NotNil(t, res.PeopleHistories)
 }
+
+func TestBurndownNegativePeople(t *testing.T) {
+	burndown := &BurndownAnalysis{
+		Sampling:    30,
+		Granularity: 30,
+		PeopleNumber: -1,
+	}
+	err := burndown.Initialize(test.Repository)
+	assert.Equal(t, err.Error(), "PeopleNumber is negative: -1")
+	facts := map[string]interface{}{
+		ConfigBurndownTrackPeople:                true,
+		identity.FactIdentityDetectorPeopleCount: -1,
+	}
+	err = burndown.Configure(facts)
+	assert.Equal(t, err.Error(), "PeopleNumber is negative: -1")
+}

+ 8 - 6
leaves/comment_sentiment.go

@@ -16,10 +16,10 @@ import (
 	progress "gopkg.in/cheggaaa/pb.v1"
 	"gopkg.in/src-d/go-git.v4"
 	"gopkg.in/src-d/go-git.v4/plumbing"
-	"gopkg.in/src-d/hercules.v5/internal/core"
-	"gopkg.in/src-d/hercules.v5/internal/pb"
-	items "gopkg.in/src-d/hercules.v5/internal/plumbing"
-	uast_items "gopkg.in/src-d/hercules.v5/internal/plumbing/uast"
+	"gopkg.in/src-d/hercules.v6/internal/core"
+	"gopkg.in/src-d/hercules.v6/internal/pb"
+	items "gopkg.in/src-d/hercules.v6/internal/plumbing"
+	uast_items "gopkg.in/src-d/hercules.v6/internal/plumbing/uast"
 	"gopkg.in/vmarkovtsev/BiDiSentiment.v1"
 )
 
@@ -120,7 +120,7 @@ func (sent *CommentSentimentAnalysis) Description() string {
 }
 
 // Configure sets the properties previously published by ListConfigurationOptions().
-func (sent *CommentSentimentAnalysis) Configure(facts map[string]interface{}) {
+func (sent *CommentSentimentAnalysis) Configure(facts map[string]interface{}) error {
 	if val, exists := facts[ConfigCommentSentimentGap]; exists {
 		sent.Gap = val.(float32)
 	}
@@ -129,6 +129,7 @@ func (sent *CommentSentimentAnalysis) Configure(facts map[string]interface{}) {
 	}
 	sent.validate()
 	sent.commitsByDay = facts[items.FactCommitsByDay].(map[int][]plumbing.Hash)
+	return nil
 }
 
 func (sent *CommentSentimentAnalysis) validate() {
@@ -146,11 +147,12 @@ func (sent *CommentSentimentAnalysis) validate() {
 
 // 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 (sent *CommentSentimentAnalysis) Initialize(repository *git.Repository) {
+func (sent *CommentSentimentAnalysis) Initialize(repository *git.Repository) error {
 	sent.commentsByDay = map[int][]string{}
 	sent.xpather = &uast_items.ChangesXPather{XPath: "//*[@roleComment]"}
 	sent.validate()
 	sent.OneShotMergeProcessor.Initialize()
+	return nil
 }
 
 // Consume runs this PipelineItem on the next commit data.

+ 6 - 6
leaves/comment_sentiment_test.go

@@ -13,12 +13,12 @@ import (
 	"gopkg.in/bblfsh/client-go.v2"
 	"gopkg.in/bblfsh/client-go.v2/tools"
 	"gopkg.in/src-d/go-git.v4/plumbing"
-	"gopkg.in/src-d/hercules.v5/internal/core"
-	"gopkg.in/src-d/hercules.v5/internal/pb"
-	items "gopkg.in/src-d/hercules.v5/internal/plumbing"
-	uast_items "gopkg.in/src-d/hercules.v5/internal/plumbing/uast"
-	uast_test "gopkg.in/src-d/hercules.v5/internal/plumbing/uast/test"
-	"gopkg.in/src-d/hercules.v5/internal/test"
+	"gopkg.in/src-d/hercules.v6/internal/core"
+	"gopkg.in/src-d/hercules.v6/internal/pb"
+	items "gopkg.in/src-d/hercules.v6/internal/plumbing"
+	uast_items "gopkg.in/src-d/hercules.v6/internal/plumbing/uast"
+	uast_test "gopkg.in/src-d/hercules.v6/internal/plumbing/uast/test"
+	"gopkg.in/src-d/hercules.v6/internal/test"
 )
 
 func fixtureCommentSentiment() *CommentSentimentAnalysis {

+ 9 - 7
leaves/couples.go

@@ -9,11 +9,11 @@ import (
 	"gopkg.in/src-d/go-git.v4"
 	"gopkg.in/src-d/go-git.v4/plumbing/object"
 	"gopkg.in/src-d/go-git.v4/utils/merkletrie"
-	"gopkg.in/src-d/hercules.v5/internal/core"
-	"gopkg.in/src-d/hercules.v5/internal/pb"
-	items "gopkg.in/src-d/hercules.v5/internal/plumbing"
-	"gopkg.in/src-d/hercules.v5/internal/plumbing/identity"
-	"gopkg.in/src-d/hercules.v5/internal/yaml"
+	"gopkg.in/src-d/hercules.v6/internal/core"
+	"gopkg.in/src-d/hercules.v6/internal/pb"
+	items "gopkg.in/src-d/hercules.v6/internal/plumbing"
+	"gopkg.in/src-d/hercules.v6/internal/plumbing/identity"
+	"gopkg.in/src-d/hercules.v6/internal/yaml"
 )
 
 // CouplesAnalysis calculates the number of common commits for files and authors.
@@ -82,11 +82,12 @@ func (couples *CouplesAnalysis) ListConfigurationOptions() []core.ConfigurationO
 }
 
 // Configure sets the properties previously published by ListConfigurationOptions().
-func (couples *CouplesAnalysis) Configure(facts map[string]interface{}) {
+func (couples *CouplesAnalysis) Configure(facts map[string]interface{}) error {
 	if val, exists := facts[identity.FactIdentityDetectorPeopleCount].(int); exists {
 		couples.PeopleNumber = val
 		couples.reversedPeopleDict = facts[identity.FactIdentityDetectorReversedPeopleDict].([]string)
 	}
+	return nil
 }
 
 // Flag for the command line switch which enables this analysis.
@@ -103,7 +104,7 @@ func (couples *CouplesAnalysis) Description() string {
 
 // 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 (couples *CouplesAnalysis) Initialize(repository *git.Repository) {
+func (couples *CouplesAnalysis) Initialize(repository *git.Repository) error {
 	couples.people = make([]map[string]int, couples.PeopleNumber+1)
 	for i := range couples.people {
 		couples.people[i] = map[string]int{}
@@ -112,6 +113,7 @@ func (couples *CouplesAnalysis) Initialize(repository *git.Repository) {
 	couples.files = map[string]map[string]int{}
 	couples.renames = &[]rename{}
 	couples.OneShotMergeProcessor.Initialize()
+	return nil
 }
 
 // Consume runs this PipelineItem on the next commit data.

+ 5 - 5
leaves/couples_test.go

@@ -11,11 +11,11 @@ import (
 	"github.com/stretchr/testify/assert"
 	gitplumbing "gopkg.in/src-d/go-git.v4/plumbing"
 	"gopkg.in/src-d/go-git.v4/plumbing/object"
-	"gopkg.in/src-d/hercules.v5/internal/core"
-	"gopkg.in/src-d/hercules.v5/internal/pb"
-	"gopkg.in/src-d/hercules.v5/internal/plumbing"
-	"gopkg.in/src-d/hercules.v5/internal/plumbing/identity"
-	"gopkg.in/src-d/hercules.v5/internal/test"
+	"gopkg.in/src-d/hercules.v6/internal/core"
+	"gopkg.in/src-d/hercules.v6/internal/pb"
+	"gopkg.in/src-d/hercules.v6/internal/plumbing"
+	"gopkg.in/src-d/hercules.v6/internal/plumbing/identity"
+	"gopkg.in/src-d/hercules.v6/internal/test"
 )
 
 func fixtureCouples() *CouplesAnalysis {

+ 9 - 7
leaves/devs.go

@@ -12,11 +12,11 @@ import (
 	"gopkg.in/src-d/go-git.v4/plumbing"
 	"gopkg.in/src-d/go-git.v4/plumbing/object"
 	"gopkg.in/src-d/go-git.v4/utils/merkletrie"
-	"gopkg.in/src-d/hercules.v5/internal/core"
-	"gopkg.in/src-d/hercules.v5/internal/pb"
-	items "gopkg.in/src-d/hercules.v5/internal/plumbing"
-	"gopkg.in/src-d/hercules.v5/internal/plumbing/identity"
-	"gopkg.in/src-d/hercules.v5/internal/yaml"
+	"gopkg.in/src-d/hercules.v6/internal/core"
+	"gopkg.in/src-d/hercules.v6/internal/pb"
+	items "gopkg.in/src-d/hercules.v6/internal/plumbing"
+	"gopkg.in/src-d/hercules.v6/internal/plumbing/identity"
+	"gopkg.in/src-d/hercules.v6/internal/yaml"
 )
 
 // DevsAnalysis calculates the number of commits through time per developer.
@@ -95,13 +95,14 @@ func (devs *DevsAnalysis) ListConfigurationOptions() []core.ConfigurationOption
 }
 
 // Configure sets the properties previously published by ListConfigurationOptions().
-func (devs *DevsAnalysis) Configure(facts map[string]interface{}) {
+func (devs *DevsAnalysis) Configure(facts map[string]interface{}) error {
 	if val, exists := facts[ConfigDevsConsiderEmptyCommits].(bool); exists {
 		devs.ConsiderEmptyCommits = val
 	}
 	if val, exists := facts[identity.FactIdentityDetectorReversedPeopleDict].([]string); exists {
 		devs.reversedPeopleDict = val
 	}
+	return nil
 }
 
 // Flag for the command line switch which enables this analysis.
@@ -116,9 +117,10 @@ func (devs *DevsAnalysis) Description() string {
 
 // 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 (devs *DevsAnalysis) Initialize(repository *git.Repository) {
+func (devs *DevsAnalysis) Initialize(repository *git.Repository) error {
 	devs.days = map[int]map[int]*DevDay{}
 	devs.OneShotMergeProcessor.Initialize()
+	return nil
 }
 
 // Consume runs this PipelineItem on the next commit data.

+ 6 - 6
leaves/devs_test.go

@@ -8,12 +8,12 @@ import (
 	"github.com/stretchr/testify/assert"
 	gitplumbing "gopkg.in/src-d/go-git.v4/plumbing"
 	"gopkg.in/src-d/go-git.v4/plumbing/object"
-	"gopkg.in/src-d/hercules.v5/internal/core"
-	"gopkg.in/src-d/hercules.v5/internal/pb"
-	"gopkg.in/src-d/hercules.v5/internal/plumbing"
-	"gopkg.in/src-d/hercules.v5/internal/plumbing/identity"
-	"gopkg.in/src-d/hercules.v5/internal/test"
-	"gopkg.in/src-d/hercules.v5/internal/test/fixtures"
+	"gopkg.in/src-d/hercules.v6/internal/core"
+	"gopkg.in/src-d/hercules.v6/internal/pb"
+	"gopkg.in/src-d/hercules.v6/internal/plumbing"
+	"gopkg.in/src-d/hercules.v6/internal/plumbing/identity"
+	"gopkg.in/src-d/hercules.v6/internal/test"
+	"gopkg.in/src-d/hercules.v6/internal/test/fixtures"
 )
 
 func fixtureDevs() *DevsAnalysis {

+ 7 - 5
leaves/file_history.go

@@ -11,9 +11,9 @@ import (
 	"gopkg.in/src-d/go-git.v4/plumbing"
 	"gopkg.in/src-d/go-git.v4/plumbing/object"
 	"gopkg.in/src-d/go-git.v4/utils/merkletrie"
-	"gopkg.in/src-d/hercules.v5/internal/core"
-	"gopkg.in/src-d/hercules.v5/internal/pb"
-	items "gopkg.in/src-d/hercules.v5/internal/plumbing"
+	"gopkg.in/src-d/hercules.v6/internal/core"
+	"gopkg.in/src-d/hercules.v6/internal/pb"
+	items "gopkg.in/src-d/hercules.v6/internal/plumbing"
 )
 
 // FileHistory contains the intermediate state which is mutated by Consume(). It should implement
@@ -65,14 +65,16 @@ func (history *FileHistory) Description() string {
 }
 
 // Configure sets the properties previously published by ListConfigurationOptions().
-func (history *FileHistory) Configure(facts map[string]interface{}) {
+func (history *FileHistory) Configure(facts map[string]interface{}) error {
+	return nil
 }
 
 // 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 (history *FileHistory) Initialize(repository *git.Repository) {
+func (history *FileHistory) Initialize(repository *git.Repository) error {
 	history.files = map[string][]plumbing.Hash{}
 	history.OneShotMergeProcessor.Initialize()
+	return nil
 }
 
 // Consume runs this PipelineItem on the next commit data.

+ 4 - 4
leaves/file_history_test.go

@@ -8,10 +8,10 @@ import (
 	"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.v5/internal/core"
-	"gopkg.in/src-d/hercules.v5/internal/pb"
-	items "gopkg.in/src-d/hercules.v5/internal/plumbing"
-	"gopkg.in/src-d/hercules.v5/internal/test"
+	"gopkg.in/src-d/hercules.v6/internal/core"
+	"gopkg.in/src-d/hercules.v6/internal/pb"
+	items "gopkg.in/src-d/hercules.v6/internal/plumbing"
+	"gopkg.in/src-d/hercules.v6/internal/test"
 )
 
 func fixtureFileHistory() *FileHistory {

+ 8 - 6
leaves/shotness.go

@@ -13,10 +13,10 @@ import (
 	"gopkg.in/bblfsh/sdk.v1/uast"
 	"gopkg.in/src-d/go-git.v4"
 	"gopkg.in/src-d/go-git.v4/plumbing/object"
-	"gopkg.in/src-d/hercules.v5/internal/core"
-	"gopkg.in/src-d/hercules.v5/internal/pb"
-	items "gopkg.in/src-d/hercules.v5/internal/plumbing"
-	uast_items "gopkg.in/src-d/hercules.v5/internal/plumbing/uast"
+	"gopkg.in/src-d/hercules.v6/internal/core"
+	"gopkg.in/src-d/hercules.v6/internal/pb"
+	items "gopkg.in/src-d/hercules.v6/internal/plumbing"
+	uast_items "gopkg.in/src-d/hercules.v6/internal/plumbing/uast"
 )
 
 // ShotnessAnalysis contains the intermediate state which is mutated by Consume(). It should implement
@@ -130,7 +130,7 @@ func (shotness *ShotnessAnalysis) Description() string {
 }
 
 // Configure sets the properties previously published by ListConfigurationOptions().
-func (shotness *ShotnessAnalysis) Configure(facts map[string]interface{}) {
+func (shotness *ShotnessAnalysis) Configure(facts map[string]interface{}) error {
 	if val, exists := facts[ConfigShotnessXpathStruct]; exists {
 		shotness.XpathStruct = val.(string)
 	} else {
@@ -141,14 +141,16 @@ func (shotness *ShotnessAnalysis) Configure(facts map[string]interface{}) {
 	} else {
 		shotness.XpathName = DefaultShotnessXpathName
 	}
+	return nil
 }
 
 // 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 (shotness *ShotnessAnalysis) Initialize(repository *git.Repository) {
+func (shotness *ShotnessAnalysis) Initialize(repository *git.Repository) error {
 	shotness.nodes = map[string]*nodeShotness{}
 	shotness.files = map[string]map[string]*nodeShotness{}
 	shotness.OneShotMergeProcessor.Initialize()
+	return nil
 }
 
 // Consume runs this PipelineItem on the next commit data.

+ 6 - 7
leaves/shotness_test.go

@@ -1,22 +1,21 @@
 package leaves
 
 import (
+	"bytes"
 	"io/ioutil"
 	"path"
 	"testing"
 
-	"bytes"
-
 	"github.com/gogo/protobuf/proto"
 	"github.com/sergi/go-diff/diffmatchpatch"
 	"github.com/stretchr/testify/assert"
 	"gopkg.in/bblfsh/sdk.v1/uast"
 	"gopkg.in/src-d/go-git.v4/plumbing/object"
-	"gopkg.in/src-d/hercules.v5/internal/core"
-	"gopkg.in/src-d/hercules.v5/internal/pb"
-	items "gopkg.in/src-d/hercules.v5/internal/plumbing"
-	uast_items "gopkg.in/src-d/hercules.v5/internal/plumbing/uast"
-	"gopkg.in/src-d/hercules.v5/internal/test"
+	"gopkg.in/src-d/hercules.v6/internal/core"
+	"gopkg.in/src-d/hercules.v6/internal/pb"
+	items "gopkg.in/src-d/hercules.v6/internal/plumbing"
+	uast_items "gopkg.in/src-d/hercules.v6/internal/plumbing/uast"
+	"gopkg.in/src-d/hercules.v6/internal/test"
 )
 
 func fixtureShotness() *ShotnessAnalysis {