Skip to content
Merged
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
4 changes: 2 additions & 2 deletions docs/content/docs/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Golangci-lint is a free and open-source project built by volunteers.

If you value it, consider supporting us, we appreciate it!

{{< button text="Donate ❤️" link="/docs/donate" >}}
{{< golangci/button text="Donate ❤️" link="/docs/donate" >}}

## Contributors

Expand All @@ -42,4 +42,4 @@ This project exists thanks to all the people who contribute. [How to contribute]

## Stargazers over time

{{< starcharts repo="golangci/golangci-lint" >}}
{{< golangci/starcharts repo="golangci/golangci-lint" >}}
24 changes: 12 additions & 12 deletions docs/content/docs/configuration/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Command-Line
weight: 1
---

{{% cli-output %}}
{{% golangci/cli-output %}}

## `run`

Expand All @@ -24,7 +24,7 @@ weight: 1
>
> The formatters can be enabled/disabled by defining them inside the [`formatters`](/docs/configuration/file/#formatters-configuration) section or by using the flags `-E/--enable`, `-D/--disable` of command [`golangci-lint fmt`](/docs/configuration/cli/#fmt).

{{% cli-output cmd="run" %}}
{{% golangci/cli-output cmd="run" %}}

When the `--cpu-profile-path` or `--mem-profile-path` arguments are specified,
golangci-lint writes runtime profiling data in the format expected by the [pprof](https://github.com/google/pprof) visualization tool.
Expand All @@ -40,23 +40,23 @@ the `go tool trace` command and visualization tool.
{{< card link="/docs/formatters/configuration/" title="Formatter Settings" icon="adjustments" >}}
{{< /cards >}}

{{% cli-output cmd="fmt" %}}
{{% golangci/cli-output cmd="fmt" %}}

## `migrate`

{{% cli-output cmd="migrate" %}}
{{% golangci/cli-output cmd="migrate" %}}

## `formatters`

{{% cli-output cmd="formatters" %}}
{{% golangci/cli-output cmd="formatters" %}}

## `help`

{{% cli-output cmd="help" %}}
{{% golangci/cli-output cmd="help" %}}

## `linters`

{{% cli-output cmd="linters" %}}
{{% golangci/cli-output cmd="linters" %}}

## `cache`

Expand All @@ -66,20 +66,20 @@ You can override the default cache directory with the environment variable `GOLA

The cache is only used by `golangci-lint run` (linters).

{{% cli-output cmd="cache" %}}
{{% golangci/cli-output cmd="cache" %}}

## `config`

{{% cli-output cmd="config" %}}
{{% golangci/cli-output cmd="config" %}}

## `custom`

{{% cli-output cmd="custom" %}}
{{% golangci/cli-output cmd="custom" %}}

## `version`

{{% cli-output cmd="version" %}}
{{% golangci/cli-output cmd="version" %}}

## `completion`

{{% cli-output cmd="completion" %}}
{{% golangci/cli-output cmd="completion" %}}
16 changes: 8 additions & 8 deletions docs/content/docs/configuration/file.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ it's just a reference to display all the configuration options used to generate

The configuration file can be validated with the JSON Schema: [golangci.jsonschema.json](https://golangci-lint.run/jsonschema/golangci.jsonschema.json)

{{% configuration-file-snippet section="root" %}}
{{% golangci/configuration-file-snippet section="root" %}}

## `version` configuration

{{% configuration-file-snippet section="version" %}}
{{% golangci/configuration-file-snippet section="version" %}}

## `linters` configuration

Expand All @@ -36,7 +36,7 @@ The configuration file can be validated with the JSON Schema: [golangci.jsonsche
{{< card link="/docs/linters/configuration" title="Linters Settings" icon="adjustments" >}}
{{< /cards >}}

{{% configuration-file-snippet section="linters" %}}
{{% golangci/configuration-file-snippet section="linters" %}}

## `formatters` configuration

Expand All @@ -45,20 +45,20 @@ The configuration file can be validated with the JSON Schema: [golangci.jsonsche
{{< card link="/docs/formatters/configuration" title="Formatters Settings" icon="adjustments" >}}
{{< /cards >}}

{{% configuration-file-snippet section="formatters" %}}
{{% golangci/configuration-file-snippet section="formatters" %}}

## `issues` configuration

{{% configuration-file-snippet section="issues" %}}
{{% golangci/configuration-file-snippet section="issues" %}}

## `output` configuration

{{% configuration-file-snippet section="output" %}}
{{% golangci/configuration-file-snippet section="output" %}}

## `run` configuration

{{% configuration-file-snippet section="run" %}}
{{% golangci/configuration-file-snippet section="run" %}}

## `severity` configuration

{{% configuration-file-snippet section="severity" %}}
{{% golangci/configuration-file-snippet section="severity" %}}
2 changes: 1 addition & 1 deletion docs/content/docs/contributing/website.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ The site is based on [hextra](https://github.com/imfing/hextra) theme.

We use [shortcodes](https://gohugo.io/templates/types/#shortcode) and [partials](https://gohugo.io/templates/types/#partial) based on files from `./docs/.tmp/` and `./docs/data/`.

- The files in `./docs/.tmp/` are used to be embedded with the shortcode `{{%/* embed file="filename.ext" */%}}`.
- The files in `./docs/.tmp/` are used to be embedded with the shortcode `{{%/* golangci/embed file="filename.ext" */%}}`.
- The files in `./docs/data/` are used as [data sources](https://gohugo.io/content-management/data-sources/).

These files are created by running:
Expand Down
4 changes: 2 additions & 2 deletions docs/content/docs/donate/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ If you value it, consider supporting us, we appreciate it! ❤️

You can support us via:

{{< custom-cards mainClass="support-cards" cols=7 >}}
{{< cards class="support-cards" cols=7 >}}
{{< card link="https://github.com/sponsors/golangci" title="GitHub Sponsors" subtitle="Credit card" image="/images/github-sponsors.svg" >}}
{{< card link="https://opencollective.com/golangci-lint" title="Open Collective" subtitle="Credit card, PayPal, etc." image="/images/open-collective.svg" >}}
{{< card link="https://thanks.dev/u/gh/golangci" title="Thanks.dev" subtitle="Credit card" image="/images/thanks-dev.svg" >}}
{{< /custom-cards >}}
{{< /cards >}}
12 changes: 6 additions & 6 deletions docs/content/docs/formatters/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ golangci-lint formatters

## All formatters

{{< filter-bar >}}
{{< clickable-badge class="gl-filter" id="new-filter" icon="fire" content="New" type="warning" >}}
{{< clickable-badge class="gl-filter" id="deprecated-filter" icon="emoji-sad" content="Deprecated" type="info" >}}
{{< clickable-badge class="gl-filter-reset gl-hidden" id="reset-filter" icon="trash" content="Reset" type="error" border=true >}}
{{< /filter-bar >}}
{{< golangci/items/filter >}}
{{< golangci/items/filter-badge class="gl-filter" data="new" icon="fire" content="New" type="warning" >}}
{{< golangci/items/filter-badge class="gl-filter" data="deprecated" icon="emoji-sad" content="Deprecated" type="info" >}}
{{< golangci/items/filter-badge class="gl-filter-reset gl-hidden" icon="trash" content="Reset" type="error" border=true >}}
{{< /golangci/items/filter >}}

{{< cards >}}
{{< item-cards path="formatters" data="formatters_info" >}}
{{< golangci/items/cards path="formatters" data="formatters_info" >}}
{{< /cards >}}
2 changes: 1 addition & 1 deletion docs/content/docs/formatters/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ title: Settings
weight: 2
---

{{% item-settings info="formatters_info" settings="formatter_settings" %}}
{{% golangci/items/settings info="formatters_info" settings="formatter_settings" %}}
20 changes: 10 additions & 10 deletions docs/content/docs/linters/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,16 @@ golangci-lint linters

## All Linters

{{< filter-bar >}}
{{< clickable-badge class="gl-filter" id="default-filter" icon="inbox" content="Default" type="info" >}}
{{< clickable-badge class="gl-filter" id="new-filter" icon="fire" content="New" type="warning" >}}
{{< clickable-badge class="gl-filter" id="autofix-filter" icon="sparkles" content="Autofix" type="info" >}}
{{< clickable-badge class="gl-filter" id="fast-filter" icon="fast-forward" content="Fast" >}}
{{< clickable-badge class="gl-filter" id="slow-filter" icon="play" content="Slow" >}}
{{< clickable-badge class="gl-filter" id="deprecated-filter" icon="emoji-sad" content="Deprecated" type="info" >}}
{{< clickable-badge class="gl-filter-reset gl-hidden" icon="trash" id="reset-filter" content="Reset" type="error" border=true >}}
{{< /filter-bar >}}
{{< golangci/items/filter >}}
{{< golangci/items/filter-badge class="gl-filter" data="default" icon="inbox" content="Default" type="info" >}}
{{< golangci/items/filter-badge class="gl-filter" data="new" icon="fire" content="New" type="warning" >}}
{{< golangci/items/filter-badge class="gl-filter" data="autofix" icon="sparkles" content="Autofix" type="info" >}}
{{< golangci/items/filter-badge class="gl-filter" data="fast" icon="fast-forward" content="Fast" >}}
{{< golangci/items/filter-badge class="gl-filter" data="slow" icon="play" content="Slow" >}}
{{< golangci/items/filter-badge class="gl-filter" data="deprecated" icon="emoji-sad" content="Deprecated" type="info" >}}
{{< golangci/items/filter-badge class="gl-filter-reset gl-hidden" icon="trash" content="Reset" type="error" border=true >}}
{{< /golangci/items/filter >}}

{{< cards >}}
{{< item-cards path="linters" data="linters_info" >}}
{{< golangci/items/cards path="linters" data="linters_info" >}}
{{< /cards >}}
2 changes: 1 addition & 1 deletion docs/content/docs/linters/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ title: Settings
weight: 2
---

{{% item-settings info="linters_info" settings="linter_settings" %}}
{{% golangci/items/settings info="linters_info" settings="linter_settings" %}}
4 changes: 2 additions & 2 deletions docs/content/docs/linters/false-positives.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,6 @@ Use `//nolint` instead of `// nolint` because directives should have no space by
Some exclusions are considered common.
To help golangci-lint users, those common exclusions are provided through presets.

{{% exclusion-presets-snippet %}}
{{% golangci/exclusion-presets-snippet %}}

{{% exclusion-preset-tables %}}
{{% golangci/exclusion-preset-tables %}}
2 changes: 1 addition & 1 deletion docs/content/docs/plugins/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ weight: 7
---

{{< cards >}}
{{< card link="/docs/plugins/module-plugins/" title="Module Plugin System" icon="puzzle" tag="Recommended" >}}
{{< card link="/docs/plugins/module-plugins/" title="Module Plugin System" icon="puzzle" tag="Recommended" tagType="icon-only:sparkles" >}}
{{< card link="/docs/plugins/go-plugins/" title="Go Plugin System" icon="puzzle" >}}
{{< /cards >}}
4 changes: 2 additions & 2 deletions docs/content/docs/plugins/module-plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Requirements:
### Configuration Example

```yaml {filename=".custom-gcl.yml"}
version: {{< latest-version >}}
version: {{< golangci/latest-version >}}
plugins:
# a plugin from a Go proxy
- module: 'github.com/golangci/plugin1'
Expand Down Expand Up @@ -81,5 +81,5 @@ linters:
The configuration file can be validated with the JSON Schema: [custom-gcl.jsonschema.json](https://golangci-lint.run/jsonschema/custom-gcl.jsonschema.json)

```yml {filename=".custom-gcl.yml"}
{{% embed file=".tmp/.custom-gcl.reference.yml" %}}
{{% golangci/embed file=".tmp/.custom-gcl.reference.yml" %}}
```
4 changes: 2 additions & 2 deletions docs/content/docs/product/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ Follow the news and releases on [Mastodon](https://fosstodon.org/@golangcilint)

If you value it, consider supporting us, we appreciate it!

{{< button text="Donate ❤️" link="/docs/donate" >}}
{{< golangci/button text="Donate ❤️" link="/docs/donate" >}}

{{% embed file=".tmp/raw_changelog.tmp" %}}
{{% golangci/embed file=".tmp/raw_changelog.tmp" %}}
2 changes: 1 addition & 1 deletion docs/content/docs/product/migration-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Other fields explicitly defined in the configuration file are migrated even if t

The `migrate` command automatically migrates `linters.presets` in individual linters to `linters.enable`.

{{% cli-output cmd="migrate" %}}
{{% golangci/cli-output cmd="migrate" %}}

## Changes

Expand Down
6 changes: 3 additions & 3 deletions docs/content/docs/product/thanks.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ aliases:

### Thanks to developers and authors of used linters

{{< custom-cards mainClass="author-cards" cols=7 >}}
{{< authors >}}
{{< /custom-cards >}}
{{< cards class="author-cards" cols=7 >}}
{{< golangci/authors >}}
{{< /cards >}}

### Thanks to all contributors

Expand Down
22 changes: 11 additions & 11 deletions docs/content/docs/welcome/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ and it can be much faster than the simple binary installation.
Also, the action creates GitHub annotations for found issues (you don't need to dig into build log to see found by golangci-lint issues).

{{< cards cols=2 >}}
{{< image-card src="/images/colored-line-number.png" title="Console Output" >}}
{{< image-card src="/images/annotations.png" title="Annotations" >}}
{{< golangci/image-card src="/images/colored-line-number.png" title="Console Output" >}}
{{< golangci/image-card src="/images/annotations.png" title="Annotations" >}}
{{< /cards >}}

### GitLab CI
Expand All @@ -48,13 +48,13 @@ Here is the other way to install golangci-lint:

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

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

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

golangci-lint --version
```
Expand All @@ -70,7 +70,7 @@ For any problems with golangci-lint, check out recent [GitHub issues](https://gi

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

golangci-lint --version
```
Expand Down Expand Up @@ -138,12 +138,12 @@ The scoop package is not officially maintained by golangci team.
### Docker

```bash
docker run --rm -v $(pwd):/app -w /app golangci/golangci-lint:{{< latest-version >}} golangci-lint run
docker run --rm -v $(pwd):/app -w /app golangci/golangci-lint:{{< golangci/latest-version >}} golangci-lint run
```

Colored output:
```bash
docker run -t --rm -v $(pwd):/app -w /app golangci/golangci-lint:{{< latest-version >}} golangci-lint run
docker run -t --rm -v $(pwd):/app -w /app golangci/golangci-lint:{{< golangci/latest-version >}} golangci-lint run
```

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

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

```bash
go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@{{< latest-version >}}
go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@{{< golangci/latest-version >}}
```

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

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

```sh
Expand Down
2 changes: 1 addition & 1 deletion docs/content/docs/welcome/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ It's not possible to mix files and packages/directories, and files must come fro

Golangci-lint can be used with zero configuration. By default, the following linters are enabled:

{{% cli-output section="defaultEnabledLinters" cmd="help linters" %}}
{{% golangci/cli-output section="defaultEnabledLinters" cmd="help linters" %}}

Pass `-E/--enable` to enable linter and `-D/--disable` to disable:

Expand Down
Loading
Loading