Starting with a simple travis file

This commit is contained in:
Eduard Urbach 2018-04-26 01:46:26 +02:00
parent e90873b64f
commit 4b423f036a
2 changed files with 10 additions and 2 deletions

View File

@ -39,7 +39,8 @@ before_script:
# in a modern Go project.
script:
- test -z $(gofmt -s -l $GO_FILES) # Fail if a .go file hasn't been formatted with gofmt
- go test -v -race ./... # Run all the tests with the race detector enabled
# - go test -v . # Run all the tests
# - go test -v -race ./... # Run all the tests with the race detector enabled
- go vet ./... # go vet is the official Go static analyzer
- megacheck ./... # "go vet on steroids" + linter
- gocyclo -over 19 $GO_FILES # forbid code with huge functions

View File

@ -79,6 +79,13 @@ func CompareMAL(ctx *aero.Context) string {
return aPop > bPop
})
comparisons := compare(animes)
return ctx.HTML(components.CompareMAL(comparisons, year, status, typ, "/editor/mal/diff/anime", user))
}
// compare builds the comparisons to MAL anime entries.
func compare(animes []*arn.Anime) []*utils.MALComparison {
comparisons := []*utils.MALComparison{}
malAnimeCollection := arn.MAL.Collection("Anime")
@ -225,5 +232,5 @@ func CompareMAL(ctx *aero.Context) string {
}
}
return ctx.HTML(components.CompareMAL(comparisons, year, status, typ, "/editor/mal/diff/anime", user))
return comparisons
}