Skip to content

Commit cca79e6

Browse files
authored
Merge pull request etcd-io#20818 from ivanvc/replace-addlicense-with-golanci-lint-goheader
Replace addlicense with golanci lint goheader
2 parents 6a8e06b + c05638f commit cca79e6

File tree

26 files changed

+171
-70
lines changed

26 files changed

+171
-70
lines changed

Makefile

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,7 @@ fuzz:
9696

9797
# Static analysis
9898
.PHONY: verify
99-
verify: verify-bom verify-lint verify-dep verify-shellcheck \
100-
verify-license-header verify-mod-tidy \
99+
verify: verify-bom verify-lint verify-dep verify-shellcheck verify-mod-tidy \
101100
verify-shellws verify-proto-annotations verify-genproto verify-yamllint \
102101
verify-markdown-marker verify-go-versions verify-gomodguard \
103102
verify-go-workspace
@@ -130,10 +129,6 @@ fix-lint:
130129
verify-shellcheck:
131130
PASSES="shellcheck" ./scripts/test.sh
132131

133-
.PHONY: verify-license-header
134-
verify-license-header:
135-
PASSES="license_header" ./scripts/test.sh
136-
137132
.PHONY: verify-mod-tidy
138133
verify-mod-tidy:
139134
PASSES="mod_tidy" ./scripts/test.sh

client/pkg/logutil/zap_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// you may not use this file except in compliance with the License.
55
// You may obtain a copy of the License at
66
//
7-
// http://www.apache.org/licenses/LICENSE-2.0
7+
// http://www.apache.org/licenses/LICENSE-2.0
88
//
99
// Unless required by applicable law or agreed to in writing, software
1010
// distributed under the License is distributed on an "AS IS" BASIS,

client/pkg/pathutil/path.go

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
1-
// Copyright 2009 The Go Authors. All rights reserved.
2-
// Use of this source code is governed by a BSD-style
3-
// license that can be found in the LICENSE file.
1+
// Copyright 2025 The etcd Authors
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
414

515
// Package pathutil implements utility functions for handling slash-separated
616
// paths.

client/pkg/testutil/leak.go

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
1-
// Copyright 2013 The Go Authors. All rights reserved.
2-
// Use of this source code is governed by a BSD-style
3-
// license that can be found in the LICENSE file.
1+
// Copyright 2025 The etcd Authors
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
414

515
package testutil
616

pkg/crc/crc.go

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
1-
// Copyright 2009 The Go Authors. All rights reserved.
2-
// Use of this source code is governed by a BSD-style
3-
// license that can be found in the LICENSE file.
1+
// Copyright 2025 The etcd Authors
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
414

515
// Package crc provides utility function for cyclic redundancy check
616
// algorithms.

pkg/crc/crc_test.go

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
1-
// Copyright 2009 The Go Authors. All rights reserved.
2-
// Use of this source code is governed by a BSD-style
3-
// license that can be found in the LICENSE file.
1+
// Copyright 2025 The etcd Authors
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
414

515
package crc
616

scripts/test.sh

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -410,18 +410,6 @@ function lint_fix_pass {
410410
run_for_all_workspace_modules golangci-lint run --config "${ETCD_ROOT_DIR}/tools/.golangci.yaml" --fix
411411
}
412412

413-
function license_header_per_module {
414-
# bash 3.x compatible replacement of: mapfile -t gofiles < <(go_srcs_in_module)
415-
local gofiles=()
416-
while IFS= read -r line; do gofiles+=("$line"); done < <(go_srcs_in_module)
417-
run_go_tool "github.com/google/addlicense" --check "${gofiles[@]}"
418-
}
419-
420-
function license_header_pass {
421-
run_for_modules generic_checker license_header_per_module
422-
}
423-
424-
425413
function bom_pass {
426414
log_callout "Checking bill of materials..."
427415
# https://github.com/golang/go/commit/7c388cc89c76bc7167287fb488afcaf5a4aa12bf

scripts/test_lib.sh

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,6 @@ set_root_dir
3232

3333
#### Discovery of files/packages within a go module #####
3434

35-
# go_srcs_in_module
36-
# returns list of all not-generated go sources in the current (dir) module.
37-
function go_srcs_in_module {
38-
go list -f "{{with \$c:=.}}{{range \$f:=\$c.GoFiles }}{{\$c.Dir}}/{{\$f}}{{\"\n\"}}{{end}}{{range \$f:=\$c.TestGoFiles }}{{\$c.Dir}}/{{\$f}}{{\"\n\"}}{{end}}{{range \$f:=\$c.XTestGoFiles }}{{\$c.Dir}}/{{\$f}}{{\"\n\"}}{{end}}{{end}}" ./... | grep -vE "(\\.pb\\.go|\\.pb\\.gw.go)"
39-
}
40-
4135
# pkgs_in_module [optional:package_pattern]
4236
# returns list of all packages in the current (dir) module.
4337
# if the package_pattern is given, its being resolved.

server/auth/main_test.go

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
1-
// Copyright 2013 The Go Authors. All rights reserved.
2-
// Use of this source code is governed by a BSD-style
3-
// license that can be found in the LICENSE file.
1+
// Copyright 2025 The etcd Authors
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
414

515
package auth
616

server/etcdmain/help.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// Copyright 2015 The etcd Authors
2-
// Copyright 2015 The etcd Authors
32
//
43
// Licensed under the Apache License, Version 2.0 (the "License");
54
// you may not use this file except in compliance with the License.

0 commit comments

Comments
 (0)