Skip to content

Commit b4bf038

Browse files
committed
docs: improve FAQ and remove -i from go install command
1 parent 6e12ea5 commit b4bf038

File tree

3 files changed

+23
-19
lines changed

3 files changed

+23
-19
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
test:
2-
go install -i ./cmd/... # needed for govet and golint
2+
go install ./cmd/... # needed for govet and golint
33
golangci-lint run -v
44
golangci-lint run --fast --no-config -v
55
golangci-lint run --no-config -v

README.md

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -371,18 +371,18 @@ nolint comment, diff, regexps; prettify paths, etc.
371371
We use `cobra` for command-line options.
372372

373373
# FAQ
374-
**Q: How do you add a custom linter?**
374+
**How do you add a custom linter?**
375375

376-
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.
377377

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**
379379

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`.
381381
By doing this you won't create new issues in your code and can choose fix existing issues (or not).
382382

383-
**Q: How to use `golangci-lint` in CI (Continuous Integration)?**
383+
**How to use `golangci-lint` in CI (Continuous Integration)?**
384384

385-
A: You have 2 choices:
385+
You have 2 choices:
386386
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).
387387
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.
388388
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/`
403403
```
404404
Vendoring `golangci-lint` saves a network request, potentially making your CI system a little more reliable.
405405

406-
**Q: `govet` or `golint` reports false-positives or false-negatives**
406+
**`govet` or `golint` reports false-positives or false-negatives**
407+
407408
These linters obtain type information from installed package files.
408409
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**
410413

411-
**Q: `golangci-lint` doesn't work**
412414
1. Update it: `go get -u github.com/golangci/golangci-lint/cmd/golangci-lint`
413415
2. Run it with `-v` option and check the output.
414416
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.

README.md.tmpl

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -243,18 +243,18 @@ nolint comment, diff, regexps; prettify paths, etc.
243243
We use `cobra` for command-line options.
244244

245245
# FAQ
246-
**Q: How do you add a custom linter?**
246+
**How do you add a custom linter?**
247247

248-
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.
249249

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**
251251

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`.
253253
By doing this you won't create new issues in your code and can choose fix existing issues (or not).
254254

255-
**Q: How to use `golangci-lint` in CI (Continuous Integration)?**
255+
**How to use `golangci-lint` in CI (Continuous Integration)?**
256256

257-
A: You have 2 choices:
257+
You have 2 choices:
258258
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).
259259
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.
260260
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/`
275275
```
276276
Vendoring `golangci-lint` saves a network request, potentially making your CI system a little more reliable.
277277

278-
**Q: `govet` or `golint` reports false-positives or false-negatives**
278+
**`govet` or `golint` reports false-positives or false-negatives**
279+
279280
These linters obtain type information from installed package files.
280281
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**
282285

283-
**Q: `golangci-lint` doesn't work**
284286
1. Update it: `go get -u github.com/golangci/golangci-lint/cmd/golangci-lint`
285287
2. Run it with `-v` option and check the output.
286288
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

Comments
 (0)