Skip to content

Commit 2d49aec

Browse files
committed
Merge branch 'main' into lunny/issue_dev
2 parents 832b78e + 1b069dc commit 2d49aec

Some content is hidden

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

46 files changed

+1575
-304
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: 64 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,69 @@ func timeEstimateString(timeSec any) string {
293294
return util.TimeEstimateString(v)
294295
}
295296

297+
func queryBuild(a ...any) template.URL {
298+
var s string
299+
if len(a)%2 == 1 {
300+
if v, ok := a[0].(string); ok {
301+
if v == "" || (v[0] != '?' && v[0] != '&') {
302+
panic("queryBuild: invalid argument")
303+
}
304+
s = v
305+
} else if v, ok := a[0].(template.URL); ok {
306+
s = string(v)
307+
} else {
308+
panic("queryBuild: invalid argument")
309+
}
310+
}
311+
for i := len(a) % 2; i < len(a); i += 2 {
312+
k, ok := a[i].(string)
313+
if !ok {
314+
panic("queryBuild: invalid argument")
315+
}
316+
var v string
317+
if va, ok := a[i+1].(string); ok {
318+
v = va
319+
} else if a[i+1] != nil {
320+
v = fmt.Sprint(a[i+1])
321+
}
322+
// pos1 to pos2 is the "k=v&" part, "&" is optional
323+
pos1 := strings.Index(s, "&"+k+"=")
324+
if pos1 != -1 {
325+
pos1++
326+
} else {
327+
pos1 = strings.Index(s, "?"+k+"=")
328+
if pos1 != -1 {
329+
pos1++
330+
} else if strings.HasPrefix(s, k+"=") {
331+
pos1 = 0
332+
}
333+
}
334+
pos2 := len(s)
335+
if pos1 == -1 {
336+
pos1 = len(s)
337+
} else {
338+
pos2 = pos1 + 1
339+
for pos2 < len(s) && s[pos2-1] != '&' {
340+
pos2++
341+
}
342+
}
343+
if v != "" {
344+
sep := ""
345+
hasPrefixSep := pos1 == 0 || (pos1 <= len(s) && (s[pos1-1] == '?' || s[pos1-1] == '&'))
346+
if !hasPrefixSep {
347+
sep = "&"
348+
}
349+
s = s[:pos1] + sep + k + "=" + url.QueryEscape(v) + "&" + s[pos2:]
350+
} else {
351+
s = s[:pos1] + s[pos2:]
352+
}
353+
}
354+
if s != "" && s != "&" && s[len(s)-1] == '&' {
355+
s = s[:len(s)-1]
356+
}
357+
return template.URL(s)
358+
}
359+
296360
func panicIfDevOrTesting() {
297361
if !setting.IsProd || setting.IsInTesting {
298362
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)