Skip to content

Commit e4de9db

Browse files
committed
Merge remote-tracking branch 'giteaofficial/main'
* giteaofficial/main: Only show the latest version in the Arch index (go-gitea#33262) [skip ci] Updated translations via Crowdin Enable eslint for commonjs (go-gitea#33575) Fix various problems (artifact order, api empty slice, assignee check, fuzzy prompt, mirror proxy, adopt git) (go-gitea#33569) Switch to `@vitest/eslint-plugin` (go-gitea#33573) Avoid duplicate SetContextValue call (go-gitea#33564)
2 parents 772feea + fba365b commit e4de9db

File tree

25 files changed

+375
-307
lines changed

25 files changed

+375
-307
lines changed

.eslintrc.cjs

Lines changed: 60 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
const vitestPlugin = require('@vitest/eslint-plugin');
12
const restrictedSyntax = ['WithStatement', 'ForInStatement', 'LabeledStatement', 'SequenceExpression'];
23

34
module.exports = {
@@ -37,15 +38,20 @@ module.exports = {
3738
'eslint-plugin-regexp',
3839
'eslint-plugin-sonarjs',
3940
'eslint-plugin-unicorn',
40-
'eslint-plugin-vitest',
41-
'eslint-plugin-vitest-globals',
4241
'eslint-plugin-wc',
4342
],
4443
env: {
4544
es2024: true,
4645
node: true,
4746
},
4847
overrides: [
48+
{
49+
files: ['**/*.cjs'],
50+
rules: {
51+
'import-x/no-commonjs': [0],
52+
'@typescript-eslint/no-require-imports': [0],
53+
},
54+
},
4955
{
5056
files: ['web_src/**/*'],
5157
globals: {
@@ -82,59 +88,58 @@ module.exports = {
8288
},
8389
{
8490
files: ['**/*.test.*', 'web_src/js/test/setup.ts'],
85-
env: {
86-
'vitest-globals/env': true,
87-
},
91+
plugins: ['@vitest/eslint-plugin'],
92+
globals: vitestPlugin.environments.env.globals,
8893
rules: {
89-
'vitest/consistent-test-filename': [0],
90-
'vitest/consistent-test-it': [0],
91-
'vitest/expect-expect': [0],
92-
'vitest/max-expects': [0],
93-
'vitest/max-nested-describe': [0],
94-
'vitest/no-alias-methods': [0],
95-
'vitest/no-commented-out-tests': [0],
96-
'vitest/no-conditional-expect': [0],
97-
'vitest/no-conditional-in-test': [0],
98-
'vitest/no-conditional-tests': [0],
99-
'vitest/no-disabled-tests': [0],
100-
'vitest/no-done-callback': [0],
101-
'vitest/no-duplicate-hooks': [0],
102-
'vitest/no-focused-tests': [0],
103-
'vitest/no-hooks': [0],
104-
'vitest/no-identical-title': [2],
105-
'vitest/no-interpolation-in-snapshots': [0],
106-
'vitest/no-large-snapshots': [0],
107-
'vitest/no-mocks-import': [0],
108-
'vitest/no-restricted-matchers': [0],
109-
'vitest/no-restricted-vi-methods': [0],
110-
'vitest/no-standalone-expect': [0],
111-
'vitest/no-test-prefixes': [0],
112-
'vitest/no-test-return-statement': [0],
113-
'vitest/prefer-called-with': [0],
114-
'vitest/prefer-comparison-matcher': [0],
115-
'vitest/prefer-each': [0],
116-
'vitest/prefer-equality-matcher': [0],
117-
'vitest/prefer-expect-resolves': [0],
118-
'vitest/prefer-hooks-in-order': [0],
119-
'vitest/prefer-hooks-on-top': [2],
120-
'vitest/prefer-lowercase-title': [0],
121-
'vitest/prefer-mock-promise-shorthand': [0],
122-
'vitest/prefer-snapshot-hint': [0],
123-
'vitest/prefer-spy-on': [0],
124-
'vitest/prefer-strict-equal': [0],
125-
'vitest/prefer-to-be': [0],
126-
'vitest/prefer-to-be-falsy': [0],
127-
'vitest/prefer-to-be-object': [0],
128-
'vitest/prefer-to-be-truthy': [0],
129-
'vitest/prefer-to-contain': [0],
130-
'vitest/prefer-to-have-length': [0],
131-
'vitest/prefer-todo': [0],
132-
'vitest/require-hook': [0],
133-
'vitest/require-to-throw-message': [0],
134-
'vitest/require-top-level-describe': [0],
135-
'vitest/valid-describe-callback': [2],
136-
'vitest/valid-expect': [2],
137-
'vitest/valid-title': [2],
94+
'@vitest/consistent-test-filename': [0],
95+
'@vitest/consistent-test-it': [0],
96+
'@vitest/expect-expect': [0],
97+
'@vitest/max-expects': [0],
98+
'@vitest/max-nested-describe': [0],
99+
'@vitest/no-alias-methods': [0],
100+
'@vitest/no-commented-out-tests': [0],
101+
'@vitest/no-conditional-expect': [0],
102+
'@vitest/no-conditional-in-test': [0],
103+
'@vitest/no-conditional-tests': [0],
104+
'@vitest/no-disabled-tests': [0],
105+
'@vitest/no-done-callback': [0],
106+
'@vitest/no-duplicate-hooks': [0],
107+
'@vitest/no-focused-tests': [0],
108+
'@vitest/no-hooks': [0],
109+
'@vitest/no-identical-title': [2],
110+
'@vitest/no-interpolation-in-snapshots': [0],
111+
'@vitest/no-large-snapshots': [0],
112+
'@vitest/no-mocks-import': [0],
113+
'@vitest/no-restricted-matchers': [0],
114+
'@vitest/no-restricted-vi-methods': [0],
115+
'@vitest/no-standalone-expect': [0],
116+
'@vitest/no-test-prefixes': [0],
117+
'@vitest/no-test-return-statement': [0],
118+
'@vitest/prefer-called-with': [0],
119+
'@vitest/prefer-comparison-matcher': [0],
120+
'@vitest/prefer-each': [0],
121+
'@vitest/prefer-equality-matcher': [0],
122+
'@vitest/prefer-expect-resolves': [0],
123+
'@vitest/prefer-hooks-in-order': [0],
124+
'@vitest/prefer-hooks-on-top': [2],
125+
'@vitest/prefer-lowercase-title': [0],
126+
'@vitest/prefer-mock-promise-shorthand': [0],
127+
'@vitest/prefer-snapshot-hint': [0],
128+
'@vitest/prefer-spy-on': [0],
129+
'@vitest/prefer-strict-equal': [0],
130+
'@vitest/prefer-to-be': [0],
131+
'@vitest/prefer-to-be-falsy': [0],
132+
'@vitest/prefer-to-be-object': [0],
133+
'@vitest/prefer-to-be-truthy': [0],
134+
'@vitest/prefer-to-contain': [0],
135+
'@vitest/prefer-to-have-length': [0],
136+
'@vitest/prefer-todo': [0],
137+
'@vitest/require-hook': [0],
138+
'@vitest/require-to-throw-message': [0],
139+
'@vitest/require-top-level-describe': [0],
140+
'@vitest/valid-describe-callback': [2],
141+
'@vitest/valid-expect': [2],
142+
'@vitest/valid-title': [2],
138143
},
139144
},
140145
{
@@ -163,7 +168,7 @@ module.exports = {
163168
{
164169
files: ['tests/e2e/**'],
165170
plugins: [
166-
'eslint-plugin-playwright'
171+
'eslint-plugin-playwright',
167172
],
168173
extends: [
169174
'plugin:playwright/recommended',

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ TAR_EXCLUDES := .git data indexers queues log node_modules $(EXECUTABLE) $(FOMAN
144144
GO_DIRS := build cmd models modules routers services tests
145145
WEB_DIRS := web_src/js web_src/css
146146

147-
ESLINT_FILES := web_src/js tools *.js *.ts tests/e2e
147+
ESLINT_FILES := web_src/js tools *.js *.ts *.cjs tests/e2e
148148
STYLELINT_FILES := web_src/css web_src/js/components/*.vue
149149
SPELLCHECK_FILES := $(GO_DIRS) $(WEB_DIRS) templates options/locale/locale_en-US.ini .github $(filter-out CHANGELOG.md, $(wildcard *.go *.js *.md *.yml *.yaml *.toml))
150150
EDITORCONFIG_FILES := templates .github/workflows options/locale/locale_en-US.ini

models/actions/artifact.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,12 @@ type FindArtifactsOptions struct {
114114
Status int
115115
}
116116

117+
func (opts FindArtifactsOptions) ToOrders() string {
118+
return "id"
119+
}
120+
121+
var _ db.FindOptionsOrder = (*FindArtifactsOptions)(nil)
122+
117123
func (opts FindArtifactsOptions) ToConds() builder.Cond {
118124
cond := builder.NewCond()
119125
if opts.RepoID > 0 {
@@ -132,7 +138,7 @@ func (opts FindArtifactsOptions) ToConds() builder.Cond {
132138
return cond
133139
}
134140

135-
// ActionArtifactMeta is the meta data of an artifact
141+
// ActionArtifactMeta is the meta-data of an artifact
136142
type ActionArtifactMeta struct {
137143
ArtifactName string
138144
FileSize int64

modules/util/slice.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,3 +71,10 @@ func KeysOfMap[K comparable, V any](m map[K]V) []K {
7171
}
7272
return keys
7373
}
74+
75+
func SliceNilAsEmpty[T any](a []T) []T {
76+
if a == nil {
77+
return []T{}
78+
}
79+
return a
80+
}

options/locale/locale_pt-PT.ini

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,12 @@ show_only_public=Apresentando somente os públicos
385385

386386
issues.in_your_repos=Nos seus repositórios
387387

388+
guide_title=Sem trabalho
389+
guide_desc=Neste momento não está a seguir repositórios nem utilizadores, por isso não há conteúdo a apresentar. Pode explorar repositórios ou utilizadores de interesse a partir das ligações abaixo.
390+
explore_repos=Explorar repositórios
391+
explore_users=Explorar utilizadores
392+
empty_org=Ainda não há organizações.
393+
empty_repo=Ainda não há repositórios.
388394

389395
[explore]
390396
repos=Repositórios

0 commit comments

Comments
 (0)