mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-21 09:06:46 +09:00
chore: adapt to eslint-plugin-unicorn 78 and kin-openapi 0.150
unicorn 78 now reports code containing comments, which flags the release tag dropdown loop. Its two new rules find nothing worth enabling. kin-openapi 0.150 keeps the base path as server URL itself and emits explicit style and explode for array query parameters. Assisted-by: Claude Code:claude-opus-5-5
This commit is contained in:
4 files changed
+29
-15
No files matched your search
@@ -23,8 +23,8 @@ import (
|
||||
var rxDeprecated = regexp.MustCompile(`(?i)(?:^|[\n.;])\s*deprecated\b`)
|
||||
|
||||
// Convert parses a Swagger 2.0 spec and returns an OAS3 spec, applying
|
||||
// Gitea-specific post-processing: server URL, file-schema fixups, URI
|
||||
// formats, deprecated flags, and shared-enum extraction.
|
||||
// Gitea-specific post-processing: file-schema fixups, URI formats,
|
||||
// deprecated flags, and shared-enum extraction.
|
||||
//
|
||||
// astEnumMap is a value-set-key → Go-type-name(s) map (built by
|
||||
// ScanSwaggerEnumTypes). When a value set is shared by multiple Go types,
|
||||
@@ -42,7 +42,6 @@ func Convert(swaggerJSON []byte, astEnumMap map[string][]string) (*openapi3.T, e
|
||||
return nil, fmt.Errorf("converting to openapi 3.0: %w", err)
|
||||
}
|
||||
|
||||
oas3.Servers = openapi3.Servers{{URL: swagger2.BasePath}}
|
||||
fixFileSchemas(oas3)
|
||||
addURIFormats(oas3)
|
||||
addDeprecatedFlags(oas3)
|
||||
|
||||
@@ -851,6 +851,7 @@ export default defineConfig([
|
||||
'unicorn/no-prevent-default-in-passive-listener': [2],
|
||||
'unicorn/no-process-exit': [0],
|
||||
'unicorn/no-redundant-comparison': [2],
|
||||
'unicorn/no-repeated-call-wrappers': [0],
|
||||
'unicorn/no-return-array-push': [2],
|
||||
'unicorn/no-selector-as-dom-name': [2],
|
||||
'unicorn/no-shorthand-property-overrides': [0], // only applies to css language
|
||||
@@ -871,6 +872,7 @@ export default defineConfig([
|
||||
'unicorn/no-unnecessary-array-splice-count': [2],
|
||||
'unicorn/no-unnecessary-await': [2],
|
||||
'unicorn/no-unnecessary-boolean-comparison': [2],
|
||||
'unicorn/no-unnecessary-default-arguments': [0],
|
||||
'unicorn/no-unnecessary-fetch-options': [0],
|
||||
'unicorn/no-unnecessary-global-this': [0],
|
||||
'unicorn/no-unnecessary-nested-ternary': [2],
|
||||
|
||||
+24
-8
@@ -12791,6 +12791,7 @@
|
||||
},
|
||||
{
|
||||
"description": "Show notifications with the provided status types. Options are: unread, read and/or pinned. Defaults to unread \u0026 pinned.",
|
||||
"explode": true,
|
||||
"in": "query",
|
||||
"name": "status-types",
|
||||
"schema": {
|
||||
@@ -12798,10 +12799,12 @@
|
||||
"type": "string"
|
||||
},
|
||||
"type": "array"
|
||||
}
|
||||
},
|
||||
"style": "form"
|
||||
},
|
||||
{
|
||||
"description": "filter notifications by subject type",
|
||||
"explode": true,
|
||||
"in": "query",
|
||||
"name": "subject-type",
|
||||
"schema": {
|
||||
@@ -12815,7 +12818,8 @@
|
||||
"type": "string"
|
||||
},
|
||||
"type": "array"
|
||||
}
|
||||
},
|
||||
"style": "form"
|
||||
},
|
||||
{
|
||||
"description": "Only show notifications updated after the given time. This is a timestamp in RFC 3339 format",
|
||||
@@ -12884,6 +12888,7 @@
|
||||
},
|
||||
{
|
||||
"description": "Mark notifications with the provided status types. Options are: unread, read and/or pinned. Defaults to unread.",
|
||||
"explode": true,
|
||||
"in": "query",
|
||||
"name": "status-types",
|
||||
"schema": {
|
||||
@@ -12891,7 +12896,8 @@
|
||||
"type": "string"
|
||||
},
|
||||
"type": "array"
|
||||
}
|
||||
},
|
||||
"style": "form"
|
||||
},
|
||||
{
|
||||
"description": "Status to mark notifications as, Defaults to read.",
|
||||
@@ -19559,6 +19565,7 @@
|
||||
},
|
||||
{
|
||||
"description": "subpath of the repository to download",
|
||||
"explode": true,
|
||||
"in": "query",
|
||||
"name": "path",
|
||||
"schema": {
|
||||
@@ -19566,7 +19573,8 @@
|
||||
"type": "string"
|
||||
},
|
||||
"type": "array"
|
||||
}
|
||||
},
|
||||
"style": "form"
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
@@ -27657,6 +27665,7 @@
|
||||
},
|
||||
{
|
||||
"description": "Show notifications with the provided status types. Options are: unread, read and/or pinned. Defaults to unread \u0026 pinned",
|
||||
"explode": true,
|
||||
"in": "query",
|
||||
"name": "status-types",
|
||||
"schema": {
|
||||
@@ -27664,10 +27673,12 @@
|
||||
"type": "string"
|
||||
},
|
||||
"type": "array"
|
||||
}
|
||||
},
|
||||
"style": "form"
|
||||
},
|
||||
{
|
||||
"description": "filter notifications by subject type",
|
||||
"explode": true,
|
||||
"in": "query",
|
||||
"name": "subject-type",
|
||||
"schema": {
|
||||
@@ -27681,7 +27692,8 @@
|
||||
"type": "string"
|
||||
},
|
||||
"type": "array"
|
||||
}
|
||||
},
|
||||
"style": "form"
|
||||
},
|
||||
{
|
||||
"description": "Only show notifications updated after the given time. This is a timestamp in RFC 3339 format",
|
||||
@@ -27759,6 +27771,7 @@
|
||||
},
|
||||
{
|
||||
"description": "Mark notifications with the provided status types. Options are: unread, read and/or pinned. Defaults to unread.",
|
||||
"explode": true,
|
||||
"in": "query",
|
||||
"name": "status-types",
|
||||
"schema": {
|
||||
@@ -27766,7 +27779,8 @@
|
||||
"type": "string"
|
||||
},
|
||||
"type": "array"
|
||||
}
|
||||
},
|
||||
"style": "form"
|
||||
},
|
||||
{
|
||||
"description": "Status to mark notifications as. Defaults to read.",
|
||||
@@ -28894,6 +28908,7 @@
|
||||
},
|
||||
{
|
||||
"description": "Label IDs",
|
||||
"explode": true,
|
||||
"in": "query",
|
||||
"name": "labels",
|
||||
"schema": {
|
||||
@@ -28902,7 +28917,8 @@
|
||||
"type": "integer"
|
||||
},
|
||||
"type": "array"
|
||||
}
|
||||
},
|
||||
"style": "form"
|
||||
},
|
||||
{
|
||||
"description": "Filter by pull request author",
|
||||
|
||||
@@ -132,10 +132,7 @@ function initGenerateReleaseNotes(elForm: HTMLFormElement) {
|
||||
const $dropdown = fomanticQuery(elModal.querySelector('[name=previous_tag]')!);
|
||||
if (!inited) {
|
||||
inited = true;
|
||||
const values = [];
|
||||
for (const tagName of existingTags) {
|
||||
values.push({name: htmlEscape(tagName), value: tagName}); // ATTENTION: dropdown takes the "name" input as raw HTML
|
||||
}
|
||||
const values = existingTags.map((tagName) => ({name: htmlEscape(tagName), value: tagName})); // ATTENTION: dropdown takes the "name" input as raw HTML
|
||||
$dropdown.dropdown('change values', values);
|
||||
}
|
||||
$dropdown.dropdown('set selected', guessPreviousReleaseTag(tagName, existingTags));
|
||||
|
||||
Reference in new issue
Block a user