From 968f509e38c6611e29480fc89064a7d9aa00af97 Mon Sep 17 00:00:00 2001 From: Fernandez Ludovic Date: Sun, 7 Jan 2024 20:14:56 +0100 Subject: [PATCH 1/3] docs: improve typecheck FAQ --- docs/src/docs/usage/faq.mdx | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/docs/src/docs/usage/faq.mdx b/docs/src/docs/usage/faq.mdx index 22a140ffb606..dadee2f6630c 100644 --- a/docs/src/docs/usage/faq.mdx +++ b/docs/src/docs/usage/faq.mdx @@ -35,15 +35,22 @@ Usually this options is used during development on local machine and compilation ## Why do you have `typecheck` errors? -`typecheck` is like the front-end of a Go compiler, parses and type-checks Go code, it manages compilation errors. +`typecheck` is like a front-end for the Go compiler errors. +Compilation errors are identified/labeled as reports of `typecheck` but they are not produced by a linter called `typecheck`. + +`typecheck` is not a linter, it doesn't perform any analysis, +it's just a way to identify, parse, and display compiling errors (produced by the `types.Checker`) and some linter errors. It cannot be disabled because of that. Of course, this is just as good as the compiler itself and a lot of compilation issues will not properly show where in the code your error lies. -`typecheck` is not a real linter, it's just a way to parse compiling errors (produced by the `types.Checker`) and some linter errors. +As consequence, the code to analyze should compile. +It means that if you try to run an analysis on a single file or a group of files or a package or a group of packages, +with dependencies on other files or packages of your project, as it doesn't compile (because of the missing pieces of code), +it also cannot be analyzed. -If there are `typecheck` errors, golangci-lint will not able to produce other reports because that kind of error doesn't allow it to perform analysis. +If there are `typecheck` errors, golangci-lint will not able to produce other reports because that kind of error doesn't allow it to perform any analysis. How to troubleshoot: From 5db9d90df536f49da95f5908e899a48c14036ecd Mon Sep 17 00:00:00 2001 From: Fernandez Ludovic Date: Sun, 7 Jan 2024 20:40:05 +0100 Subject: [PATCH 2/3] fix: typo --- docs/src/docs/usage/faq.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/docs/usage/faq.mdx b/docs/src/docs/usage/faq.mdx index dadee2f6630c..2200b38f48d9 100644 --- a/docs/src/docs/usage/faq.mdx +++ b/docs/src/docs/usage/faq.mdx @@ -45,7 +45,7 @@ It cannot be disabled because of that. Of course, this is just as good as the compiler itself and a lot of compilation issues will not properly show where in the code your error lies. -As consequence, the code to analyze should compile. +As a consequence, the code to analyze should compile. It means that if you try to run an analysis on a single file or a group of files or a package or a group of packages, with dependencies on other files or packages of your project, as it doesn't compile (because of the missing pieces of code), it also cannot be analyzed. From 411b5f77fef0ed055020a71570728b90e8778e2a Mon Sep 17 00:00:00 2001 From: Fernandez Ludovic Date: Sun, 7 Jan 2024 20:40:43 +0100 Subject: [PATCH 3/3] docs: add a new checkbox --- docs/src/docs/usage/faq.mdx | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/src/docs/usage/faq.mdx b/docs/src/docs/usage/faq.mdx index 2200b38f48d9..4dd12558459a 100644 --- a/docs/src/docs/usage/faq.mdx +++ b/docs/src/docs/usage/faq.mdx @@ -57,4 +57,5 @@ How to troubleshoot: - [ ] Ensure the version of `golangci-lint` is built with a compatible version of Go. - [ ] Ensure dependencies are up-to-date with `go mod tidy`. - [ ] Ensure building works with `go run ./...`/`go build ./...` - whole package. +- [ ] Ensure you are not running an analysis on code that depends on files/packages outside the scope of the analyzed elements. - [ ] If using CGO, ensure all require system libraries are installed.