fixed travis, added vet and staticcheck in makefile, modified READMEs
This commit is contained in:
parent
3d80f7375c
commit
eea341407d
39
.travis.yml
39
.travis.yml
@ -1,10 +1,10 @@
|
|||||||
# https://docs.travis-ci.com/user/reference/overview/#virtualisation-environment-vs-operating-system
|
# https://docs.travis-ci.com/user/reference/overview/#virtualisation-environment-vs-operating-system
|
||||||
sudo: false
|
sudo: false
|
||||||
dist: trusty
|
dist: xenial
|
||||||
|
|
||||||
language: go
|
language: go
|
||||||
go:
|
go:
|
||||||
- "1.10"
|
- "1.11"
|
||||||
|
|
||||||
# Only clone the most recent commit.
|
# Only clone the most recent commit.
|
||||||
git:
|
git:
|
||||||
@ -16,41 +16,26 @@ env:
|
|||||||
before_install:
|
before_install:
|
||||||
# Dump environment variables
|
# Dump environment variables
|
||||||
- printenv
|
- printenv
|
||||||
# Download the binary to bin folder in $GOPATH
|
# Download dep binary to bin folder in $GOPATH
|
||||||
- curl -L -s https://github.com/golang/dep/releases/download/v${DEP_VERSION}/dep-linux-amd64 -o $GOPATH/bin/dep
|
- curl -L -s https://github.com/golang/dep/releases/download/v${DEP_VERSION}/dep-linux-amd64 -o $GOPATH/bin/dep
|
||||||
# Make the binary executable
|
# Make the binary executable
|
||||||
- chmod +x $GOPATH/bin/dep
|
- chmod +x $GOPATH/bin/dep
|
||||||
|
|
||||||
install:
|
install:
|
||||||
- "go get -u github.com/jteeuwen/go-bindata/..."
|
- "go get -u -v github.com/kevinburke/go-bindata/..."
|
||||||
- "dep ensure"
|
- "go get -u -v honnef.co/go/tools/cmd/staticcheck"
|
||||||
|
- "make ensure"
|
||||||
|
|
||||||
before_script:
|
before_script:
|
||||||
- "go-bindata
|
- "make magneticod"
|
||||||
-o=\"${GOPATH}/src/github.com/boramalper/magnetico/cmd/magneticow/bindata.go\"
|
- "make magneticow"
|
||||||
-prefix=\"${GOPATH}/src/github.com/boramalper/magnetico/cmd/magneticow/data/\"
|
|
||||||
${GOPATH}/src/github.com/boramalper/magnetico/cmd/magneticow/data/..."
|
|
||||||
|
|
||||||
script:
|
script:
|
||||||
# The Unit Tests
|
# The Unit Tests
|
||||||
- "go test github.com/boramalper/magnetico/cmd/magneticod/..."
|
- "make test"
|
||||||
- "go test github.com/boramalper/magnetico/cmd/magneticow/..."
|
|
||||||
- "go test github.com/boramalper/magnetico/pkg/persistence/..."
|
|
||||||
|
|
||||||
# Static Analysis (vet)
|
# Static Analysis (vet)
|
||||||
- "go vet github.com/boramalper/magnetico/cmd/magneticod/..."
|
- "make vet"
|
||||||
- "go vet github.com/boramalper/magnetico/cmd/magneticow/..."
|
|
||||||
- "go vet github.com/boramalper/magnetico/pkg/persistence/..."
|
|
||||||
|
|
||||||
# Formatting Errors
|
# Check formatting
|
||||||
#
|
- "make check-formatting"
|
||||||
# Since gofmt returns zero even if there are files to be formatted, we use:
|
|
||||||
#
|
|
||||||
# ! gofmt -d ${GOPATH}/path/ 2>&1 | read
|
|
||||||
#
|
|
||||||
# to return 1 if there are files to be formatted, and 0 if not.
|
|
||||||
#
|
|
||||||
# https://groups.google.com/forum/#!topic/Golang-Nuts/pdrN4zleUio
|
|
||||||
- "! gofmt -l ${GOPATH}/src/github.com/boramalper/magnetico/cmd/magneticod/ 2>&1 | read"
|
|
||||||
- "! gofmt -l ${GOPATH}/src/github.com/boramalper/magnetico/cmd/magneticow/ 2>&1 | read"
|
|
||||||
- "! gofmt -l ${GOPATH}/src/github.com/boramalper/magnetico/pkg/persistence/ 2>&1 | read"
|
|
||||||
|
37
Makefile
37
Makefile
@ -1,4 +1,4 @@
|
|||||||
.PHONY: test format magneticod magneticow ensure test-magneticod test-magneticow test-persistence image image-magneticow image-magneticod
|
.PHONY: test format vet staticcheck magneticod magneticow ensure image image-magneticow image-magneticod
|
||||||
|
|
||||||
all: test magneticod magneticow
|
all: test magneticod magneticow
|
||||||
|
|
||||||
@ -23,19 +23,32 @@ image: image-magneticod image-magneticow
|
|||||||
ensure:
|
ensure:
|
||||||
dep ensure -v
|
dep ensure -v
|
||||||
|
|
||||||
test-magneticod:
|
vet:
|
||||||
go test github.com/boramalper/magnetico/cmd/magneticod/...
|
go vet github.com/boramalper/magnetico/...
|
||||||
|
|
||||||
test-magneticow:
|
staticcheck:
|
||||||
go test github.com/boramalper/magnetico/cmd/magneticow/...
|
staticcheck github.com/boramalper/magnetico/...
|
||||||
|
|
||||||
test-persistence:
|
test:
|
||||||
go test github.com/boramalper/magnetico/pkg/persistence/...
|
go test github.com/boramalper/magnetico/...
|
||||||
|
|
||||||
test: test-persistence test-magneticod test-magneticow
|
|
||||||
|
|
||||||
format:
|
format:
|
||||||
gofmt -w cmd/magneticod
|
gofmt -w ${GOPATH}/src/github.com/boramalper/magnetico/cmd/
|
||||||
gofmt -w cmd/magneticow
|
gofmt -w ${GOPATH}/src/github.com/boramalper/magnetico/pkg/
|
||||||
gofmt -w pkg/persistence
|
|
||||||
|
|
||||||
|
# Formatting Errors
|
||||||
|
# Since gofmt returns zero even if there are files to be formatted, we use:
|
||||||
|
#
|
||||||
|
# ! gofmt -d ${GOPATH}/path/ 2>&1 | read
|
||||||
|
#
|
||||||
|
# to return 1 if there are files to be formatted, and 0 if not.
|
||||||
|
# https://groups.google.com/forum/#!topic/Golang-Nuts/pdrN4zleUio
|
||||||
|
#
|
||||||
|
# How can I use Bash syntax in Makefile targets?
|
||||||
|
# Because `read` is a bash command.
|
||||||
|
# https://stackoverflow.com/a/589300/4466589
|
||||||
|
#
|
||||||
|
check-formatting: SHELL:=/bin/bash # HERE: this is setting the shell for check-formatting only
|
||||||
|
check-formatting:
|
||||||
|
! gofmt -l ${GOPATH}/src/github.com/boramalper/magnetico/cmd/ 2>&1 | tee /dev/fd/2 | read
|
||||||
|
! gofmt -l ${GOPATH}/src/github.com/boramalper/magnetico/pkg/ 2>&1 | tee /dev/fd/2 | read
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
# magnetico
|
# magnetico
|
||||||
*Autonomous (self-hosted) BitTorrent DHT search engine suite.*
|
*Autonomous (self-hosted) BitTorrent DHT search engine suite.*
|
||||||
|
|
||||||
[![chat on gitter](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/magnetico-dev/magnetico-dev) [![Build Status on Travis CI](https://travis-ci.org/boramalper/magnetico.svg?branch=go-rewrite)](https://travis-ci.org/boramalper/magnetico) [![Build status on AppVeyor](https://ci.appveyor.com/api/projects/status/u2jtbe6jutya7p0x/branch/go-rewrite?svg=true)](https://ci.appveyor.com/project/boramalper/magnetico/branch/go-rewrite)
|
[![chat on gitter](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/magnetico-dev/magnetico-dev) [![Build Status on Travis CI](https://travis-ci.org/boramalper/magnetico.svg?branch=go-rewrite)](https://travis-ci.org/boramalper/magnetico) [![Build status on AppVeyor](https://ci.appveyor.com/api/projects/status/u2jtbe6jutya7p0x/branch/go-rewrite?svg=true)](https://ci.appveyor.com/project/boramalper/magnetico/branch/go-rewrite)
|
||||||
|
|
||||||
magnetico is the first autonomous (self-hosted) BitTorrent DHT search engine suite that is *designed
|
magnetico is the first autonomous (self-hosted) BitTorrent DHT search engine suite that is *designed
|
||||||
for end-users*. The suite consists of two packages:
|
for end-users*. The suite consists of two packages:
|
||||||
|
7
pkg/README.md
Normal file
7
pkg/README.md
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
# magnetico/pkg
|
||||||
|
[![GoDoc](https://godoc.org/github.com/boramalper/magnetico?status.svg)](https://godoc.org/github.com/boramalper/magnetico)
|
||||||
|
|
||||||
|
- The most significant package is `persistence`, that abstracts access to the
|
||||||
|
magnetico databases with different engines (currently, only SQLite).
|
||||||
|
|
||||||
|
**For REST-ful magneticow API, see [https://app.swaggerhub.com/apis/boramalper/magneticow-api/](https://app.swaggerhub.com/apis/boramalper/magneticow-api/).**
|
Loading…
Reference in New Issue
Block a user