Skip to content

Commit 804844d

Browse files
committed
feat: latest version shortcode
1 parent 7063066 commit 804844d

File tree

3 files changed

+18
-10
lines changed

3 files changed

+18
-10
lines changed

docs/content/docs/plugins/module-plugins.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Requirements:
2020
### Configuration Example
2121

2222
```yaml {filename=".custom-gcl.yml"}
23-
version: {.LatestVersion}
23+
version: {{< latest-version >}}
2424
plugins:
2525
# a plugin from a Go proxy
2626
- module: 'github.com/golangci/plugin1'

docs/content/docs/welcome/install.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,13 @@ Here is the other way to install golangci-lint:
4545
4646
```bash
4747
# binary will be $(go env GOPATH)/bin/golangci-lint
48-
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/HEAD/install.sh | sh -s -- -b $(go env GOPATH)/bin {.LatestVersion}
48+
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/HEAD/install.sh | sh -s -- -b $(go env GOPATH)/bin {{< latest-version >}}
4949

5050
# or install it into ./bin/
51-
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/HEAD/install.sh | sh -s {.LatestVersion}
51+
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/HEAD/install.sh | sh -s {{< latest-version >}}
5252

5353
# In Alpine Linux (as it does not come with curl by default)
54-
wget -O- -nv https://raw.githubusercontent.com/golangci/golangci-lint/HEAD/install.sh | sh -s {.LatestVersion}
54+
wget -O- -nv https://raw.githubusercontent.com/golangci/golangci-lint/HEAD/install.sh | sh -s {{< latest-version >}}
5555

5656
golangci-lint --version
5757
```
@@ -67,7 +67,7 @@ For any problems with golangci-lint, check out recent [GitHub issues](https://gi
6767

6868
```bash
6969
# binary will be $(go env GOPATH)/bin/golangci-lint
70-
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/HEAD/install.sh | sh -s -- -b $(go env GOPATH)/bin {.LatestVersion}
70+
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/HEAD/install.sh | sh -s -- -b $(go env GOPATH)/bin {{< latest-version >}}
7171

7272
golangci-lint --version
7373
```
@@ -135,12 +135,12 @@ The scoop package is not officially maintained by golangci team.
135135
### Docker
136136

137137
```bash
138-
docker run --rm -v $(pwd):/app -w /app golangci/golangci-lint:{.LatestVersion} golangci-lint run
138+
docker run --rm -v $(pwd):/app -w /app golangci/golangci-lint:{{< latest-version >}} golangci-lint run
139139
```
140140

141141
Colored output:
142142
```bash
143-
docker run -t --rm -v $(pwd):/app -w /app golangci/golangci-lint:{.LatestVersion} golangci-lint run
143+
docker run -t --rm -v $(pwd):/app -w /app golangci/golangci-lint:{{< latest-version >}} golangci-lint run
144144
```
145145

146146
Preserving caches between consecutive runs:
@@ -150,7 +150,7 @@ docker run --rm -t -v $(pwd):/app -w /app \
150150
-v $(go env GOCACHE):/.cache/go-build -e GOCACHE=/.cache/go-build \
151151
-v $(go env GOMODCACHE):/.cache/mod -e GOMODCACHE=/.cache/mod \
152152
-v ~/.cache/golangci-lint:/.cache/golangci-lint -e GOLANGCI_LINT_CACHE=/.cache/golangci-lint \
153-
golangci/golangci-lint:{.LatestVersion} golangci-lint run
153+
golangci/golangci-lint:{{< latest-version >}} golangci-lint run
154154
```
155155

156156
### Install from Sources
@@ -170,7 +170,7 @@ These installations aren't recommended because of the following points:
170170
7. It's slower than binary installation.
171171

172172
```bash
173-
go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@{.LatestVersion}
173+
go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@{{< latest-version >}}
174174
```
175175

176176
{{% details title="`go tool` usage recommendations" closed="true" %}}
@@ -196,7 +196,7 @@ go mod init -modfile=golangci-lint.mod <your_module_path>/golangci-lint
196196

197197
```sh
198198
# Add golangci-lint as a tool
199-
go get -tool -modfile=golangci-lint.mod github.com/golangci/golangci-lint/v2/cmd/golangci-lint@{.LatestVersion}
199+
go get -tool -modfile=golangci-lint.mod github.com/golangci/golangci-lint/v2/cmd/golangci-lint@{{< latest-version >}}
200200
```
201201

202202
```sh
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{{- /*
2+
Displays the latest version of golangci-lint.
3+
Based on the data file `data/version.json`.
4+
5+
@example {{< latest-version >}}
6+
*/ -}}
7+
8+
{{- index $.Site.Data.version.version | default .Page.GitInfo.AbbreviatedHash | default "devel" -}}

0 commit comments

Comments
 (0)