Containerd: tests: add lint and vet check for PR unit tests

Created on 28 Feb 2017  路  4Comments  路  Source: containerd/containerd

This are good to keep code consistent on clean. We did this early on with SwarmKit and it yielded a solid code base. No reason we can't go forward with it here.

Please see https://github.com/docker/containerd/pull/573#issuecomment-282939338 for some opinions.

cc @samuelkarp @kunalkushwaha

Most helpful comment

I can make PR for this

All 4 comments

I can make PR for this

So it seems, all expected things to be checked before PR is already in place with make check.
It it required to be included into either make test or make all (builds binaries only).

I feel initially it should be included in make all, so it never gets skipped.

Also, in __Travis CI__ right now make ci is not run due to which these check are skipped.
Before enabling this in Makefile, need to fix all existing warnings from code.

The lint warnings are too many and most of them are for _comments for Exported struct/variables_
I think best to commented by author of files, else review of these comments itself will be tedious as all these struct/interfaces part of core design.

But also, delaying too much may lead to more volume of warnings to be fixed.

$ make check                                                                                                                                                                                   
馃惓 fmt
馃惓 bin/ctr
馃惓 bin/containerd
馃惓 bin/containerd-shim
馃惓 bin/protoc-gen-gogoctrd
馃惓 bin/dist
馃惓 bin/ctrd-protobuild
馃惓 binaries
馃惓 vet
馃惓 lint
config.go:3:6: exported type Process should have comment or be unexported
config.go:7:2: struct field Uid should be UID
config.go:12:6: exported type Config should have comment or be unexported
container.go:5:6: exported type ContainerInfo should have comment or be unexported
container.go:10:6: exported type Container should have comment or be unexported
container.go:19:6: exported type ContainerStatus should have comment or be unexported
container.go:22:2: exported const CreatedStatus should have comment (or a comment on this block) or be unexported
container.go:29:6: exported type State should have comment or be unexported
container.go:36:6: exported type ContainerMonitor should have comment or be unexported
errors.go:6:2: exported var ErrUnknownRuntime should have comment or be unexported
event.go:5:6: exported type EventType should have comment or be unexported
event.go:26:2: exported const ExitEvent should have comment (or a comment on this block) or be unexported
event.go:34:6: exported type Event should have comment or be unexported
mount.go:21:1: exported method Mount.Mount should have comment or be unexported
plugin.go:16:6: exported type PluginType should have comment or be unexported
plugin.go:19:2: exported const RuntimePlugin should have comment (or a comment on this block) or be unexported
plugin.go:23:6: exported type Registration should have comment or be unexported
plugin.go:29:6: exported type InitContext should have comment or be unexported
plugin.go:38:6: exported type Service should have comment or be unexported
plugin.go:63:1: exported function Register should have comment or be unexported
plugin.go:73:1: exported function Registrations should have comment or be unexported
runtime.go:5:6: exported type IO should have comment or be unexported
runtime.go:12:6: exported type CreateOpts should have comment or be unexported
version.go:4:2: exported var Package should have comment or be unexported
archive/tar.go:29:2: error var breakoutError should have name of the form errFoo
content/client.go:15:1: exported function NewProviderFromClient should have comment or be unexported
content/client.go:79:1: exported function NewIngesterFromClient should have comment or be unexported
content/content.go:17:2: exported var BufPool should have comment or be unexported
content/content.go:24:6: exported type Info should have comment or be unexported
content/content.go:30:6: exported type Provider should have comment or be unexported
content/content.go:34:6: exported type Status should have comment or be unexported
content/content.go:42:6: exported type Writer should have comment or be unexported
content/content.go:50:6: exported type Ingester should have comment or be unexported
content/content.go:54:1: exported function IsNotFound should have comment or be unexported
content/content.go:58:1: exported function IsExists should have comment or be unexported
content/content_test.go:206:1: context.Context should be the first parameter of a function
content/content_test.go:271:1: context.Context should be the first parameter of a function
content/store.go:29:1: exported function NewStore should have comment or be unexported
content/store.go:39:1: exported method Store.Info should have comment or be unexported
content/store.go:57:1: comment on exported method Store.Reader should be of the form "Reader ..."
content/store.go:78:1: receiver name cs should be consistent with previous receiver name s for Store
content/store.go:99:1: exported method Store.Walk should have comment or be unexported
content/store.go:99:1: receiver name cs should be consistent with previous receiver name s for Store
content/store.go:141:1: comment on exported method Store.Status should be of the form "Status ..."
content/store.go:308:1: exported method Store.Active should have comment or be unexported
content/store.go:345:1: receiver name cs should be consistent with previous receiver name s for Store
content/writer.go:124:1: receiver name cw should be consistent with previous receiver name w for writer
events/events.go:3:6: exported type Event should have comment or be unexported
events/events.go:5:6: exported type Envelope should have comment or be unexported
events/poster.go:11:2: exported var G should have comment or be unexported
events/poster.go:21:1: exported function WithPoster should have comment or be unexported
events/poster.go:25:1: exported function GetPoster should have comment or be unexported
fs/diff_test.go:297:20: exported func Add returns unexported type fs.testChange, which can be annoying to use
fs/diff_test.go:304:23: exported func Delete returns unexported type fs.testChange, which can be annoying to use
fs/diff_test.go:311:23: exported func Modify returns unexported type fs.testChange, which can be annoying to use
fs/fstest/file.go:94:1: exported function SetXAttr should have comment or be unexported
linux/container.go:9:6: exported type State should have comment or be unexported
linux/container.go:14:1: exported method State.Pid should have comment or be unexported
linux/container.go:18:1: exported method State.Status should have comment or be unexported
linux/container.go:22:6: exported type Container should have comment or be unexported
linux/container.go:28:1: exported method Container.Info should have comment or be unexported
linux/container.go:35:1: exported method Container.Start should have comment or be unexported
linux/container.go:40:1: exported method Container.State should have comment or be unexported
linux/runtime.go:33:1: exported function New should have comment or be unexported
linux/runtime.go:47:6: exported type Runtime should have comment or be unexported
linux/runtime.go:55:1: exported method Runtime.Create should have comment or be unexported
linux/runtime.go:95:1: exported method Runtime.Delete should have comment or be unexported
linux/runtime.go:107:1: exported method Runtime.Containers should have comment or be unexported
linux/runtime.go:126:1: exported method Runtime.Events should have comment or be unexported
linux/shim/service.go:27:6: exported type Service should have comment or be unexported
linux/shim/service.go:37:1: exported method Service.Create should have comment or be unexported
linux/shim/service.go:59:1: exported method Service.Start should have comment or be unexported
linux/shim/service.go:71:1: exported method Service.Delete should have comment or be unexported
linux/shim/service.go:89:1: exported method Service.Exec should have comment or be unexported
linux/shim/service.go:109:1: exported method Service.Pty should have comment or be unexported
linux/shim/service.go:129:1: exported method Service.Events should have comment or be unexported
linux/shim/service.go:138:1: exported method Service.State should have comment or be unexported
linux/shim/service.go:163:1: exported method Service.Pause should have comment or be unexported
linux/shim/service.go:170:1: exported method Service.Resume should have comment or be unexported
linux/shim/service.go:177:1: exported method Service.Exit should have comment or be unexported
linux/shim/service.go:185:1: exported method Service.ProcessExit should have comment or be unexported
remotes/remote.go:8:6: exported type Fetcher should have comment or be unexported
remotes/remote.go:39:1: exported method FetcherFunc.Fetch should have comment or be unexported
remotes/resolver.go:15:6: exported type ResolverFunc should have comment or be unexported
remotes/resolver.go:17:1: exported method ResolverFunc.Resolve should have comment or be unexported
rootfs/apply.go:19:6: exported type Mounter should have comment or be unexported
services/content/service.go:19:6: exported type Service should have comment or be unexported
services/content/service.go:32:1: exported function NewService should have comment or be unexported
services/content/service.go:38:1: exported method Service.Register should have comment or be unexported
services/content/service.go:43:1: exported method Service.Info should have comment or be unexported
services/content/service.go:60:1: exported method Service.Delete should have comment or be unexported
services/content/service.go:319:1: exported method Service.Status should have comment or be unexported
services/execution/service.go:26:1: exported function New should have comment or be unexported
services/execution/service.go:38:6: exported type Service should have comment or be unexported
services/execution/service.go:46:1: exported method Service.Register should have comment or be unexported
services/execution/service.go:61:1: exported method Service.Create should have comment or be unexported
services/execution/service.go:108:1: exported method Service.Start should have comment or be unexported
services/execution/service.go:119:1: exported method Service.Delete should have comment or be unexported
services/execution/service.go:158:1: exported method Service.Info should have comment or be unexported
services/execution/service.go:166:1: exported method Service.List should have comment or be unexported
services/execution/service.go:180:1: exported method Service.Events should have comment or be unexported
snapshot/btrfs/btrfs.go:18:6: exported type Snapshotter should have comment or be unexported
snapshot/btrfs/btrfs.go:23:1: exported function NewSnapshotter should have comment or be unexported
snapshot/btrfs/btrfs.go:123:1: exported method Snapshotter.Prepare should have comment or be unexported
snapshot/btrfs/btrfs.go:127:1: exported method Snapshotter.View should have comment or be unexported
snapshot/btrfs/btrfs.go:202:1: exported method Snapshotter.Commit should have comment or be unexported
snapshot/naive/naive.go:14:6: exported type Naive should have comment or be unexported
snapshot/naive/naive.go:28:1: exported function NewNaive should have comment or be unexported
snapshot/naive/naive.go:105:1: exported method Naive.Rollback should have comment or be unexported
snapshot/naive/naive.go:115:1: exported method Naive.Parent should have comment or be unexported
snapshot/overlay/overlay.go:18:6: exported type Snapshotter should have comment or be unexported
snapshot/overlay/overlay.go:23:1: exported function NewSnapshotter should have comment or be unexported
snapshot/overlay/overlay.go:104:1: exported method Snapshotter.Prepare should have comment or be unexported
snapshot/overlay/overlay.go:117:1: exported method Snapshotter.View should have comment or be unexported
snapshot/overlay/overlay.go:139:1: exported method Snapshotter.Commit should have comment or be unexported
sys/prctl.go:3:1: package comment should be of the form "Package sys ..."
Makefile:77: recipe for target 'lint' failed
make: *** [lint] Error 1

make lint still doesn't pass, and is not activated on the CI reopening

Was this page helpful?
0 / 5 - 0 ratings