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 5e090a98b4d..de8629f1322 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 097d03780cd..2cacaaa0554 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 9d609c58d3d..4e98a2b7a9f 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 b43ee32a56e..3715de3920c 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 ab45226cf15..9bd512755de 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 df775048cb6..6639a8b0084 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 e3ecc82f6d7..15e36d18598 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 ef42d61d5a8..21cda5d5d46 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 35691eec861..5f8c474e052 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 342ee8929c6..8258d194c26 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 404f76f6c4f..41bb3053375 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 334418bd7e5..5fb59e48045 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 c7edf4a1853..80135ca2d0a 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 5e934d707ee..b9aa40bdd22 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 d44e904556d..f6f7195adf1 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 6c3ff52a9c0..734bb05dc69 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 40d8914a016..5a14ed5b7a0 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