Skip to content
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
7 changes: 7 additions & 0 deletions .github/workflows/build_and_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ jobs:
- uses: ./tools/github-actions/setup-deps
- run: make -k gen-check

license-check:
Copy link
Copy Markdown
Contributor

@arkodg arkodg Oct 18, 2022

Choose a reason for hiding this comment

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

nit: if we have more of these, we should consider creating check and add licencse-check and gen-check under it

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, I went back and forth on breaking this out, but decided three should be the critical number. Does that seem okay?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

sg thanks for sharing the thought process

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The GNU convention is that check runs the test suite.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

On the other side, I'd argue that this should be part of the existing make lint.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'm going to leave this as-is for now, so that we can have proper licensing for our first big public release. I'm happy for targets to move around at a later date though.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Since we're at the v0.2.0 release date, we can iterate to improve in v0.3.0.

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./tools/github-actions/setup-deps
- run: make -k licensecheck

build-and-test:
runs-on: ubuntu-latest
needs: [lint, gen-check]
Expand Down
46 changes: 46 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
run:
deadline: 10m

linters:
enable:
- bodyclose
- gofmt
- goimports
- revive
- gosec
- misspell
- scopelint
- unconvert
- unparam
- goheader
- gocritic

linters-settings:
gofmt:
simplify: true
unparam:
check-exported: false
goheader:
# Note that because the format is different (this needs no comment markers),
# updating this text means also updating /tools/boilerplate.txt so that
# `make generate` will update the generated files correctly.
template: |-
Copyright Envoy Gateway Authors
SPDX-License-Identifier: Apache-2.0
The full text of the Apache license is available in the LICENSE file at
the root of the repo.

issues:
exclude-rules:
- path: zz_generated
linters:
- goimports
- linters:
- staticcheck
text: "SA1019:"
- path: test/e2e
linters:
- bodyclose
# Show the complete output
max-issues-per-linter: 0
max-same-issues: 0
5 changes: 5 additions & 0 deletions api/config/v1alpha1/envoygateway_types.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
// Copyright Envoy Gateway Authors
// SPDX-License-Identifier: Apache-2.0
// The full text of the Apache license is available in the LICENSE file at
// the root of the repo.

package v1alpha1

