Skip to content

Commit d736d09

Browse files
authored
docs: organize sections and pages (#4493)
1 parent 4adac52 commit d736d09

File tree

13 files changed

+126
-126
lines changed

13 files changed

+126
-126
lines changed

docs/src/config/sidebar.yml

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

33
- label: "Introduction"
44
link: "/"
5-
- label: Usage
5+
- label: Welcome
66
items:
77
- label: "Install"
8-
link: "/usage/install/"
8+
link: "/welcome/install/"
99
- label: "Quick Start"
10-
link: "/usage/quick-start/"
10+
link: "/welcome/quick-start/"
1111
- label: "Integrations"
12-
link: "/usage/integrations/"
13-
- label: "Linters"
14-
link: "/usage/linters/"
12+
link: "/welcome/integrations/"
13+
- label: "FAQ"
14+
link: "/welcome/faq/"
15+
- label: Usage
16+
items:
1517
- label: "Configuration"
1618
link: "/usage/configuration/"
19+
- label: "Linters"
20+
link: "/usage/linters/"
1721
- label: "False Positives"
1822
link: "/usage/false-positives/"
19-
- label: "Performance"
20-
link: "/usage/performance/"
21-
- label: "FAQ"
22-
link: "/usage/faq/"
2323
- label: Product
2424
items:
25-
- label: "Roadmap"
26-
link: "/product/roadmap/"
2725
- label: "Thanks"
2826
link: "/product/thanks/"
2927
- label: "Trusted By"
3028
link: "/product/trusted-by/"
29+
- label: "Changelog"
30+
link: "/product/changelog/"
31+
- label: "Roadmap"
32+
link: "/product/roadmap/"
33+
- label: "Performance"
34+
link: "/product/performance/"
3135
- label: "GitHub"
3236
link: "https://github.com/golangci/golangci-lint"
3337
- label: Contributing

docs/src/docs/product/changelog.mdx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
title: Changelog
3+
---
4+
5+
## Changelog
6+
7+
{.ChangeLog}

docs/src/docs/product/roadmap.mdx

Lines changed: 48 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,55 @@ Please file an issue for bugs, missing documentation, or unexpected behavior.
1414

1515
[See Bugs](https://github.com/golangci/golangci-lint/issues?utf8=✓&q=is%3Aissue+is%3Aopen+label%3A%22bug%22+sort%3Acreated-desc)
1616

17-
## Changelog
17+
## Versioning Policy
1818

19-
{.ChangeLog}
19+
`golangci-lint` follows [semantic versioning](https://semver.org). However, due to the nature of `golangci-lint` as a code quality tool,
20+
it's not always clear when a minor or major version bump occurs. To help clarify this for everyone, we've defined the following semantic versioning policy:
21+
22+
- Patch release (intended to not break your lint build)
23+
- A patch version update in a specific linter that results in `golangci-lint` reporting fewer errors.
24+
- A bug fix to the CLI or core (packages loading, runner, postprocessors, etc).
25+
- Improvements to documentation.
26+
- Non-user-facing changes such as refactoring code, adding, deleting, or modifying tests, and increasing test coverage.
27+
- Re-releasing after a failed release (i.e., publishing a release that doesn't work for anyone).
28+
- Minor release (might break your lint build because of newly found issues)
29+
- A major or minor version update of a specific linter that results in `golangci-lint` reporting more errors.
30+
- A new linter is added.
31+
- An existing configuration option or linter is deprecated.
32+
- A new CLI command is created.
33+
- Backward incompatible change of configuration with extremely low impact, e.g. adding validation of a list of enabled `go-critic` checkers.
34+
- Major release (likely to break your lint build)
35+
- Backward incompatible change of configuration with huge impact, e.g. removing excluding issues about missed comments from `golint` by default.
36+
- A linter is removed.
37+
38+
According to our policy, any minor update may report more errors than the previous release (ex: from a bug fix).
39+
As such, we recommend using the fixed minor version and fixed or the latest patch version to guarantee the results of your builds.
40+
41+
For example, in our [GitHub Action](https://github.com/golangci/golangci-lint-action) we require users to explicitly set the minor version of `golangci-lint`
42+
and we always use the latest patch version.
43+
44+
## Linter Deprecation Cycle
45+
46+
A linter can be deprecated for various reasons, e.g. the linter stops working with a newer version of Go or the author has abandoned its linter.
47+
48+
The deprecation of a linter will follow 3 phases:
49+
50+
1. **Display of a warning message**: The linter can still be used (unless it's completely non-functional), but it's recommended to remove it from your configuration.
51+
2. **Display of an error message**: At this point, you should remove the linter. The original implementation is replaced by a placeholder that does nothing.
52+
3. **Removal of the linter** from golangci-lint.
53+
54+
Each phase corresponds to a minor version:
55+
56+
- v1.0.0 -> warning message
57+
- v1.1.0 -> error message
58+
- v1.2.0 -> linter removed
59+
60+
The deprecated linters are removed from presets immediately when they are deprecated (phase 1).
61+
62+
We will provide clear information about those changes on different supports: changelog, logs, social network, etc.
63+
64+
We consider the removal of a linter as non-breaking changes for golangci-lint itself.
65+
No major version will be created when a linter is removed.
2066

2167
## Future Plans
2268

docs/src/docs/usage/configuration.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ You can configure specific linters' options only within the config file (not the
3131
There is a [`.golangci.reference.yml`](https://github.com/golangci/golangci-lint/blob/master/.golangci.reference.yml) file with all supported options, their description, and default values.
3232
This file is neither a working example nor a recommended configuration, it's just a reference to display all the configuration options.
3333

34+
The configuration file can be validated with the JSON Schema: https://golangci-lint.run/jsonschema/golangci.jsonschema.json
35+
3436
{ .ConfigurationExample }
3537

3638
## Command-Line Options

docs/src/docs/usage/faq.mdx renamed to docs/src/docs/welcome/faq.mdx

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -2,55 +2,22 @@
22
title: FAQ
33
---
44

5-
## How do you add a custom linter?
6-
7-
You can integrate it yourself, see this [manual](/contributing/new-linters/).
8-
Or you can create a [GitHub Issue](https://github.com/golangci/golangci-lint/issues/new) and we will integrate when time permits.
9-
10-
## How to integrate `golangci-lint` into large project with thousands of issues
11-
12-
We are sure that every project can easily integrate `golangci-lint`, even the large one.
13-
14-
The idea is to not fix all existing issues. Fix only newly added issue: issues in new code.
15-
To do this setup CI to run `golangci-lint` with option `--new-from-rev=HEAD~1`.
16-
17-
Also, take a look at option `--new`, but consider that CI scripts that generate unstaged files will make `--new` only point out issues in those files and not in the last commit.
18-
In that regard `--new-from-rev=HEAD~1` is safer.
19-
20-
By doing this you won't create new issues in your code and can choose fix existing issues (or not).
21-
22-
## Why `--new-from-rev` or `--new-from-patch` don't seem to be working in some cases?
23-
24-
The options `--new-from-rev` and `--new-from-patch` work by comparing `git diff` output and issues.
25-
26-
If an issue is not reported as the same line as the changes then the issue will be skipped.
27-
This is the line of the issue is not inside the lines changed.
5+
## Which Go versions are supported
286

29-
To fix that you have to use the option `--whole-files`.
30-
31-
The side effect is the issues inside file that contains changes but not directly related to the changes themselves will be reported.
7+
The same as the Go team (the 2 latest minor versions).
328

339
## How to use `golangci-lint` in CI
3410

3511
Run `golangci-lint` in CI and check the exit code. If it's non-zero - fail the build.
3612

3713
See [how to properly install `golangci-lint` in CI](/usage/install#ci-installation)
3814

39-
## Which Go versions are supported
40-
41-
The same as the Go team (the 2 last minor versions)
42-
4315
## `golangci-lint` doesn't work
4416

4517
1. Please, ensure you are using the latest binary release.
4618
2. Run it with `-v` option and check the output.
4719
3. If it doesn't help create a [GitHub issue](https://github.com/golangci/golangci-lint/issues/new) with the output from the error and #2 above.
4820

49-
## Why running with `--fast` is slow on the first run
50-
51-
Because the first run caches type information. All subsequent runs will be fast.
52-
Usually this options is used during development on local machine and compilation was already performed.
53-
5421
## Why do you have `typecheck` errors?
5522

5623
`typecheck` is like a front-end for the Go compiler errors.
@@ -77,3 +44,36 @@ How to troubleshoot:
7744
- [ ] Ensure building works with `go run ./...`/`go build ./...` - whole package.
7845
- [ ] Ensure you are not running an analysis on code that depends on files/packages outside the scope of the analyzed elements.
7946
- [ ] If using CGO, ensure all require system libraries are installed.
47+
48+
## Why running with `--fast` is slow on the first run
49+
50+
Because the first run caches type information. All subsequent runs will be fast.
51+
Usually this options is used during development on local machine and compilation was already performed.
52+
53+
## How do you add a custom linter?
54+
55+
You can integrate it yourself, see this [manual](/contributing/new-linters/).
56+
Or you can create a [GitHub Issue](https://github.com/golangci/golangci-lint/issues/new) and we will integrate when time permits.
57+
58+
## How to integrate `golangci-lint` into large project with thousands of issues
59+
60+
We are sure that every project can easily integrate `golangci-lint`, even the large one.
61+
62+
The idea is to not fix all existing issues. Fix only newly added issue: issues in new code.
63+
To do this setup CI to run `golangci-lint` with option `--new-from-rev=HEAD~1`.
64+
65+
Also, take a look at option `--new`, but consider that CI scripts that generate unstaged files will make `--new` only point out issues in those files and not in the last commit.
66+
In that regard `--new-from-rev=HEAD~1` is safer.
67+
68+
By doing this you won't create new issues in your code and can choose fix existing issues (or not).
69+
70+
## Why `--new-from-rev` or `--new-from-patch` don't seem to be working in some cases?
71+
72+
The options `--new-from-rev` and `--new-from-patch` work by comparing `git diff` output and issues.
73+
74+
If an issue is not reported as the same line as the changes then the issue will be skipped.
75+
This is the line of the issue is not inside the lines changed.
76+
77+
To fix that you have to use the option `--whole-files`.
78+
79+
The side effect is the issues inside file that contains changes but not directly related to the changes themselves will be reported.

docs/src/docs/usage/install/index.mdx renamed to docs/src/docs/welcome/install.mdx

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -124,56 +124,6 @@ go install github.com/golangci/golangci-lint/cmd/golangci-lint@{.LatestVersion}
124124

125125
</div>
126126

127-
## Versioning Policy
128-
129-
`golangci-lint` follows [semantic versioning](https://semver.org). However, due to the nature of `golangci-lint` as a code quality tool,
130-
it's not always clear when a minor or major version bump occurs. To help clarify this for everyone, we've defined the following semantic versioning policy:
131-
132-
- Patch release (intended to not break your lint build)
133-
- A patch version update in a specific linter that results in `golangci-lint` reporting fewer errors.
134-
- A bug fix to the CLI or core (packages loading, runner, postprocessors, etc).
135-
- Improvements to documentation.
136-
- Non-user-facing changes such as refactoring code, adding, deleting, or modifying tests, and increasing test coverage.
137-
- Re-releasing after a failed release (i.e., publishing a release that doesn't work for anyone).
138-
- Minor release (might break your lint build because of newly found issues)
139-
- A major or minor version update of a specific linter that results in `golangci-lint` reporting more errors.
140-
- A new linter is added.
141-
- An existing configuration option or linter is deprecated.
142-
- A new CLI command is created.
143-
- Backward incompatible change of configuration with extremely low impact, e.g. adding validation of a list of enabled `go-critic` checkers.
144-
- Major release (likely to break your lint build)
145-
- Backward incompatible change of configuration with huge impact, e.g. removing excluding issues about missed comments from `golint` by default.
146-
- A linter is removed.
147-
148-
According to our policy, any minor update may report more errors than the previous release (ex: from a bug fix).
149-
As such, we recommend using the fixed minor version and fixed or the latest patch version to guarantee the results of your builds.
150-
151-
For example, in our [GitHub Action](https://github.com/golangci/golangci-lint-action) we require users to explicitly set the minor version of `golangci-lint`
152-
and we always use the latest patch version.
153-
154-
## Linter Deprecation Cycle
155-
156-
A linter can be deprecated for various reasons, e.g. the linter stops working with a newer version of Go or the author has abandoned its linter.
157-
158-
The deprecation of a linter will follow 3 phases:
159-
160-
1. **Display of a warning message**: The linter can still be used (unless it's completely non-functional), but it's recommended to remove it from your configuration.
161-
2. **Display of an error message**: At this point, you should remove the linter. The original implementation is replaced by a placeholder that does nothing.
162-
3. **Removal of the linter** from golangci-lint.
163-
164-
Each phase corresponds to a minor version:
165-
166-
- v1.0.0 -> warning message
167-
- v1.1.0 -> error message
168-
- v1.2.0 -> linter removed
169-
170-
The deprecated linters are removed from presets immediately when they are deprecated (phase 1).
171-
172-
We will provide clear information about those changes on different supports: changelog, logs, social network, etc.
173-
174-
We consider the removal of a linter as non-breaking changes for golangci-lint itself.
175-
No major version will be created when a linter is removed.
176-
177127
## Next
178128

179129
[Quick Start: how to use `golangci-lint`](/usage/quick-start).

docs/src/docs/usage/quick-start.mdx renamed to docs/src/docs/welcome/quick-start.mdx

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,23 +22,17 @@ golangci-lint run dir1 dir2/... dir3/file1.go
2222

2323
Directories are NOT analyzed recursively. To analyze them recursively append `/...` to their path.
2424

25-
GolangCI-Lint can be used with zero configuration. By default the following linters are enabled:
25+
GolangCI-Lint can be used with zero configuration. By default, the following linters are enabled:
2626

2727
```sh
2828
$ golangci-lint help linters
2929
{.LintersCommandOutputEnabledOnly}
3030
```
3131

32-
and the following linters are disabled by default:
33-
34-
```sh
35-
$ golangci-lint help linters
36-
...
37-
{.LintersCommandOutputDisabledOnly}
38-
```
39-
4032
Pass `-E/--enable` to enable linter and `-D/--disable` to disable:
4133

4234
```sh
4335
golangci-lint run --disable-all -E errcheck
4436
```
37+
38+
More information about available linters can be found in the [linters page](/usage/linters/).

scripts/website/dump_info/main.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,8 @@ func saveCLIHelp(dst string) error {
105105
shortHelp := bytes.Join(helpLines[2:], []byte("\n"))
106106

107107
data := types.CLIHelp{
108-
Enable: string(lintersOutParts[0]),
109-
Disable: string(lintersOutParts[1]),
110-
Help: string(shortHelp),
108+
Enable: string(lintersOutParts[0]),
109+
Help: string(shortHelp),
111110
}
112111

113112
return saveToJSONFile(dst, data)

scripts/website/expand_templates/main.go

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -161,18 +161,17 @@ func buildTemplateContext() (map[string]string, error) {
161161
}
162162

163163
return map[string]string{
164-
"CustomGCLReference": pluginReference,
165-
"LintersExample": snippets.LintersSettings,
166-
"ConfigurationExample": snippets.ConfigurationFile,
167-
"LintersCommandOutputEnabledOnly": helps.Enable,
168-
"LintersCommandOutputDisabledOnly": helps.Disable,
169-
"EnabledByDefaultLinters": getLintersListMarkdown(true),
170-
"DisabledByDefaultLinters": getLintersListMarkdown(false),
171-
"DefaultExclusions": exclusions,
172-
"ThanksList": getThanksList(),
173-
"RunHelpText": helps.Help,
174-
"ChangeLog": string(changeLog),
175-
"LatestVersion": latestVersion,
164+
"CustomGCLReference": pluginReference,
165+
"LintersExample": snippets.LintersSettings,
166+
"ConfigurationExample": snippets.ConfigurationFile,
167+
"LintersCommandOutputEnabledOnly": helps.Enable,
168+
"EnabledByDefaultLinters": getLintersListMarkdown(true),
169+
"DisabledByDefaultLinters": getLintersListMarkdown(false),
170+
"DefaultExclusions": exclusions,
171+
"ThanksList": getThanksList(),
172+
"RunHelpText": helps.Help,
173+
"ChangeLog": string(changeLog),
174+
"LatestVersion": latestVersion,
176175
}, nil
177176
}
178177

scripts/website/types/types.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@ import (
55
)
66

77
type CLIHelp struct {
8-
Enable string `json:"enable"`
9-
Disable string `json:"disable"`
10-
Help string `json:"help"`
8+
Enable string `json:"enable"`
9+
Help string `json:"help"`
1110
}
1211

1312
type ExcludePattern struct {

0 commit comments

Comments
 (0)