Skip to content

Commit

Permalink
Merge pull request #57 from go-gitea/main
Browse files Browse the repository at this point in the history
Fork updates from go-gitea/gitea main
  • Loading branch information
github-actions[bot] authored Nov 28, 2022
2 parents 1c0401f + e81ccc4 commit 004494c
Show file tree
Hide file tree
Showing 1,953 changed files with 4,106 additions and 5,648 deletions.
2 changes: 1 addition & 1 deletion .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,7 @@ steps:

# TODO: We should probably build all dependencies into a test image
- name: test-e2e
image: mcr.microsoft.com/playwright:v1.27.1-focal
image: mcr.microsoft.com/playwright:v1.28.0-focal
commands:
- curl -sLO https://go.dev/dl/go1.19.linux-amd64.tar.gz && tar -C /usr/local -xzf go1.19.linux-amd64.tar.gz
- groupadd --gid 1001 gitea && useradd -m --gid 1001 --uid 1001 gitea
Expand Down
5 changes: 5 additions & 0 deletions .eslintrc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ rules:
no-empty-character-class: [2]
no-empty-function: [0]
no-empty-pattern: [2]
no-empty-static-block: [2]
no-empty: [2, {allowEmptyCatch: true}]
no-eq-null: [2]
no-eval: [2]
Expand Down Expand Up @@ -269,6 +270,7 @@ rules:
no-negated-condition: [0]
no-nested-ternary: [0]
no-new-func: [2]
no-new-native-nonconstructor: [2]
no-new-object: [2]
no-new-symbol: [2]
no-new-wrappers: [2]
Expand Down Expand Up @@ -443,6 +445,7 @@ rules:
unicorn/no-invalid-remove-event-listener: [2]
unicorn/no-keyword-prefix: [0]
unicorn/no-lonely-if: [2]
unicorn/no-negated-condition: [0]
unicorn/no-nested-ternary: [0]
unicorn/no-new-array: [0]
unicorn/no-new-buffer: [0]
Expand All @@ -453,6 +456,7 @@ rules:
unicorn/no-static-only-class: [2]
unicorn/no-thenable: [2]
unicorn/no-this-assignment: [2]
unicorn/no-typeof-undefined: [2]
unicorn/no-unnecessary-await: [2]
unicorn/no-unreadable-array-destructuring: [0]
unicorn/no-unreadable-iife: [2]
Expand Down Expand Up @@ -503,6 +507,7 @@ rules:
unicorn/prefer-regexp-test: [2]
unicorn/prefer-replace-all: [0]
unicorn/prefer-set-has: [0]
unicorn/prefer-set-size: [2]
unicorn/prefer-spread: [0]
unicorn/prefer-starts-ends-with: [2]
unicorn/prefer-string-slice: [0]
Expand Down
11 changes: 11 additions & 0 deletions .stylelintrc.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
extends: stylelint-config-standard

plugins:
- stylelint-declaration-strict-value

overrides:
- files: ["**/*.less"]
customSyntax: postcss-less
- files: ["**/*.less"]
rules:
scale-unlimited/declaration-strict-value: [color, {
ignoreValues: /^(inherit|transparent|unset|initial)$/
}]
- files: ["**/chroma/*", "**/codemirror/*", "**/standalone/*", "**/console/*"]
rules:
scale-unlimited/declaration-strict-value: null

rules:
alpha-value-notation: null
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -440,8 +440,8 @@ Code that you contribute should use the standard copyright header:

```
// 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
```

Files in the repository contain copyright from the year they are added
Expand Down
4 changes: 2 additions & 2 deletions build.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright 2020 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


//go:build vendor

Expand Down
3 changes: 1 addition & 2 deletions build/code-batch-process.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright 2021 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

//go:build ignore

Expand Down
3 changes: 1 addition & 2 deletions build/codeformat/formatimports.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright 2021 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 codeformat

Expand Down
3 changes: 1 addition & 2 deletions build/codeformat/formatimports_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright 2021 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 codeformat

Expand Down
3 changes: 1 addition & 2 deletions build/generate-bindata.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright 2020 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

//go:build ignore

Expand Down
7 changes: 3 additions & 4 deletions build/generate-emoji.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Copyright 2020 The Gitea Authors. All rights reserved.
// Copyright 2015 Kenneth Shaw
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
// SPDX-License-Identifier: MIT

//go:build ignore

