Skip to content

Commit 79240e1

Browse files
authored
Merge branch 'main' into main
2 parents cfa44d6 + 9668913 commit 79240e1

File tree

11 files changed

+494
-480
lines changed

11 files changed

+494
-480
lines changed

.air.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ tmp_dir = ".air"
44
[build]
55
pre_cmd = ["killall -9 gitea 2>/dev/null || true"] # kill off potential zombie processes from previous runs
66
cmd = "make --no-print-directory backend"
7-
bin = "gitea"
7+
entrypoint = ["./gitea"]
88
delay = 2000
99
include_ext = ["go", "tmpl"]
1010
include_file = ["main.go"]

eslint.config.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import comments from '@eslint-community/eslint-plugin-eslint-comments';
33
import github from 'eslint-plugin-github';
44
import globals from 'globals';
55
import importPlugin from 'eslint-plugin-import-x';
6-
import noUseExtendNative from 'eslint-plugin-no-use-extend-native';
76
import playwright from 'eslint-plugin-playwright';
87
import regexp from 'eslint-plugin-regexp';
98
import sonarjs from 'eslint-plugin-sonarjs';
@@ -58,7 +57,6 @@ export default defineConfig([
5857
'array-func': arrayFunc,
5958
// @ts-expect-error -- https://github.com/un-ts/eslint-plugin-import-x/issues/203
6059
'import-x': importPlugin,
61-
'no-use-extend-native': noUseExtendNative,
6260
regexp,
6361
sonarjs,
6462
unicorn,
@@ -155,7 +153,7 @@ export default defineConfig([
155153
'@typescript-eslint/ban-tslint-comment': [0],
156154
'@typescript-eslint/class-literal-property-style': [0],
157155
'@typescript-eslint/class-methods-use-this': [0],
158-
'@typescript-eslint/consistent-generic-constructors': [0],
156+
'@typescript-eslint/consistent-generic-constructors': [2, 'constructor'],
159157
'@typescript-eslint/consistent-indexed-object-style': [0],
160158
'@typescript-eslint/consistent-return': [0],
161159
'@typescript-eslint/consistent-type-assertions': [2, {assertionStyle: 'as', objectLiteralTypeAssertions: 'allow'}],
@@ -207,7 +205,7 @@ export default defineConfig([
207205
'@typescript-eslint/no-non-null-asserted-optional-chain': [2],
208206
'@typescript-eslint/no-non-null-assertion': [0],
209207
'@typescript-eslint/no-redeclare': [0],
210-
'@typescript-eslint/no-redundant-type-constituents': [2],
208+
'@typescript-eslint/no-redundant-type-constituents': [0], // rule does not properly work without strickNullChecks
211209
'@typescript-eslint/no-require-imports': [2],
212210
'@typescript-eslint/no-restricted-imports': [0],
213211
'@typescript-eslint/no-restricted-types': [0],
@@ -231,6 +229,7 @@ export default defineConfig([
231229
'@typescript-eslint/no-unsafe-return': [0],
232230
'@typescript-eslint/no-unsafe-unary-minus': [2],
233231
'@typescript-eslint/no-unused-expressions': [0],
232+
'@typescript-eslint/no-unused-private-class-members': [2],
234233
'@typescript-eslint/no-unused-vars': [2, {vars: 'all', args: 'all', caughtErrors: 'all', ignoreRestSiblings: false, argsIgnorePattern: '^_', varsIgnorePattern: '^_', caughtErrorsIgnorePattern: '^_', destructuredArrayIgnorePattern: '^_'}],
235234
'@typescript-eslint/no-use-before-define': [2, {functions: false, classes: true, variables: true, allowNamedExports: true, typedefs: false, enums: false, ignoreTypeReferences: true}],
236235
'@typescript-eslint/no-useless-constructor': [0],
@@ -587,10 +586,9 @@ export default defineConfig([
587586
'no-unsafe-negation': [2],
588587
'no-unused-expressions': [2],
589588
'no-unused-labels': [2],
590-
'no-unused-private-class-members': [2],
589+
'no-unused-private-class-members': [0], // handled by @typescript-eslint/no-unused-private-class-members
591590
'no-unused-vars': [0], // handled by @typescript-eslint/no-unused-vars
592591
'no-use-before-define': [0], // handled by @typescript-eslint/no-use-before-define
593-
'no-use-extend-native/no-use-extend-native': [2],
594592
'no-useless-assignment': [2],
595593
'no-useless-backreference': [2],
596594
'no-useless-call': [2],

models/pull/review_state.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,18 +73,18 @@ func GetReviewState(ctx context.Context, userID, pullID int64, commitSHA string)
7373

7474
// UpdateReviewState updates the given review inside the database, regardless of whether it existed before or not
7575
// The given map of files with their viewed state will be merged with the previous review, if present
76-
func UpdateReviewState(ctx context.Context, userID, pullID int64, commitSHA string, updatedFiles map[string]ViewedState) error {
76+
func UpdateReviewState(ctx context.Context, userID, pullID int64, commitSHA string, updatedFiles map[string]ViewedState) (*ReviewState, error) {
7777
log.Trace("Updating review for user %d, repo %d, commit %s with the updated files %v.", userID, pullID, commitSHA, updatedFiles)
7878

7979
review, exists, err := GetReviewState(ctx, userID, pullID, commitSHA)
8080
if err != nil {
81-
return err
81+
return nil, err
8282
}
8383

8484
if exists {
8585
review.UpdatedFiles = mergeFiles(review.UpdatedFiles, updatedFiles)
8686
} else if previousReview, err := getNewestReviewStateApartFrom(ctx, userID, pullID, commitSHA); err != nil {
87-
return err
87+
return nil, err
8888

8989
// Overwrite the viewed files of the previous review if present
9090
} else if previousReview != nil {
@@ -98,11 +98,11 @@ func UpdateReviewState(ctx context.Context, userID, pullID int64, commitSHA stri
9898
if !exists {
9999
log.Trace("Inserting new review for user %d, repo %d, commit %s with the updated files %v.", userID, pullID, commitSHA, review.UpdatedFiles)
100100
_, err := engine.Insert(review)
101-
return err
101+
return nil, err
102102
}
103103
log.Trace("Updating already existing review with ID %d (user %d, repo %d, commit %s) with the updated files %v.", review.ID, userID, pullID, commitSHA, review.UpdatedFiles)
104-
_, err = engine.ID(review.ID).Update(&ReviewState{UpdatedFiles: review.UpdatedFiles})
105-
return err
104+
_, err = engine.ID(review.ID).Cols("updated_files").Update(review)
105+
return review, err
106106
}
107107

108108
// mergeFiles merges the given maps of files with their viewing state into one map.

options/fileicon/material-icon-rules.json

Lines changed: 119 additions & 36 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)