Go code linters for Project Contour.
$ go build -o contour-lint .
$ go vet -vetttool $(which contour-lint) ./...
To run linter and apply suggested fixes:
contour-lint ./...
consider import path: github.com/projectcontour/x/y/z/v*
- the alias name should be subset of
x[optional]_y[optional]_z[optional]_v*
where optional means it can be present or not. - one of
x
ory
orz
must be present in alias name. - If version exists in path, must be specified.
- words like
apis
should beapi
in import alias
Valid imports
import meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
import api_meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
import api_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
import envoy_api_v2_auth "github.com/envoyproxy/go-control-plane/envoy/api/v2/auth"
import envoy_config_filter_http_ext_authz_v2 "github.com/envoyproxy/go-control-plane/envoy/config/filter/http/ext_authz/v2"
import contour_api_v1 "github.com/projectcontour/contour/apis/projectcontour/v1"
import contour_api_v1alpha1 "github.com/projectcontour/contour/apis/projectcontour/v1alpha1"
import kingpin_v2 "gopkg.in/alecthomas/kingpin.v2"
import serviceapis_v1alpha1 "sigs.k8s.io/service-apis/api/v1alpha1"
Invalid imports
import v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
import meta "k8s.io/apimachinery/pkg/apis/meta/v1"
import meta_api_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
import api_meta "k8s.io/apimachinery/pkg/apis/meta/v1"
linter for log message formatting.
- that logrus log messages are not capitalized
- that kingpin command help is capitalized