Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions docs/layouts/_partials/compare-versions.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,19 @@

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

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

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

{{- return (eq $aVersion $bVersion) -}}
{{- $result := 0 -}}
{{- if (lt $aVersion $bVersion) -}}
{{- $result = -1 -}}
{{- end -}}
{{- if (gt $aVersion $bVersion) -}}
{{- $result = 1 -}}
{{- end -}}
{{- return $result -}}
2 changes: 1 addition & 1 deletion docs/layouts/_partials/item-tag.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
{{- $tag.SetInMap "options" "subtitle" (print (strings.FirstUpper $item.deprecation.message) $replacement) -}}
{{- $tag.SetInMap "options" "tag" (print "Deprecated since " $item.deprecation.since) -}}
{{- $tag.SetInMap "options" "tagType" "error" -}}
{{- else if (partial "compare-versions.html" (dict "a" $gcilVersion "b" $item.since)) -}}
{{- else if eq (partial "compare-versions.html" (dict "a" $gcilVersion "b" $item.since)) 0 -}}
{{- $tag.SetInMap "options" "tag" "New" -}}
{{- $tag.SetInMap "options" "tagType" "warning" -}}
{{- else if $item.canAutoFix -}}
Expand Down
2 changes: 1 addition & 1 deletion docs/layouts/_shortcodes/item-cards.html
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
{{- if in .groups "standard" -}}
{{- $class = $class | append "gl-default" -}}
{{- end -}}
{{- if (partial "compare-versions.html" (dict "a" $gcilVersion "b" .since)) -}}
{{- if eq (partial "compare-versions.html" (dict "a" $gcilVersion "b" .since)) 0 -}}
{{- $class = $class | append "gl-new" -}}
{{- end -}}

Expand Down
14 changes: 12 additions & 2 deletions docs/layouts/_shortcodes/item-settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,22 +34,32 @@

{{/* Badges */}}
<p>
{{ $sinceLink := "/docs/product/changelog/" }}
<!-- changelog entries are missing for versions less than v1.44.0 -->
{{ if eq (partial "compare-versions.html" (dict "a" .since "b" "v1.43.0")) 1 }}
{{ $sinceLink = (print "/docs/product/changelog/#" (replace .since "." "")) }}
{{ end }}
<a href="{{ $sinceLink }}" title="Since golangci-lint {{ .since }}">
{{ partial "shortcodes/badge.html" (dict
"border" true
"icon" "calendar"
"content" (print "Since golangci-lint " .since)
)
}}
</a>
{{ if .deprecation -}}
{{ $deprecatedSinceLink := (print "/docs/product/changelog/#" (replace .deprecation.since "." "")) }}
<a href="{{ $deprecatedSinceLink }}" title="Deprecated since {{ .deprecation.since }}">
{{ partial "shortcodes/badge.html" (dict
"border" true
"icon" "sparkles"
"content" (print "Deprecated since " .deprecation.since)
"type" "error"
)
}}
}}
</a>
{{ else }}
{{ if (partial "compare-versions.html" (dict "a" $gcilVersion "b" .since)) }}
{{ if eq (partial "compare-versions.html" (dict "a" $gcilVersion "b" .since)) 0 }}
{{ partial "shortcodes/badge.html" (dict
"border" true
"icon" "sparkles"
Expand Down
2 changes: 1 addition & 1 deletion pkg/lint/lintersdb/builder_linter.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ func (LinterBuilder) Build(cfg *config.Config) ([]*linter.Config, error) {
WithURL("https://github.com/polyfloyd/go-errorlint"),

linter.NewConfig(exhaustive.New(&cfg.Linters.Settings.Exhaustive)).
WithSince(" v1.28.0").
WithSince("v1.28.0").
WithLoadForGoAnalysis().
WithURL("https://github.com/nishanths/exhaustive"),

Expand Down
Loading