Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: user general pouchlinter to linter pouch's code #2421

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 0 additions & 25 deletions .circleci/Dockerfile

This file was deleted.

20 changes: 12 additions & 8 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@ version: 2
jobs:
markdownlint-misspell-shellcheck:
docker:
# this image is build from Dockerfile located in ./.circleci/Dockerfile
- image: allencloud/pouchlint:v0.1
# this image is build from Dockerfile
# https://github.com/pouchcontainer/pouchlinter/blob/master/Dockerfile
- image: pouchcontainer/pouchlinter:v0.1
working_directory: /go/src/github.com/alibaba/pouch
steps:
- checkout
- run:
name: use markdownlint v0.4.0 to lint markdown file (https://github.com/markdownlint/markdownlint)
name: use markdownlint v0.5.0 to lint markdown file (https://github.com/markdownlint/markdownlint)
command: |
find ./ -name "*.md" | grep -v vendor | grep -v commandline | grep -v .github | grep -v swagger | grep -v api | xargs mdl -r ~MD010,~MD013,~MD024,~MD029,~MD033,~MD036
- run:
Expand All @@ -25,16 +26,19 @@ jobs:

code-check:
docker:
- image: golang:1.10.4
- image: pouchcontainer/pouchlinter:v0.1
working_directory: /go/src/github.com/alibaba/pouch
steps:
- checkout
- run:
name: install gometalinter linters tools
command: hack/install/install_ci_related.sh
name: validate swagger.yml
command: |
swagger validate "/go/src/github.com/alibaba/pouch/apis/swagger.yml"

- run:
name: use check target in Makefile to check code
command: make check
name: validate go code with gometalinter
command: |
gometalinter --disable-all --skip vendor -E gofmt -E goimports -E golint -E ineffassign -E misspell -E vet -E megacheck ./...
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one more question, could we just use make check here, since the image provides the binary?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think both are OK, while if we use make check, the calling path is a little bit long. For the test part and ci part, in my opinion, simplicity is the most important thing.


notify:
webhooks:
Expand Down
8 changes: 4 additions & 4 deletions docs/features/pouch_with_plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,10 @@ In `daemon_hook.go` define your plugin object, struct is `type daemonPlugin stru

In `init` function to register your plugin, now we provide 4 plugin to register:

* `RegisterContainerPlugin`
* `RegisterDaemonPlugin`
* `RegisterCriPlugin`
* `RegisterVolumePlugin`
* `RegisterContainerPlugin`
* `RegisterDaemonPlugin`
* `RegisterCriPlugin`
* `RegisterVolumePlugin`

In my plugin, we use `RegisterDaemonPlugin` to register a daemon plugin into pouch daemon.

Expand Down
4 changes: 2 additions & 2 deletions docs/test/test.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ For PouchContainer developer, if your code is only used in a single module, then
Tests could be run through the target provided by `Makefile` in the root directory of PouchContainer code. Also could be run manually.
To run the test automatically, the following prerequisites are needed:

* golang is installed and GOPATH and GOROOT is set correctly
* docker is installed
* golang is installed and GOPATH and GOROOT is set correctly
* docker is installed

Then you could just clone the PouchContainer source to GOPATH and run tests as following:

Expand Down