From f59a74852bb530bd728ecf62f5c8be510d2c3770 Mon Sep 17 00:00:00 2001 From: Jason Song Date: Fri, 2 Dec 2022 22:14:57 +0800 Subject: [PATCH] Update gitea-vet to check FSFE REUSE (#22004) Related to: - #21840 - https://gitea.com/gitea/gitea-vet/pulls/21 What it looks like when it's working: https://drone.gitea.io/go-gitea/gitea/64040/1/5 All available SPDX license identifiers: [SPDX License List](https://spdx.org/licenses/). Co-authored-by: Lunny Xiao --- go.mod | 2 +- go.sum | 4 ++-- models/migrations/v1_19/v234.go | 3 +-- models/migrations/v1_19/v235.go | 3 +-- models/packages/package_cleanup_rule.go | 3 +-- modules/context/csrf.go | 1 + modules/context/xsrf.go | 1 + modules/context/xsrf_test.go | 1 + modules/json/json.go | 2 +- modules/paginator/paginator.go | 1 + modules/paginator/paginator_test.go | 1 + modules/session/redis.go | 1 + routers/web/org/setting_packages.go | 3 +-- routers/web/shared/packages/packages.go | 3 +-- routers/web/user/setting/packages.go | 3 +-- services/forms/package_form.go | 3 +-- services/packages/container/common.go | 3 +-- 17 files changed, 18 insertions(+), 20 deletions(-) diff --git a/go.mod b/go.mod index 5e090a98b4..de8629f132 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module code.gitea.io/gitea go 1.18 require ( - code.gitea.io/gitea-vet v0.2.2-0.20220122151748-48ebc902541b + code.gitea.io/gitea-vet v0.2.2 code.gitea.io/sdk/gitea v0.15.1 codeberg.org/gusted/mcaptcha v0.0.0-20220723083913-4f3072e1d570 gitea.com/go-chi/binding v0.0.0-20221013104517-b29891619681 diff --git a/go.sum b/go.sum index 097d03780c..2cacaaa055 100644 --- a/go.sum +++ b/go.sum @@ -65,8 +65,8 @@ cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9 cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= cloud.google.com/go/storage v1.22.1/go.mod h1:S8N1cAStu7BOeFfE8KAQzmyyLkK8p/vmRq6kuBTW58Y= code.gitea.io/gitea-vet v0.2.1/go.mod h1:zcNbT/aJEmivCAhfmkHOlT645KNOf9W2KnkLgFjGGfE= -code.gitea.io/gitea-vet v0.2.2-0.20220122151748-48ebc902541b h1:uv9a8eGSdQ8Dr4HyUcuHFfDsk/QuwO+wf+Y99RYdxY0= -code.gitea.io/gitea-vet v0.2.2-0.20220122151748-48ebc902541b/go.mod h1:zcNbT/aJEmivCAhfmkHOlT645KNOf9W2KnkLgFjGGfE= +code.gitea.io/gitea-vet v0.2.2 h1:TEOV/Glf38iGmKzKP0EB++Z5OSL4zGg3RrAvlwaMuvk= +code.gitea.io/gitea-vet v0.2.2/go.mod h1:zcNbT/aJEmivCAhfmkHOlT645KNOf9W2KnkLgFjGGfE= code.gitea.io/sdk/gitea v0.11.3/go.mod h1:z3uwDV/b9Ls47NGukYM9XhnHtqPh/J+t40lsUrR6JDY= code.gitea.io/sdk/gitea v0.15.1 h1:WJreC7YYuxbn0UDaPuWIe/mtiNKTvLN8MLkaw71yx/M= code.gitea.io/sdk/gitea v0.15.1/go.mod h1:klY2LVI3s3NChzIk/MzMn7G1FHrfU7qd63iSMVoHRBA= diff --git a/models/migrations/v1_19/v234.go b/models/migrations/v1_19/v234.go index 9d609c58d3..4e98a2b7a9 100644 --- a/models/migrations/v1_19/v234.go +++ b/models/migrations/v1_19/v234.go @@ -1,6 +1,5 @@ // Copyright 2022 The Gitea Authors. All rights reserved. -// Use of this source code is governed by a MIT-style -// license that can be found in the LICENSE file. +// SPDX-License-Identifier: MIT package v1_19 //nolint diff --git a/models/migrations/v1_19/v235.go b/models/migrations/v1_19/v235.go index b43ee32a56..3715de3920 100644 --- a/models/migrations/v1_19/v235.go +++ b/models/migrations/v1_19/v235.go @@ -1,6 +1,5 @@ // Copyright 2022 The Gitea Authors. All rights reserved. -// Use of this source code is governed by a MIT-style -// license that can be found in the LICENSE file. +// SPDX-License-Identifier: MIT package v1_19 //nolint diff --git a/models/packages/package_cleanup_rule.go b/models/packages/package_cleanup_rule.go index ab45226cf1..9bd512755d 100644 --- a/models/packages/package_cleanup_rule.go +++ b/models/packages/package_cleanup_rule.go @@ -1,6 +1,5 @@ // Copyright 2022 The Gitea Authors. All rights reserved. -// Use of this source code is governed by a MIT-style -// license that can be found in the LICENSE file. +// SPDX-License-Identifier: MIT package packages diff --git a/modules/context/csrf.go b/modules/context/csrf.go index df775048cb..6639a8b008 100644 --- a/modules/context/csrf.go +++ b/modules/context/csrf.go @@ -13,6 +13,7 @@ // 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 // a middleware that generates and validates CSRF tokens. diff --git a/modules/context/xsrf.go b/modules/context/xsrf.go index e3ecc82f6d..15e36d1859 100644 --- a/modules/context/xsrf.go +++ b/modules/context/xsrf.go @@ -13,6 +13,7 @@ // 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 context diff --git a/modules/context/xsrf_test.go b/modules/context/xsrf_test.go index ef42d61d5a..21cda5d5d4 100644 --- a/modules/context/xsrf_test.go +++ b/modules/context/xsrf_test.go @@ -13,6 +13,7 @@ // 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 context diff --git a/modules/json/json.go b/modules/json/json.go index 35691eec86..5f8c474e05 100644 --- a/modules/json/json.go +++ b/modules/json/json.go @@ -1,5 +1,5 @@ // Copyright 2020 The Gitea Authors. All rights reserved. -// Use of this source code is governed by a BSD-style +// SPDX-License-Identifier: MIT package json diff --git a/modules/paginator/paginator.go b/modules/paginator/paginator.go index 342ee8929c..8258d194c2 100644 --- a/modules/paginator/paginator.go +++ b/modules/paginator/paginator.go @@ -1,5 +1,6 @@ // Copyright 2022 The Gitea Authors. // Copyright 2015 https://github.com/unknwon. Licensed under the Apache License, Version 2.0 +// SPDX-License-Identifier: Apache-2.0 package paginator diff --git a/modules/paginator/paginator_test.go b/modules/paginator/paginator_test.go index 404f76f6c4..41bb305337 100644 --- a/modules/paginator/paginator_test.go +++ b/modules/paginator/paginator_test.go @@ -1,5 +1,6 @@ // Copyright 2022 The Gitea Authors. // Copyright 2015 https://github.com/unknwon. Licensed under the Apache License, Version 2.0 +// SPDX-License-Identifier: Apache-2.0 package paginator diff --git a/modules/session/redis.go b/modules/session/redis.go index 334418bd7e..5fb59e4804 100644 --- a/modules/session/redis.go +++ b/modules/session/redis.go @@ -13,6 +13,7 @@ // 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 session diff --git a/routers/web/org/setting_packages.go b/routers/web/org/setting_packages.go index c7edf4a185..80135ca2d0 100644 --- a/routers/web/org/setting_packages.go +++ b/routers/web/org/setting_packages.go @@ -1,6 +1,5 @@ // Copyright 2022 The Gitea Authors. All rights reserved. -// Use of this source code is governed by a MIT-style -// license that can be found in the LICENSE file. +// SPDX-License-Identifier: MIT package org diff --git a/routers/web/shared/packages/packages.go b/routers/web/shared/packages/packages.go index 5e934d707e..b9aa40bdd2 100644 --- a/routers/web/shared/packages/packages.go +++ b/routers/web/shared/packages/packages.go @@ -1,6 +1,5 @@ // Copyright 2022 The Gitea Authors. All rights reserved. -// Use of this source code is governed by a MIT-style -// license that can be found in the LICENSE file. +// SPDX-License-Identifier: MIT package packages diff --git a/routers/web/user/setting/packages.go b/routers/web/user/setting/packages.go index d44e904556..f6f7195adf 100644 --- a/routers/web/user/setting/packages.go +++ b/routers/web/user/setting/packages.go @@ -1,6 +1,5 @@ // Copyright 2022 The Gitea Authors. All rights reserved. -// Use of this source code is governed by a MIT-style -// license that can be found in the LICENSE file. +// SPDX-License-Identifier: MIT package setting diff --git a/services/forms/package_form.go b/services/forms/package_form.go index 6c3ff52a9c..734bb05dc6 100644 --- a/services/forms/package_form.go +++ b/services/forms/package_form.go @@ -1,6 +1,5 @@ // Copyright 2022 The Gitea Authors. All rights reserved. -// Use of this source code is governed by a MIT-style -// license that can be found in the LICENSE file. +// SPDX-License-Identifier: MIT package forms diff --git a/services/packages/container/common.go b/services/packages/container/common.go index 40d8914a01..5a14ed5b7a 100644 --- a/services/packages/container/common.go +++ b/services/packages/container/common.go @@ -1,6 +1,5 @@ // Copyright 2022 The Gitea Authors. All rights reserved. -// Use of this source code is governed by a MIT-style -// license that can be found in the LICENSE file. +// SPDX-License-Identifier: MIT package container