Skip to content

Commit

Permalink
*: use spdx ident (#298)
Browse files Browse the repository at this point in the history
  • Loading branch information
xhebox authored Jun 2, 2023
1 parent 8d06a7a commit b2b6cdc
Show file tree
Hide file tree
Showing 126 changed files with 253 additions and 1,602 deletions.
6 changes: 6 additions & 0 deletions .go-header.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
values:
const:
COMPANY: PingCAP, Inc.
template: |-
Copyright {{YEAR}} {{COMPANY}}
SPDX-License-Identifier: Apache-2.0
12 changes: 9 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,15 @@ cmd_%:
golangci-lint:
GOBIN=$(GOBIN) go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest

lint: golangci-lint tidy
cd lib && $(GOBIN)/golangci-lint run
$(GOBIN)/golangci-lint run
go-header:
GOBIN=$(GOBIN) go install github.com/denis-tingaikin/go-header/cmd/go-header@latest

header: go-header
$(GOBIN)/go-header $(shell find . -name "*.go" -not -path "./pkg/proxy/keepalive*")

lint: golangci-lint tidy header
cd lib && $(GOBIN)/golangci-lint run -c ../.golangci.yaml
$(GOBIN)/golangci-lint run -c .golangci.yaml

gocovmerge:
GOBIN=$(GOBIN) go install github.com/wadey/gocovmerge@master
Expand Down
16 changes: 2 additions & 14 deletions cmd/tiproxy/main.go
Original file line number Diff line number Diff line change
@@ -1,17 +1,5 @@
// Copyright 2020 Ipalfish, Inc.
// Copyright 2022 PingCAP, Inc.
//
// 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 2023 PingCAP, Inc.
// SPDX-License-Identifier: Apache-2.0

package main

Expand Down
15 changes: 2 additions & 13 deletions cmd/tiproxyctl/main.go
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
// Copyright 2022 PingCAP, Inc.
//
// 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 2023 PingCAP, Inc.
// SPDX-License-Identifier: Apache-2.0

package main

Expand Down
15 changes: 2 additions & 13 deletions lib/cli/config.go
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
// Copyright 2022 PingCAP, Inc.
//
// 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 2023 PingCAP, Inc.
// SPDX-License-Identifier: Apache-2.0

package cli

Expand Down
13 changes: 1 addition & 12 deletions lib/cli/health.go
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
// Copyright 2023 PingCAP, Inc.
//
// 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.
// SPDX-License-Identifier: Apache-2.0

package cli

Expand Down
15 changes: 2 additions & 13 deletions lib/cli/main.go
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
// Copyright 2022 PingCAP, Inc.
//
// 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 2023 PingCAP, Inc.
// SPDX-License-Identifier: Apache-2.0

package cli

Expand Down
15 changes: 2 additions & 13 deletions lib/cli/namespace.go
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
// Copyright 2022 PingCAP, Inc.
//
// 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 2023 PingCAP, Inc.
// SPDX-License-Identifier: Apache-2.0

package cli

Expand Down
15 changes: 2 additions & 13 deletions lib/cli/util.go
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
// Copyright 2022 PingCAP, Inc.
//
// 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 2023 PingCAP, Inc.
// SPDX-License-Identifier: Apache-2.0

package cli

Expand Down
13 changes: 1 addition & 12 deletions lib/config/health.go
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
// Copyright 2023 PingCAP, Inc.
//
// 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.
// SPDX-License-Identifier: Apache-2.0

package config

Expand Down
16 changes: 2 additions & 14 deletions lib/config/namespace.go
Original file line number Diff line number Diff line change
@@ -1,17 +1,5 @@
// Copyright 2020 Ipalfish, Inc.
// Copyright 2022 PingCAP, Inc.
//
// 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 2023 PingCAP, Inc.
// SPDX-License-Identifier: Apache-2.0

package config

Expand Down
15 changes: 2 additions & 13 deletions lib/config/namespace_test.go
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
// Copyright 2022 PingCAP, Inc.
//
// 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 2023 PingCAP, Inc.
// SPDX-License-Identifier: Apache-2.0

package config

Expand Down
16 changes: 2 additions & 14 deletions lib/config/proxy.go
Original file line number Diff line number Diff line change
@@ -1,17 +1,5 @@
// Copyright 2020 Ipalfish, Inc.
// Copyright 2022 PingCAP, Inc.
//
// 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 2023 PingCAP, Inc.
// SPDX-License-Identifier: Apache-2.0

package config

Expand Down
15 changes: 2 additions & 13 deletions lib/config/proxy_test.go
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
// Copyright 2022 PingCAP, Inc.
//
// 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 2023 PingCAP, Inc.
// SPDX-License-Identifier: Apache-2.0

package config

Expand Down
15 changes: 2 additions & 13 deletions lib/util/cmd/cmd.go
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
// Copyright 2022 PingCAP, Inc.
//
// 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 2023 PingCAP, Inc.
// SPDX-License-Identifier: Apache-2.0

package cmd

Expand Down
15 changes: 2 additions & 13 deletions lib/util/cmd/encoder.go
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
// Copyright 2022 PingCAP, Inc.
//
// 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 2023 PingCAP, Inc.
// SPDX-License-Identifier: Apache-2.0

package cmd

Expand Down
15 changes: 2 additions & 13 deletions lib/util/cmd/encoder_test.go
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
// Copyright 2022 PingCAP, Inc.
//
// 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 2023 PingCAP, Inc.
// SPDX-License-Identifier: Apache-2.0

package cmd

Expand Down
15 changes: 2 additions & 13 deletions lib/util/cmd/logger.go
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
// Copyright 2022 PingCAP, Inc.
//
// 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 2023 PingCAP, Inc.
// SPDX-License-Identifier: Apache-2.0

package cmd

Expand Down
15 changes: 2 additions & 13 deletions lib/util/cmd/syncer.go
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
// Copyright 2022 PingCAP, Inc.
//
// 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 2023 PingCAP, Inc.
// SPDX-License-Identifier: Apache-2.0

package cmd

Expand Down
15 changes: 2 additions & 13 deletions lib/util/errors/error.go
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
// Copyright 2022 PingCAP, Inc.
//
// 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 2023 PingCAP, Inc.
// SPDX-License-Identifier: Apache-2.0

package errors

Expand Down
15 changes: 2 additions & 13 deletions lib/util/errors/error_test.go
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
// Copyright 2022 PingCAP, Inc.
//
// 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 2023 PingCAP, Inc.
// SPDX-License-Identifier: Apache-2.0

package errors_test

Expand Down
Loading

0 comments on commit b2b6cdc

Please sign in to comment.