You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A: You can integrate it yourself, see this [wiki page](https://github.com/golangci/golangci-lint/wiki/How-to-add-a-custom-linter) with documentation. Or you can create a [GitHub Issue](https://github.com/golangci/golangci-lint/issues/new) and we will integrate when time permits.
376
+
You can integrate it yourself, see this [wiki page](https://github.com/golangci/golangci-lint/wiki/How-to-add-a-custom-linter) with documentation. Or you can create a [GitHub Issue](https://github.com/golangci/golangci-lint/issues/new) and we will integrate when time permits.
377
377
378
-
**Q: It's cool to use `golangci-lint` when starting a project, but what about existing projects with large codebase? It will take days to fix all found issues**
378
+
**It's cool to use `golangci-lint` when starting a project, but what about existing projects with large codebase? It will take days to fix all found issues**
379
379
380
-
A: We are sure that every project can easily integrate `golangci-lint`, even the large one. The idea is to not fix all existing issues. Fix only newly added issue: issues in new code. To do this setup CI (or better use [GolangCI](https://golangci.com) to run `golangci-lint` with option `--new-from-rev=origin/master`. Also, take a look at option `-n`.
380
+
We are sure that every project can easily integrate `golangci-lint`, even the large one. The idea is to not fix all existing issues. Fix only newly added issue: issues in new code. To do this setup CI (or better use [GolangCI](https://golangci.com) to run `golangci-lint` with option `--new-from-rev=origin/master`. Also, take a look at option `-n`.
381
381
By doing this you won't create new issues in your code and can choose fix existing issues (or not).
382
382
383
-
**Q: How to use `golangci-lint` in CI (Continuous Integration)?**
383
+
**How to use `golangci-lint` in CI (Continuous Integration)?**
384
384
385
-
A: You have 2 choices:
385
+
You have 2 choices:
386
386
1. Use [GolangCI](https://golangci.com): this service is highly integrated with GitHub (issues are commented in the pull request) and uses a `golangci-lint` tool. For configuration use `.golangci.yml` (or toml/json).
387
387
2. Use custom CI: just run `golangci-lint` in CI and check the exit code. If it's non-zero - fail the build. The main disadvantage is that you can't see issues in pull request code and would need to view the build log, then open the referenced source file to see the context.
388
388
If you'd like to vendor `golangci-lint` in your repo, run:
@@ -403,12 +403,14 @@ go install ./vendor/github.com/golangci/golangci-lint/cmd/golangci-lint/`
403
403
```
404
404
Vendoring `golangci-lint` saves a network request, potentially making your CI system a little more reliable.
405
405
406
-
**Q: `govet` or `golint` reports false-positives or false-negatives**
406
+
**`govet` or `golint` reports false-positives or false-negatives**
407
+
407
408
These linters obtain type information from installed package files.
408
409
The same issue you will encounter if will run `govet` or `golint` without `golangci-lint`.
409
-
Try `go install -i ./...` (or `go install -i ./cmd/...`: depends on the project) first.
410
+
Try `go install ./...` (or `go install ./cmd/...`: depends on the project) first.
411
+
412
+
**`golangci-lint` doesn't work**
410
413
411
-
**Q: `golangci-lint` doesn't work**
412
414
1. Update it: `go get -u github.com/golangci/golangci-lint/cmd/golangci-lint`
413
415
2. Run it with `-v` option and check the output.
414
416
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.
A: You can integrate it yourself, see this [wiki page](https://github.com/golangci/golangci-lint/wiki/How-to-add-a-custom-linter) with documentation. Or you can create a [GitHub Issue](https://github.com/golangci/golangci-lint/issues/new) and we will integrate when time permits.
248
+
You can integrate it yourself, see this [wiki page](https://github.com/golangci/golangci-lint/wiki/How-to-add-a-custom-linter) with documentation. Or you can create a [GitHub Issue](https://github.com/golangci/golangci-lint/issues/new) and we will integrate when time permits.
249
249
250
-
**Q: It's cool to use `golangci-lint` when starting a project, but what about existing projects with large codebase? It will take days to fix all found issues**
250
+
**It's cool to use `golangci-lint` when starting a project, but what about existing projects with large codebase? It will take days to fix all found issues**
251
251
252
-
A: We are sure that every project can easily integrate `golangci-lint`, even the large one. The idea is to not fix all existing issues. Fix only newly added issue: issues in new code. To do this setup CI (or better use [GolangCI](https://golangci.com) to run `golangci-lint` with option `--new-from-rev=origin/master`. Also, take a look at option `-n`.
252
+
We are sure that every project can easily integrate `golangci-lint`, even the large one. The idea is to not fix all existing issues. Fix only newly added issue: issues in new code. To do this setup CI (or better use [GolangCI](https://golangci.com) to run `golangci-lint` with option `--new-from-rev=origin/master`. Also, take a look at option `-n`.
253
253
By doing this you won't create new issues in your code and can choose fix existing issues (or not).
254
254
255
-
**Q: How to use `golangci-lint` in CI (Continuous Integration)?**
255
+
**How to use `golangci-lint` in CI (Continuous Integration)?**
256
256
257
-
A: You have 2 choices:
257
+
You have 2 choices:
258
258
1. Use [GolangCI](https://golangci.com): this service is highly integrated with GitHub (issues are commented in the pull request) and uses a `golangci-lint` tool. For configuration use `.golangci.yml` (or toml/json).
259
259
2. Use custom CI: just run `golangci-lint` in CI and check the exit code. If it's non-zero - fail the build. The main disadvantage is that you can't see issues in pull request code and would need to view the build log, then open the referenced source file to see the context.
260
260
If you'd like to vendor `golangci-lint` in your repo, run:
@@ -275,12 +275,14 @@ go install ./vendor/github.com/golangci/golangci-lint/cmd/golangci-lint/`
275
275
```
276
276
Vendoring `golangci-lint` saves a network request, potentially making your CI system a little more reliable.
277
277
278
-
**Q: `govet` or `golint` reports false-positives or false-negatives**
278
+
**`govet` or `golint` reports false-positives or false-negatives**
279
+
279
280
These linters obtain type information from installed package files.
280
281
The same issue you will encounter if will run `govet` or `golint` without `golangci-lint`.
281
-
Try `go install -i ./...` (or `go install -i ./cmd/...`: depends on the project) first.
282
+
Try `go install ./...` (or `go install ./cmd/...`: depends on the project) first.
283
+
284
+
**`golangci-lint` doesn't work**
282
285
283
-
**Q: `golangci-lint` doesn't work**
284
286
1. Update it: `go get -u github.com/golangci/golangci-lint/cmd/golangci-lint`
285
287
2. Run it with `-v` option and check the output.
286
288
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.
0 commit comments