import (
Expand Down
5 changes: 5 additions & 0 deletions api/config/v1alpha1/envoyproxy_types.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
// Copyright Envoy Gateway Authors
// SPDX-License-Identifier: Apache-2.0
// The full text of the Apache license is available in the LICENSE file at
// the root of the repo.

package v1alpha1

import (
Expand Down
5 changes: 5 additions & 0 deletions api/config/v1alpha1/groupversion_info.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
// Copyright Envoy Gateway Authors
// SPDX-License-Identifier: Apache-2.0
// The full text of the Apache license is available in the LICENSE file at
// the root of the repo.

// Package v1alpha1 contains API Schema definitions for the config v1alpha1 API group.
//
//+kubebuilder:object:generate=true
Expand Down
5 changes: 5 additions & 0 deletions api/config/v1alpha1/helpers.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
// Copyright Envoy Gateway Authors
// SPDX-License-Identifier: Apache-2.0
// The full text of the Apache license is available in the LICENSE file at
// the root of the repo.

package v1alpha1

import (
Expand Down
5 changes: 5 additions & 0 deletions api/config/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 4 additions & 13 deletions cmd/envoy-gateway/main.go
Original file line number Diff line number Diff line change
@@ -1,16 +1,7 @@
// Copyright The Envoy Project Authors

// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at

// http://www.apache.org/licenses/LICENSE-2.0

// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Copyright Envoy Gateway Authors
// SPDX-License-Identifier: Apache-2.0
// The full text of the Apache license is available in the LICENSE file at
// the root of the repo.

package main

Expand Down
5 changes: 5 additions & 0 deletions internal/cmd/certgen.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
// Copyright Envoy Gateway Authors
// SPDX-License-Identifier: Apache-2.0
// The full text of the Apache license is available in the LICENSE file at
// the root of the repo.

package cmd

import (
Expand Down
5 changes: 5 additions & 0 deletions internal/cmd/certgen_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
// Copyright Envoy Gateway Authors
// SPDX-License-Identifier: Apache-2.0
// The full text of the Apache license is available in the LICENSE file at
// the root of the repo.

package cmd

import (
Expand Down
17 changes: 4 additions & 13 deletions internal/cmd/root.go
Original file line number Diff line number Diff line change
@@ -1,16 +1,7 @@
// Copyright The Envoy Project Authors

// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at

// http://www.apache.org/licenses/LICENSE-2.0

// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Copyright Envoy Gateway Authors
// SPDX-License-Identifier: Apache-2.0
// The full text of the Apache license is available in the LICENSE file at
// the root of the repo.

package cmd

Expand Down
17 changes: 4 additions & 13 deletions internal/cmd/root_test.go
Original file line number Diff line number Diff line change
@@ -1,16 +1,7 @@
// Copyright The Envoy Project Authors

// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at

// http://www.apache.org/licenses/LICENSE-2.0

// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Copyright Envoy Gateway Authors
// SPDX-License-Identifier: Apache-2.0
// The full text of the Apache license is available in the LICENSE file at
// the root of the repo.

package cmd

Expand Down
5 changes: 5 additions & 0 deletions internal/cmd/server.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
// Copyright Envoy Gateway Authors
// SPDX-License-Identifier: Apache-2.0
// The full text of the Apache license is available in the LICENSE file at
// the root of the repo.

package cmd

import (
Expand Down
17 changes: 4 additions & 13 deletions internal/cmd/server_test.go
Original file line number Diff line number Diff line change
@@ -1,16 +1,7 @@
// Copyright The Envoy Project Authors

// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at

// http://www.apache.org/licenses/LICENSE-2.0

// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Copyright Envoy Gateway Authors
// SPDX-License-Identifier: Apache-2.0
// The full text of the Apache license is available in the LICENSE file at
// the root of the repo.

package cmd

Expand Down
5 changes: 5 additions & 0 deletions internal/cmd/versions.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
// Copyright Envoy Gateway Authors
// SPDX-License-Identifier: Apache-2.0
// The full text of the Apache license is available in the LICENSE file at
// the root of the repo.

package cmd

import (
Expand Down
5 changes: 5 additions & 0 deletions internal/cmd/xdstest.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
// Copyright Envoy Gateway Authors
// SPDX-License-Identifier: Apache-2.0
// The full text of the Apache license is available in the LICENSE file at
// the root of the repo.

package cmd

import (
Expand Down
5 changes: 5 additions & 0 deletions internal/crypto/certgen.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
// Copyright Envoy Gateway Authors
// SPDX-License-Identifier: Apache-2.0
// The full text of the Apache license is available in the LICENSE file at
// the root of the repo.

package crypto

import (
Expand Down
5 changes: 5 additions & 0 deletions internal/crypto/certgen_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
// Copyright Envoy Gateway Authors
// SPDX-License-Identifier: Apache-2.0
// The full text of the Apache license is available in the LICENSE file at
// the root of the repo.

package crypto

import (
Expand Down
5 changes: 5 additions & 0 deletions internal/envoygateway/config/config.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
// Copyright Envoy Gateway Authors
// SPDX-License-Identifier: Apache-2.0
// The full text of the Apache license is available in the LICENSE file at
// the root of the repo.

package config

import (
Expand Down
5 changes: 5 additions & 0 deletions internal/envoygateway/config/decoder.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
// Copyright Envoy Gateway Authors
// SPDX-License-Identifier: Apache-2.0
// The full text of the Apache license is available in the LICENSE file at
// the root of the repo.

package config

import (
Expand Down
5 changes: 5 additions & 0 deletions internal/envoygateway/config/decoder_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
// Copyright Envoy Gateway Authors
// SPDX-License-Identifier: Apache-2.0
// The full text of the Apache license is available in the LICENSE file at
// the root of the repo.

package config

import (
Expand Down
5 changes: 5 additions & 0 deletions internal/envoygateway/scheme.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
// Copyright Envoy Gateway Authors
// SPDX-License-Identifier: Apache-2.0
// The full text of the Apache license is available in the LICENSE file at
// the root of the repo.

package envoygateway

import (
Expand Down
5 changes: 5 additions & 0 deletions internal/gatewayapi/contexts.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
// Copyright Envoy Gateway Authors
// SPDX-License-Identifier: Apache-2.0
// The full text of the Apache license is available in the LICENSE file at
// the root of the repo.

package gatewayapi

import (
Expand Down
5 changes: 5 additions & 0 deletions internal/gatewayapi/contexts_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
// Copyright Envoy Gateway Authors
// SPDX-License-Identifier: Apache-2.0
// The full text of the Apache license is available in the LICENSE file at
// the root of the repo.

package gatewayapi

import (
Expand Down
5 changes: 5 additions & 0 deletions internal/gatewayapi/helpers.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
// Copyright Envoy Gateway Authors
// SPDX-License-Identifier: Apache-2.0
// The full text of the Apache license is available in the LICENSE file at
// the root of the repo.

package gatewayapi

import (
Expand Down
11 changes: 10 additions & 1 deletion internal/gatewayapi/helpers_v1alpha2.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
// Portions of this code are based on code from Contour.
// Copyright Envoy Gateway Authors
// SPDX-License-Identifier: Apache-2.0
// The full text of the Apache license is available in the LICENSE file at
// the root of the repo.

// This file contains code derived from Contour,
// https://github.com/projectcontour/contour
// and is provided here subject to the following:
// Copyright Project Contour Authors
// SPDX-License-Identifier: Apache-2.0

package gatewayapi

Expand Down
5 changes: 5 additions & 0 deletions internal/gatewayapi/runner/runner.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
// Copyright Envoy Gateway Authors
// SPDX-License-Identifier: Apache-2.0
// The full text of the Apache license is available in the LICENSE file at
// the root of the repo.

package runner

import (
Expand Down
5 changes: 5 additions & 0 deletions internal/gatewayapi/runner/runner_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
// Copyright Envoy Gateway Authors
// SPDX-License-Identifier: Apache-2.0
// The full text of the Apache license is available in the LICENSE file at
// the root of the repo.

package runner

import (
Expand Down
5 changes: 5 additions & 0 deletions internal/gatewayapi/sort.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
// Copyright Envoy Gateway Authors
// SPDX-License-Identifier: Apache-2.0
// The full text of the Apache license is available in the LICENSE file at
// the root of the repo.

package gatewayapi

import (
Expand Down
5 changes: 5 additions & 0 deletions internal/gatewayapi/translator.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
// Copyright Envoy Gateway Authors
// SPDX-License-Identifier: Apache-2.0
// The full text of the Apache license is available in the LICENSE file at
// the root of the repo.

package gatewayapi

import (
Expand Down
5 changes: 5 additions & 0 deletions internal/gatewayapi/translator_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
// Copyright Envoy Gateway Authors
// SPDX-License-Identifier: Apache-2.0
// The full text of the Apache license is available in the LICENSE file at
// the root of the repo.

package gatewayapi

import (
Expand Down
5 changes: 5 additions & 0 deletions internal/infrastructure/kubernetes/configmap.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
// Copyright Envoy Gateway Authors
// SPDX-License-Identifier: Apache-2.0
// The full text of the Apache license is available in the LICENSE file at
// the root of the repo.

package kubernetes

import (
Expand Down
5 changes: 5 additions & 0 deletions internal/infrastructure/kubernetes/configmap_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
// Copyright Envoy Gateway Authors
// SPDX-License-Identifier: Apache-2.0
// The full text of the Apache license is available in the LICENSE file at
// the root of the repo.

package kubernetes

import (
Expand Down
Loading