lint

command module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 3, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

README

lint

Go code linters for Project Contour.

running

$ go build -o contour-lint .
$ go vet -vetttool $(which contour-lint) ./...

To run linter and apply suggested fixes:

contour-lint ./...

linters

importalias

consider import path: github.com/projectcontour/x/y/z/v*

  1. the alias name should be subset of x[optional]_y[optional]_z[optional]_v* where optional means it can be present or not.
  2. one of x or y or z must be present in alias name.
  3. If version exists in path, must be specified.
  4. words like apis should be api in import alias
Example

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"
messagefmt

linter for log message formatting.

  • that logrus log messages are not capitalized
  • that kingpin command help is capitalized

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL