Skip to content

Commit 6d3db98

Browse files
committed
docs: add links to changelog
1 parent 2ec4b4c commit 6d3db98

File tree

5 files changed

+24
-7
lines changed

5 files changed

+24
-7
lines changed

docs/layouts/_partials/compare-versions.html

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,19 @@
33

44
@param {string} a Version A
55
@param {string} b Version B
6-
@returns {boolean}
6+
@returns {int} -1 if a < b, 0 if a == b, 1 if a > b
77

88
@example {{ partial "compare-versions.html" (dict "a" "v1.2.3" "b" "v1.2.4") }}
99
*/ -}}
1010

1111
{{- $aVersion := path.Dir (replace .a "." "/") -}}
1212
{{- $bVersion := path.Dir (replace .b "." "/") -}}
1313

14-
{{- return (eq $aVersion $bVersion) -}}
14+
{{- $result := 0 -}}
15+
{{- if (lt $aVersion $bVersion) -}}
16+
{{- $result = -1 -}}
17+
{{- end -}}
18+
{{- if (gt $aVersion $bVersion) -}}
19+
{{- $result = 1 -}}
20+
{{- end -}}
21+
{{- return $result -}}

docs/layouts/_partials/item-tag.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
{{- $tag.SetInMap "options" "subtitle" (print (strings.FirstUpper $item.deprecation.message) $replacement) -}}
2222
{{- $tag.SetInMap "options" "tag" (print "Deprecated since " $item.deprecation.since) -}}
2323
{{- $tag.SetInMap "options" "tagType" "error" -}}
24-
{{- else if (partial "compare-versions.html" (dict "a" $gcilVersion "b" $item.since)) -}}
24+
{{- else if eq (partial "compare-versions.html" (dict "a" $gcilVersion "b" $item.since)) 0 -}}
2525
{{- $tag.SetInMap "options" "tag" "New" -}}
2626
{{- $tag.SetInMap "options" "tagType" "warning" -}}
2727
{{- else if $item.canAutoFix -}}

docs/layouts/_shortcodes/item-cards.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
{{- if in .groups "standard" -}}
7777
{{- $class = $class | append "gl-default" -}}
7878
{{- end -}}
79-
{{- if (partial "compare-versions.html" (dict "a" $gcilVersion "b" .since)) -}}
79+
{{- if eq (partial "compare-versions.html" (dict "a" $gcilVersion "b" .since)) 0 -}}
8080
{{- $class = $class | append "gl-new" -}}
8181
{{- end -}}
8282

docs/layouts/_shortcodes/item-settings.html

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,22 +34,32 @@
3434

3535
{{/* Badges */}}
3636
<p>
37+
{{ $sinceLink := "/docs/product/changelog/" }}
38+
<!-- changelog entries are missing for versions less than v1.44.0 -->
39+
{{ if eq (partial "compare-versions.html" (dict "a" .since "b" "v1.43.0")) 1 }}
40+
{{ $sinceLink = (print "/docs/product/changelog/#" (replace .since "." "")) }}
41+
{{ end }}
42+
<a href="{{ $sinceLink }}" title="Since golangci-lint {{ .since }}">
3743
{{ partial "shortcodes/badge.html" (dict
3844
"border" true
3945
"icon" "calendar"
4046
"content" (print "Since golangci-lint " .since)
4147
)
4248
}}
49+
</a>
4350
{{ if .deprecation -}}
51+
{{ $deprecatedSinceLink := (print "/docs/product/changelog/#" (replace .deprecation.since "." "")) }}
52+
<a href="{{ $deprecatedSinceLink }}" title="Deprecated since {{ .deprecation.since }}">
4453
{{ partial "shortcodes/badge.html" (dict
4554
"border" true
4655
"icon" "sparkles"
4756
"content" (print "Deprecated since " .deprecation.since)
4857
"type" "error"
4958
)
50-
}}
59+
}}
60+
</a>
5161
{{ else }}
52-
{{ if (partial "compare-versions.html" (dict "a" $gcilVersion "b" .since)) }}
62+
{{ if eq (partial "compare-versions.html" (dict "a" $gcilVersion "b" .since)) 0 }}
5363
{{ partial "shortcodes/badge.html" (dict
5464
"border" true
5565
"icon" "sparkles"

pkg/lint/lintersdb/builder_linter.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ func (LinterBuilder) Build(cfg *config.Config) ([]*linter.Config, error) {
241241
WithURL("https://github.com/polyfloyd/go-errorlint"),
242242

243243
linter.NewConfig(exhaustive.New(&cfg.Linters.Settings.Exhaustive)).
244-
WithSince(" v1.28.0").
244+
WithSince("v1.28.0").
245245
WithLoadForGoAnalysis().
246246
WithURL("https://github.com/nishanths/exhaustive"),
247247

0 commit comments

Comments
 (0)