Fixed the CI tests

This commit is contained in:
Eduard Urbach 2019-04-28 01:08:34 +09:00
parent fc840296ca
commit b9c4bd748c
4 changed files with 94 additions and 89 deletions

View File

@ -46,10 +46,10 @@ script:
- pack # Pack assets - pack # Pack assets
- revive ./... # Linter - revive ./... # Linter
- go vet ./... # go vet is the official Go static analyzer - go vet ./... # go vet is the official Go static analyzer
- gocyclo -over 19 ./ # forbid code with huge functions
# - go test -v -race ./... # Run all the tests with the race detector enabled # - go test -v -race ./... # Run all the tests with the race detector enabled
# - codecoroner -ignore components funcs ./... # dead code analysis # - codecoroner -ignore components funcs ./... # dead code analysis
- staticcheck -checks all,-ST1000,-ST1005 ./... # static analysis - staticcheck -checks all,-ST1000,-ST1005 ./... # static analysis
- gocyclo -top 10 ./ # List huge functions
- make server bots jobs patches # Build - make server bots jobs patches # Build
- go test -v . # Run all the tests - go test -v . # Run all the tests

4
go.mod
View File

@ -9,7 +9,7 @@ require (
github.com/aerogo/aero v1.1.1 github.com/aerogo/aero v1.1.1
github.com/aerogo/api v0.1.3 github.com/aerogo/api v0.1.3
github.com/aerogo/crawler v0.2.0 github.com/aerogo/crawler v0.2.0
github.com/aerogo/http v1.0.0 github.com/aerogo/http v1.0.1
github.com/aerogo/layout v0.1.4 github.com/aerogo/layout v0.1.4
github.com/aerogo/log v0.1.1 github.com/aerogo/log v0.1.1
github.com/aerogo/markdown v0.1.4 github.com/aerogo/markdown v0.1.4
@ -18,7 +18,7 @@ require (
github.com/aerogo/sitemap v0.1.1 github.com/aerogo/sitemap v0.1.1
github.com/akyoto/color v1.8.1 github.com/akyoto/color v1.8.1
github.com/animenotifier/anilist v0.2.0 github.com/animenotifier/anilist v0.2.0
github.com/animenotifier/arn v1.1.5 github.com/animenotifier/arn v1.1.6
github.com/animenotifier/kitsu v0.2.0 github.com/animenotifier/kitsu v0.2.0
github.com/animenotifier/mal v0.2.0 github.com/animenotifier/mal v0.2.0
github.com/animenotifier/shoboi v0.2.0 github.com/animenotifier/shoboi v0.2.0

10
go.sum
View File

@ -38,6 +38,8 @@ github.com/aerogo/http v0.1.2 h1:3O2qhk2H5HkJg9QzMGEF7z04xRTyrD1raNV1z5QBpaY=
github.com/aerogo/http v0.1.2/go.mod h1:biG/HWNyTuOlNiyQgGTw9Vg6QFpZf5f1qsGJAocmAsI= github.com/aerogo/http v0.1.2/go.mod h1:biG/HWNyTuOlNiyQgGTw9Vg6QFpZf5f1qsGJAocmAsI=
github.com/aerogo/http v1.0.0 h1:15a7Px8wGZbmgFqJMR1kBy3fWFkDfMZWexJzxhmFKe4= github.com/aerogo/http v1.0.0 h1:15a7Px8wGZbmgFqJMR1kBy3fWFkDfMZWexJzxhmFKe4=
github.com/aerogo/http v1.0.0/go.mod h1:B1igUmMLpE6KabMpc9reHCJJNUOJ2U/PR9s1fF3TpPQ= github.com/aerogo/http v1.0.0/go.mod h1:B1igUmMLpE6KabMpc9reHCJJNUOJ2U/PR9s1fF3TpPQ=
github.com/aerogo/http v1.0.1 h1:KTzYarhp5yougurxuAhJKFh3YvZ7R7CfaDVwJv5+xIs=
github.com/aerogo/http v1.0.1/go.mod h1:B1igUmMLpE6KabMpc9reHCJJNUOJ2U/PR9s1fF3TpPQ=
github.com/aerogo/layout v0.1.4 h1:tgYR1AGONZFK0ChK3Snk93iMBhHscH10KdYcVH988Iw= github.com/aerogo/layout v0.1.4 h1:tgYR1AGONZFK0ChK3Snk93iMBhHscH10KdYcVH988Iw=
github.com/aerogo/layout v0.1.4/go.mod h1:NAfsNlQmfEPEmQkEAI47OrxCgTnE61EtAwjhuoFrqnw= github.com/aerogo/layout v0.1.4/go.mod h1:NAfsNlQmfEPEmQkEAI47OrxCgTnE61EtAwjhuoFrqnw=
github.com/aerogo/linter-performance v0.1.2 h1:eKETM6L+7PGTh40p9dtZFE4ZXIS8Fho8wDSvGQwiqB0= github.com/aerogo/linter-performance v0.1.2 h1:eKETM6L+7PGTh40p9dtZFE4ZXIS8Fho8wDSvGQwiqB0=
@ -84,12 +86,12 @@ github.com/andybalholm/cascadia v1.0.0 h1:hOCXnnZ5A+3eVDX8pvgl4kofXv2ELss0bKcqRy
github.com/andybalholm/cascadia v1.0.0/go.mod h1:GsXiBklL0woXo1j/WYWtSYYC4ouU9PqHO0sqidkEA4Y= github.com/andybalholm/cascadia v1.0.0/go.mod h1:GsXiBklL0woXo1j/WYWtSYYC4ouU9PqHO0sqidkEA4Y=
github.com/animenotifier/anilist v0.2.0 h1:ntjGlRbJIUGJaXuvE+561vwvmUA8ZyYpLLCKR3SoQ2o= github.com/animenotifier/anilist v0.2.0 h1:ntjGlRbJIUGJaXuvE+561vwvmUA8ZyYpLLCKR3SoQ2o=
github.com/animenotifier/anilist v0.2.0/go.mod h1:giZcbmITsICRCZHJ1eWcuYpQp5ZJK0gnMMaiUD0P4Yo= github.com/animenotifier/anilist v0.2.0/go.mod h1:giZcbmITsICRCZHJ1eWcuYpQp5ZJK0gnMMaiUD0P4Yo=
github.com/animenotifier/arn v1.1.5 h1:R1Mp/17v/XsHzUBCXkrKFWD5tePy06sgn5/M8AiBsL8= github.com/animenotifier/arn v1.1.6 h1:pSiKJoTH3xAaZFUS9vie913zPmV4RQQsRcfw6tL6vMI=
github.com/animenotifier/arn v1.1.5/go.mod h1:orUD7qxAoRPov0bPpehfT5xsSDdiGoZiln2BOyd91S0= github.com/animenotifier/arn v1.1.6/go.mod h1:K99a69VUMDZ9jSK211WoLaLxPHgB9tfxkKy03FUVr9c=
github.com/animenotifier/ffxiv v0.1.0 h1:N9gX5iUtD+g/KW4OjKIclS0y2WrL/+Ko9rGEFDaLf1w= github.com/animenotifier/ffxiv v0.1.0 h1:N9gX5iUtD+g/KW4OjKIclS0y2WrL/+Ko9rGEFDaLf1w=
github.com/animenotifier/ffxiv v0.1.0/go.mod h1:oBHhRzQAUv+dBe4qFJAFnTg7qv5Gl6QFHQphyJla74Q= github.com/animenotifier/ffxiv v0.1.0/go.mod h1:oBHhRzQAUv+dBe4qFJAFnTg7qv5Gl6QFHQphyJla74Q=
github.com/animenotifier/japanese v0.2.0 h1:REdBmsBGB1LY8/bnAJ3akb5W4mKzQfathGTQp1pO4K8= github.com/animenotifier/japanese v0.2.1 h1:O2Fui6+8pmdniQ+swSf+Yp276+iTrSTfvImPRclbFFU=
github.com/animenotifier/japanese v0.2.0/go.mod h1:dznbgicVFy7Ucuyu9pHT7VJv5QKS+7dgFWDnTTpaYP4= github.com/animenotifier/japanese v0.2.1/go.mod h1:HLrrnBE9ztkw9iMcVrm7DKaXydAq21UpZIp1MpKajQI=
github.com/animenotifier/kitsu v0.2.0 h1:Zzr2/GIR+KZn7elZjwtprjwCA0LCKmJ7hcMt7qGT3DM= github.com/animenotifier/kitsu v0.2.0 h1:Zzr2/GIR+KZn7elZjwtprjwCA0LCKmJ7hcMt7qGT3DM=
github.com/animenotifier/kitsu v0.2.0/go.mod h1:Mp8rgLFsGlHiSqYnLtQOWrAIs3x4HVIkKY1cXa8HHJs= github.com/animenotifier/kitsu v0.2.0/go.mod h1:Mp8rgLFsGlHiSqYnLtQOWrAIs3x4HVIkKY1cXa8HHJs=
github.com/animenotifier/mal v0.2.0 h1:v0D9Wf9W0nbIH91L6Ho8BqSECNn8XTVqc4OjyfNEyhw= github.com/animenotifier/mal v0.2.0 h1:v0D9Wf9W0nbIH91L6Ho8BqSECNn8XTVqc4OjyfNEyhw=

View File

@ -123,6 +123,20 @@ component ProfileHead(viewUser *arn.User, animeList *arn.AnimeList, user *arn.Us
.profile-introduction!= markdown.Render(viewUser.Introduction) .profile-introduction!= markdown.Render(viewUser.Introduction)
.profile-tags-container .profile-tags-container
ProfileTags(viewUser, animeList, user)
.profile-actions
if user != nil && user.ID != viewUser.ID
if !user.Follows().Contains(viewUser.ID)
button.profile-action.action.mountable.never-unmount(data-action="followUser", data-trigger="click", data-api="/api/userfollows/" + user.ID + "/add/" + viewUser.ID)
Icon("user-plus")
span Follow
else
button.profile-action.action.mountable.never-unmount(data-action="unfollowUser", data-trigger="click", data-api="/api/userfollows/" + user.ID + "/remove/" + viewUser.ID)
Icon("user-times")
span Unfollow
component ProfileTags(viewUser *arn.User, animeList *arn.AnimeList, user *arn.User)
.profile-tags .profile-tags
a.profile-tag.mountable.never-unmount(href="/+" + viewUser.Nick + "/animelist/watching", data-mountable-type="header") a.profile-tag.mountable.never-unmount(href="/+" + viewUser.Nick + "/animelist/watching", data-mountable-type="header")
Icon("list") Icon("list")
@ -204,14 +218,3 @@ component ProfileHead(viewUser *arn.User, animeList *arn.AnimeList, user *arn.Us
if user != nil && user.Role == "admin" if user != nil && user.Role == "admin"
a.profile-tag.tip.mountable.never-unmount.show-more(href="/api/user/" + viewUser.ID, aria-label="API", target="_blank", rel="noopener", data-mountable-type="header") a.profile-tag.tip.mountable.never-unmount.show-more(href="/api/user/" + viewUser.ID, aria-label="API", target="_blank", rel="noopener", data-mountable-type="header")
RawIcon("search-plus") RawIcon("search-plus")
.profile-actions
if user != nil && user.ID != viewUser.ID
if !user.Follows().Contains(viewUser.ID)
button.profile-action.action.mountable.never-unmount(data-action="followUser", data-trigger="click", data-api="/api/userfollows/" + user.ID + "/add/" + viewUser.ID)
Icon("user-plus")
span Follow
else
button.profile-action.action.mountable.never-unmount(data-action="unfollowUser", data-trigger="click", data-api="/api/userfollows/" + user.ID + "/remove/" + viewUser.ID)
Icon("user-times")
span Unfollow