Skip to content

Commit a6bae57

Browse files
committed
docs: add migration guide
1 parent feddadf commit a6bae57

File tree

2 files changed

+85
-1
lines changed

2 files changed

+85
-1
lines changed

docs/src/config/sidebar.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
link: "/product/thanks/"
2727
- label: "Changelog"
2828
link: "/product/changelog/"
29+
- label: "Migration Guide"
30+
link: "/product/migration-guide/"
2931
- label: "Roadmap"
3032
link: "/product/roadmap/"
3133
- label: "Performance"
@@ -54,4 +56,3 @@
5456
link: /plugins/module-plugins/
5557
- label: Go Plugin System
5658
link: /plugins/go-plugins/
57-
+83
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
---
2+
title: Migration guide
3+
---
4+
5+
## Migrating configuration from v1 to v2
6+
7+
Golangci-lint v2 has slightly different configuration options than v1.
8+
Some options were renamed, some were moved, and some were removed.
9+
Here is a guide how to migrate your v1 configuration.
10+
11+
You can use `golangci-lint` itself to migrate your configuration through the `migrate` command:
12+
13+
```sh
14+
golangci-lint config migrate
15+
```
16+
17+
In case you want to do it manually, here is a list of changes.
18+
19+
20+
### `linters` configuration
21+
22+
### `linters-settings` configuration
23+
24+
### `issues` configuration
25+
26+
#### Removed
27+
28+
*v1*
29+
30+
```yaml
31+
issues:
32+
exclude-case-sensitive: true
33+
```
34+
35+
*v2*
36+
37+
`issues.exclude` and `issues.exclude-rules` are case sensitive by default.
38+
39+
#### Replaced
40+
41+
##### `exclude-dirs` and `exclude-files` with `exclusions.paths`
42+
43+
*v1*
44+
45+
```yaml
46+
issues:
47+
exclude-dirs:
48+
- dir1
49+
- dir2
50+
51+
exclude-files:
52+
- file1
53+
- file2
54+
```
55+
56+
*v2*
57+
58+
```yaml
59+
linters:
60+
exclusions:
61+
paths:
62+
- dir1
63+
- dir2
64+
- file1
65+
- file2
66+
```
67+
68+
```yaml
69+
issues:
70+
exclude-dirs:
71+
- dir1
72+
- dir2
73+
74+
exclude-files:
75+
- file1
76+
- file2
77+
```
78+
79+
### `output` configuration
80+
81+
### `run` configuration
82+
83+
### `severity` configuration

0 commit comments

Comments
 (0)