@@ -5,43 +5,50 @@ title: Migration guide
5
5
## Migrating configuration from v1 to v2
6
6
7
7
Golangci-lint v2 has slightly different configuration options than v1.
8
- Some options were renamed, some were moved, and some were removed.
8
+ Some options were renamed, some were moved, some were split, and some were removed.
9
9
Here is a guide how to migrate your v1 configuration.
10
10
11
- You can use ` golangci-lint ` itself to migrate your configuration through the ` migrate ` command:
11
+ You can use ` golangci-lint ` itself to migrate your configuration automatically through the ` migrate ` command:
12
12
13
13
``` sh
14
- golangci-lint config migrate
14
+ golangci-lint migrate
15
15
```
16
16
17
17
In case you want to do it manually, here is a list of changes.
18
18
19
-
20
19
### ` linters ` configuration
21
20
22
21
### ` linters-settings ` configuration
23
22
23
+ This section was removed in v2.
24
+ Most linters settings are now in the ` linters.settings ` section.
25
+ Settings for ` gci ` , ` gofmt ` , ` gofumpt ` , ` goimports ` are moved to the ` formatters.settings ` section.
26
+
24
27
### ` issues ` configuration
25
28
26
29
#### Removed
27
30
28
- * v1 *
31
+ 1 . ` issues.exclude-case-sensitive ` option.
29
32
33
+ <details >
34
+ <summary >v1</summary >
30
35
``` yaml
31
36
issues :
32
37
exclude-case-sensitive : true
33
38
` ` `
39
+ </details>
34
40
35
- *v2*
36
-
41
+ <details>
42
+ <summary>v2</summary>
37
43
` issues.exclude` and `issues.exclude-rules` are case sensitive by default.
44
+ </details>
38
45
39
46
# ### Replaced
40
47
41
- # #### `exclude-dirs` and `exclude-files` with `exclusions.paths`
42
-
43
- *v1*
48
+ 1. `exclude-dirs` and `exclude-files` with `exclusions.paths`.
44
49
50
+ <details>
51
+ <summary>v1</summary>
45
52
` ` ` yaml
46
53
issues:
47
54
exclude-dirs:
@@ -52,9 +59,11 @@ issues:
52
59
- file1
53
60
- file2
54
61
` ` `
62
+ </details>
55
63
56
- *v2*
57
64
65
+ <details>
66
+ <summary>v2</summary>
58
67
` ` ` yaml
59
68
linters:
60
69
exclusions:
@@ -65,17 +74,6 @@ linters:
65
74
- file2
66
75
` ` `
67
76
68
- ` ` ` yaml
69
- issues:
70
- exclude-dirs:
71
- - dir1
72
- - dir2
73
-
74
- exclude-files:
75
- - file1
76
- - file2
77
- ` ` `
78
-
79
77
# ## `output` configuration
80
78
81
79
# ## `run` configuration
0 commit comments