Expand Down Expand Up @@ -209,8 +208,8 @@ func generate() ([]byte, error) {

const hdr = `
// Copyright 2020 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 emoji
Expand Down
3 changes: 1 addition & 2 deletions build/generate-go-licenses.go
Original file line number Diff line number Diff line change
@@ -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

//go:build ignore

Expand Down
3 changes: 1 addition & 2 deletions build/gocovmerge.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Copyright 2020 The Gitea Authors. All rights reserved.
// Copyright (c) 2015, Wade Simmons
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
// SPDX-License-Identifier: MIT

// gocovmerge takes the results from multiple `go test -coverprofile` runs and
// merges them into one profile
Expand Down
3 changes: 1 addition & 2 deletions cmd/admin.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Copyright 2016 The Gogs Authors. All rights reserved.
// Copyright 2016 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 cmd

Expand Down
3 changes: 1 addition & 2 deletions cmd/admin_auth_ldap.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright 2019 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 cmd

Expand Down
3 changes: 1 addition & 2 deletions cmd/admin_auth_ldap_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright 2019 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 cmd

Expand Down
3 changes: 1 addition & 2 deletions cmd/cert.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
// Copyright 2009 The Go Authors. All rights reserved.
// Copyright 2014 The Gogs Authors. All rights reserved.
// Copyright 2016 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 cmd

Expand Down
3 changes: 1 addition & 2 deletions cmd/cmd.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright 2018 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 cmd provides subcommands to the gitea binary - such as "web" or
// "admin".
Expand Down
3 changes: 1 addition & 2 deletions cmd/convert.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright 2019 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 cmd

Expand Down
3 changes: 1 addition & 2 deletions cmd/docs.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright 2020 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 cmd

Expand Down
3 changes: 1 addition & 2 deletions cmd/doctor.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright 2019 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 cmd

Expand Down
3 changes: 1 addition & 2 deletions cmd/dump.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Copyright 2014 The Gogs Authors. All rights reserved.
// Copyright 2016 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 cmd

Expand Down
3 changes: 1 addition & 2 deletions cmd/dump_repo.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright 2020 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 cmd

Expand Down
3 changes: 1 addition & 2 deletions cmd/embedded.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright 2020 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

//go:build bindata

Expand Down
3 changes: 1 addition & 2 deletions cmd/embedded_stub.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright 2020 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

//go:build !bindata

Expand Down
3 changes: 1 addition & 2 deletions cmd/generate.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Copyright 2016 The Gogs Authors. All rights reserved.
// Copyright 2016 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 cmd

Expand Down
11 changes: 5 additions & 6 deletions cmd/hook.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright 2017 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 cmd

Expand Down Expand Up @@ -218,9 +217,9 @@ Gitea or set your environment appropriately.`, "")
}
}

supportProcRecive := false
supportProcReceive := false
if git.CheckGitVersionAtLeast("2.29") == nil {
supportProcRecive = true
supportProcReceive = true
}

for scanner.Scan() {
Expand All @@ -241,9 +240,9 @@ Gitea or set your environment appropriately.`, "")
lastline++

// If the ref is a branch or tag, check if it's protected
// if supportProcRecive all ref should be checked because
// if supportProcReceive all ref should be checked because
// permission check was delayed
if supportProcRecive || strings.HasPrefix(refFullName, git.BranchPrefix) || strings.HasPrefix(refFullName, git.TagPrefix) {
if supportProcReceive || strings.HasPrefix(refFullName, git.BranchPrefix) || strings.HasPrefix(refFullName, git.TagPrefix) {
oldCommitIDs[count] = oldCommitID
newCommitIDs[count] = newCommitID
refFullNames[count] = refFullName
Expand Down
3 changes: 1 addition & 2 deletions cmd/hook_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright 2021 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 cmd

Expand Down
3 changes: 1 addition & 2 deletions cmd/keys.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright 2018 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 cmd

Expand Down
3 changes: 1 addition & 2 deletions cmd/mailer.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright 2020 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 cmd

Expand Down
3 changes: 1 addition & 2 deletions cmd/main_test.go
Original file line number Diff line number Diff line change
@@ -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 cmd

Expand Down
3 changes: 1 addition & 2 deletions cmd/manager.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright 2020 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 cmd

Expand Down
3 changes: 1 addition & 2 deletions cmd/manager_logging.go
Original file line number Diff line number Diff line change
@@ -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 cmd

Expand Down
3 changes: 1 addition & 2 deletions cmd/migrate.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright 2018 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 cmd

Expand Down
3 changes: 1 addition & 2 deletions cmd/migrate_storage.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright 2020 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 cmd

Expand Down
3 changes: 1 addition & 2 deletions cmd/migrate_storage_test.go
Original file line number Diff line number Diff line change
@@ -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 cmd

Expand Down
3 changes: 1 addition & 2 deletions cmd/restore_repo.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright 2020 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 cmd

Expand Down
3 changes: 1 addition & 2 deletions cmd/serv.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Copyright 2014 The Gogs Authors. All rights reserved.
// Copyright 2016 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 cmd

Expand Down
3 changes: 1 addition & 2 deletions cmd/web.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright 2014 The Gogs 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 cmd

Expand Down
Loading

0 comments on commit 004494c

Please sign in to comment.