Skip to content

Commit f56b21f

Browse files
committed
docs: rename .golangci.example.yml to .golangci.reference.yml
The name of this file leads many people to think that this file is an example configuration. This file is a configuration reference: it contains the exhaustive configuration with explanations of the options. This is not an example configuration.
1 parent e889b40 commit f56b21f

File tree

7 files changed

+12
-9
lines changed

7 files changed

+12
-9
lines changed

.golangci.example.yml renamed to .golangci.documentation.yml

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# This file contains all available configuration options
22
# with their default values (in comments).
3+
#
4+
# This file is not a configuration example,
5+
# it contains the exhaustive configuration with explanations of the options.
36

47
# Options for analysis running.
58
run:

docs/src/docs/contributing/faq.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Just update it's version in `go.mod`.
2121
## How to add configuration option to existing linter
2222

2323
Add a new field to a [config struct](https://github.com/golangci/golangci-lint/blob/master/pkg/config/config.go).
24-
Document it in [.golangci.example.yml](https://github.com/golangci/golangci-lint/blob/master/.golangci.example.yml).
24+
Document it in [.golangci.reference.yml](https://github.com/golangci/golangci-lint/blob/master/.golangci.reference.yml).
2525
Pass it to a linter.
2626

2727
## How to see `INFO` or `DEBUG` logs

docs/src/docs/contributing/new-linters.mdx

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ After that:
2626
to the function `GetAllSupportedLinterConfigs`.
2727
- Add `WithSince("next_version")`, where `next_version` must be replaced by the next minor version. (ex: v1.2.0 if the current version is v1.1.0)
2828
4. Find out what options do you need to configure for the linter.
29-
For example, `nakedret` has only 1 option: [`max-func-lines`](https://github.com/golangci/golangci-lint/blob/master/.golangci.example.yml).
29+
For example, `nakedret` has only 1 option: [`max-func-lines`](https://github.com/golangci/golangci-lint/blob/master/.golangci.reference.yml).
3030
Choose default values to not being annoying for users of golangci-lint. Add configuration options to:
31-
- [.golangci.example.yml](https://github.com/golangci/golangci-lint/blob/master/.golangci.example.yml) - the example of a configuration file.
31+
- [.golangci.reference.yml](https://github.com/golangci/golangci-lint/blob/master/.golangci.reference.yml) - the example of a configuration file.
3232
You can also add them to [.golangci.yml](https://github.com/golangci/golangci-lint/blob/master/.golangci.yml)
3333
if you think that this project needs not default values.
3434
- [config struct](https://github.com/golangci/golangci-lint/blob/master/pkg/config/config.go) -

docs/src/docs/contributing/workflow.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Which runs all the linters and tests.
3737

3838
## Create or update parameters for docs
3939

40-
Add your new or updated parameters to `.golangci.example.yml` so they will be shown in the docs
40+
Add your new or updated parameters to `.golangci.reference.yml` so they will be shown in the docs
4141

4242
## Submit a pull request
4343

docs/src/docs/usage/configuration.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ To see which config file is being used and where it was sourced from run golangc
2828
Config options inside the file are identical to command-line options.
2929
You can configure specific linters' options only within the config file (not the command-line).
3030

31-
There is a [`.golangci.example.yml`](https://github.com/golangci/golangci-lint/blob/master/.golangci.example.yml) file with all supported options, their description, and default values.
31+
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 a neither a working example nor recommended configuration, it's just a reference to display all the configuration options.
3333

3434
{ .ConfigurationExample }

scripts/expand_website_templates/main.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -164,14 +164,14 @@ func getLatestVersion() (string, error) {
164164
}
165165

166166
func buildTemplateContext() (map[string]string, error) {
167-
golangciYamlExample, err := os.ReadFile(".golangci.example.yml")
167+
golangciYamlExample, err := os.ReadFile(".golangci.reference.yml")
168168
if err != nil {
169-
return nil, fmt.Errorf("can't read .golangci.example.yml: %w", err)
169+
return nil, fmt.Errorf("can't read .golangci.reference.yml: %w", err)
170170
}
171171

172172
snippets, err := extractExampleSnippets(golangciYamlExample)
173173
if err != nil {
174-
return nil, fmt.Errorf("can't read .golangci.example.yml: %w", err)
174+
return nil, fmt.Errorf("can't read .golangci.reference.yml: %w", err)
175175
}
176176

177177
if err = exec.Command("make", "build").Run(); err != nil {

scripts/expand_website_templates/main_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
func Test_extractExampleSnippets(t *testing.T) {
1111
t.Skip("only for debugging purpose")
1212

13-
example, err := os.ReadFile("../../../golangci-lint/.golangci.example.yml")
13+
example, err := os.ReadFile("../../../golangci-lint/.golangci.reference.yml")
1414
require.NoError(t, err)
1515

1616
m, err := extractExampleSnippets(example)

0 commit comments

Comments
 (0)