Skip to content

Commit d8849d7

Browse files
authored
Merge branch 'main' into nodenext
2 parents 30ec48e + 90d20be commit d8849d7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+1828
-586
lines changed

.eslintrc.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -818,7 +818,7 @@ rules:
818818
unicorn/consistent-destructuring: [2]
819819
unicorn/consistent-empty-array-spread: [2]
820820
unicorn/consistent-existence-index-check: [0]
821-
unicorn/consistent-function-scoping: [2]
821+
unicorn/consistent-function-scoping: [0]
822822
unicorn/custom-error-definition: [0]
823823
unicorn/empty-brace-spaces: [2]
824824
unicorn/error-message: [0]

modules/templates/helper.go

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ func NewFuncMap() template.FuncMap {
4242
"HTMLFormat": htmlutil.HTMLFormat,
4343
"HTMLEscape": htmlEscape,
4444
"QueryEscape": queryEscape,
45+
"QueryBuild": QueryBuild,
4546
"JSEscape": jsEscapeSafe,
4647
"SanitizeHTML": SanitizeHTML,
4748
"URLJoin": util.URLJoin,
@@ -293,6 +294,72 @@ func timeEstimateString(timeSec any) string {
293294
return util.TimeEstimateString(v)
294295
}
295296

297+
// QueryBuild builds a query string from a list of key-value pairs.
298+
// It omits the nil and empty strings, but it doesn't omit other zero values,
299+
// because the zero value of number types may have a meaning.
300+
func QueryBuild(a ...any) template.URL {
301+
var s string
302+
if len(a)%2 == 1 {
303+
if v, ok := a[0].(string); ok {
304+
if v == "" || (v[0] != '?' && v[0] != '&') {
305+
panic("QueryBuild: invalid argument")
306+
}
307+
s = v
308+
} else if v, ok := a[0].(template.URL); ok {
309+
s = string(v)
310+
} else {
311+
panic("QueryBuild: invalid argument")
312+
}
313+
}
314+
for i := len(a) % 2; i < len(a); i += 2 {
315+
k, ok := a[i].(string)
316+
if !ok {
317+
panic("QueryBuild: invalid argument")
318+
}
319+
var v string
320+
if va, ok := a[i+1].(string); ok {
321+
v = va
322+
} else if a[i+1] != nil {
323+
v = fmt.Sprint(a[i+1])
324+
}
325+
// pos1 to pos2 is the "k=v&" part, "&" is optional
326+
pos1 := strings.Index(s, "&"+k+"=")
327+
if pos1 != -1 {
328+
pos1++
329+
} else {
330+
pos1 = strings.Index(s, "?"+k+"=")
331+
if pos1 != -1 {
332+
pos1++
333+
} else if strings.HasPrefix(s, k+"=") {
334+
pos1 = 0
335+
}
336+
}
337+
pos2 := len(s)
338+
if pos1 == -1 {
339+
pos1 = len(s)
340+
} else {
341+
pos2 = pos1 + 1
342+
for pos2 < len(s) && s[pos2-1] != '&' {
343+
pos2++
344+
}
345+
}
346+
if v != "" {
347+
sep := ""
348+
hasPrefixSep := pos1 == 0 || (pos1 <= len(s) && (s[pos1-1] == '?' || s[pos1-1] == '&'))
349+
if !hasPrefixSep {
350+
sep = "&"
351+
}
352+
s = s[:pos1] + sep + k + "=" + url.QueryEscape(v) + "&" + s[pos2:]
353+
} else {
354+
s = s[:pos1] + s[pos2:]
355+
}
356+
}
357+
if s != "" && s != "&" && s[len(s)-1] == '&' {
358+
s = s[:len(s)-1]
359+
}
360+
return template.URL(s)
361+
}
362+
296363
func panicIfDevOrTesting() {
297364
if !setting.IsProd || setting.IsInTesting {
298365
panic("legacy template functions are for backward compatibility only, do not use them in new code")

options/gitignore/Alteryx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ CASS.ini
2929
*.gzlc
3030

3131
## gitignore reference sites
32-
# https://git-scm.com/book/en/v2/Git-Basics-Recording-Changes-to-the-Repository#Ignoring-Files
32+
# https://git-scm.com/book/en/v2/Git-Basics-Recording-Changes-to-the-Repository#_ignoring
3333
# https://git-scm.com/docs/gitignore
3434
# https://help.github.com/articles/ignoring-files/
3535

options/gitignore/ECU-TEST

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# gitignore template for ECU-TEST workspaces - by TraceTronic https://tracetronic.com
2+
# website: https://www.ecu-test.com
3+
# * all directories are related to the default directories, please adapt the .gitignore if you use customized
4+
# directories
5+
6+
# Dynamic workspace settings
7+
# * We don't recommend to ignore the .workspace directory, because of important project specific settings
8+
# local user settings
9+
.workspace/ETdrive.xml
10+
.workspace/favorites.xml
11+
.workspace/filters.xml
12+
.workspace/generators.xml
13+
.workspace/history.xml
14+
.workspace/parallelExecution.xml
15+
.workspace/signalviewer.xml
16+
.workspace/signalViewerHistory.json
17+
.workspace/signalviewer2layout.xml
18+
.workspace/testeditor.xml
19+
.workspace/tooladapter.xml
20+
.workspace/view.xml
21+
# optional, if your process depends on this file remove exclusion
22+
.workspace/interactiveexecution.xml
23+
.workspace/pythonlibrary.xml
24+
# deprecated, support for older versions
25+
.workspace/traceexplorer.xml
26+
27+
# Custom file formats and test dependencies
28+
# * you can manage your artifacts also with TEST-GUIDE (https://www.test-guide.info) and reference them via Playbooks
29+
*.arxml
30+
*.a2l
31+
*.dbc
32+
*.hex
33+
*.s19
34+
[tT]estdata
35+
[tT]estdaten
36+
37+
# Test results and test execution related content
38+
# * Git is not intended to store and provide test results for all iterations
39+
# * We recommend to use TEST-GUIDE (https://www.test-guide.info) for the test report management
40+
TestReports
41+
42+
# Report generators and templates
43+
# * if you want to provide (f.e.) your own report generators exclude the directory here and ignore only the
44+
# unnecessary subdirectories
45+
Templates
46+
47+
# Exclude large binary artifacts
48+
# * you can manage your artifacts also with TEST-GUIDE (https://www.test-guide.info) and reference them via Playbooks
49+
Offline-FIUs
50+
Offline-Models
51+
Offline-SGBDs
52+
*.exe
53+
*.msi
54+
*.zip
55+
*.7z
56+
57+
# Exclude default and custom temporary directories
58+
Backup_*
59+
60+
# Python bytecode and cache files
61+
__pycache__/
62+
*.py[cod]

options/gitignore/Kotlin

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,6 @@
2222
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
2323
hs_err_pid*
2424
replay_pid*
25+
26+
# Kotlin Gradle plugin data, see https://kotlinlang.org/docs/whatsnew20.html#new-directory-for-kotlin-data-in-gradle-projects
27+
.kotlin/

options/gitignore/Laravel

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,10 @@ Homestead.yaml
2121
Homestead.json
2222
/.vagrant
2323
.phpunit.result.cache
24+
25+
/public/build
26+
/storage/pail
27+
.env.backup
28+
.env.production
29+
.phpactor.json
30+
auth.json

options/gitignore/Move

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Generated by Move
2+
# will have compiled files
3+
build/
4+
5+
# Remove possibly saving credentials to the git repository
6+
.aptos/

options/gitignore/OpenTofu

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Local .terraform directories
2+
**/.terraform/*
3+
4+
# .tfstate files
5+
*.tfstate
6+
*.tfstate.*
7+
8+
# Crash log files
9+
crash.log
10+
crash.*.log
11+
12+
# Exclude all .tfvars files, which are likely to contain sensitive data, such as
13+
# password, private keys, and other secrets. These should not be part of version
14+
# control as they are data points which are potentially sensitive and subject
15+
# to change depending on the environment.
16+
*.tfvars
17+
*.tfvars.json
18+
19+
# Ignore override files as they are usually used to override resources locally and so
20+
# are not checked in
21+
override.tf
22+
override.tofu
23+
override.tf.json
24+
override.tofu.json
25+
*_override.tf
26+
*_override.tofu
27+
*_override.tf.json
28+
*_override.tofu.json
29+
30+
# Ignore transient lock info files created by tofu apply
31+
.terraform.tfstate.lock.info
32+
33+
# Include override files you do wish to add to version control using negated pattern
34+
# !example_override.tf
35+
# !example_override.tofu
36+
37+
# Include tfplan files to ignore the plan output of command: tofu plan -out=tfplan
38+
# example: *tfplan*
39+
40+
# Ignore CLI configuration files
41+
.terraformrc
42+
terraform.rc

options/gitignore/Python

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,12 @@ ipython_config.py
9494
# install all needed dependencies.
9595
#Pipfile.lock
9696

97+
# UV
98+
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
99+
# This is especially recommended for binary packages to ensure reproducibility, and is more
100+
# commonly ignored for libraries.
101+
#uv.lock
102+
97103
# poetry
98104
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
99105
# This is especially recommended for binary packages to ensure reproducibility, and is more

options/gitignore/Unity

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ sysinfo.txt
5959
*.apk
6060
*.aab
6161
*.unitypackage
62+
*.unitypackage.meta
6263
*.app
6364

6465
# Crashlytics generated file

0 commit comments

Comments
 (0)