Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable "errorlint" to prevent false-positive errors #39

Closed
svengreb opened this issue Nov 16, 2020 · 0 comments · Fixed by #40
Closed

Disable "errorlint" to prevent false-positive errors #39

svengreb opened this issue Nov 16, 2020 · 0 comments · Fixed by #40

Comments

@svengreb
Copy link
Owner

svengreb commented Nov 16, 2020

In #21 golangci-lint was updated to the currently latest version 1.32.0 which introduced the errorlint that has been enabled for this template repository. As it turns out it causes a lot of false-positives errors for code lines that explicitly do not wrap the error to prevent it become part of the public API.
Therefore the linter will be disabled again because the update also introduced the new wrapcheck linter which helps to prevent that errors from external packages are exposed to the public API.

@svengreb svengreb added this to the Next milestone Nov 16, 2020
@svengreb svengreb self-assigned this Nov 16, 2020
svengreb added a commit that referenced this issue Nov 16, 2020
In GH-21 [1] "golangci-lint" was updated to the currently latest version
1.32.0 [2] which introduced the errorlint [3] that has been enabled for
this template repository. As it turns out it causes a lot of
false-positives errors for code lines that explicitly do not wrap the
error to prevent it become part of the public API.
Therefore the linter has been disabled again because the update also
introduced the new wrapcheck [4] linter which helps to prevent that
errors from external packages are exposed to the public API.

[1]: #21
[2]: https://github.com/golangci/golangci-lint/releases/tag/v1.32.0
[3]: https://github.com/polyfloyd/go-errorlint
[4]: https://github.com/tomarrell/wrapcheck

GH-39
svengreb added a commit that referenced this issue Nov 16, 2020
In GH-21 [1] "golangci-lint" was updated to the currently latest version
1.32.0 [2] which introduced the errorlint [3] that has been enabled for
this template repository. As it turns out it causes a lot of
false-positives errors for code lines that explicitly do not wrap the
error to prevent it become part of the public API.
Therefore the linter has been disabled again because the update also
introduced the new wrapcheck [4] linter which helps to prevent that
errors from external packages are exposed to the public API.

[1]: #21
[2]: https://github.com/golangci/golangci-lint/releases/tag/v1.32.0
[3]: https://github.com/polyfloyd/go-errorlint
[4]: https://github.com/tomarrell/wrapcheck

Closes GH-39
@svengreb svengreb removed their assignment Nov 16, 2020
svengreb added a commit that referenced this issue Nov 18, 2021
The currently latest `golangci-lint` version 1.43.0 [1] introduced new
linters and updated supported ones:

1. tagliatelle [2] (v1.40.0 [3]) - Handles `struct` tags name casing.
   This linter is disabled by default, but will be enabled for this
   template to improve consistency across tag names.
2. errorlint [4] (v1.40.0 [3]) - This linter has been disabled in
   GH-39 [22] due to prevent false-positive errors, but will be enabled
   again with the newly introduced `errorf` option [5] being disabled to
   prevent this from happening again while still taking advantage of the
   `assert` and `comparison` checks.
3. wrapcheck [6] (v1.40.0 [3]) - This linter is known to cause
   false-positive errors for the main module (`go list -m`) of the
   repository where `golangic-lint` is being run, but in
   version `2.3.0` [7] the `ignorePackageGlobs` option was added that
   allows to ignore packages by pattern.
   Therefore in each project the main module should be added as
   wildcard. Also see tomarrell/wrapcheck#2 [8] for details and
   discussions about this known problem.
4. golint [9] (v1.40.1 [10]) - Remove deprecated linter.
   4.1 The recommended drop-in replacement is revive [21] which is
   disabled by default, but will be enabled for this template.
5. gofumpt [17] (v1.42.0 [16]) - Add the `lang-version` with value set
   to `1.17` to target the (currently) latest Go version.
6. bidichk [11] (v1.43.0 [12]) - Checks for dangerous unicode character
   sequences. This linter is disabled by default, but will be enabled
   for this template to prevent "trojan source" bugs.
7. nilnil [13] (v1.43.0 [12]) - Checks that there is no simultaneous
   return of `nil` error and an invalid value.
   This linter is disabled by default, but will be enabled for this
   template to prevent ambiguous returns.
8. tenv [14] (v1.43.0 [12]) - Detects using `os.Setenv` instead of
   `t.Setenv` since Go 1.17.
   This linter is disabled by default, but will be enabled for this
   template to prevent errors in tests.
9. contextcheck [15] (v1.43.0 [12]) - Checks if functions whether use a
   non-inherited context.
   This linter is disabled by default, but will be enabled for this
   template to broken call chains and loss of context information.
10. lll [18] - Add the `tab-width` option with value set to `2` to use
    two spaces for the width of one tab.
11. gci [19] - Add the comma-separated [list of prefixes for local
    package imports][20] to be put after 3rd-party packages.

[1]: https://github.com/golangci/golangci-lint/releases/tag/v1.43.0
[2]: https://github.com/ldez/tagliatelle
[3]: https://github.com/golangci/golangci-lint/releases/tag/v1.40.0
[4]: https://github.com/polyfloyd/go-errorlint
[5]: https://golangci-lint.run/usage/linters/#errorlint
[6]: https://github.com/tomarrell/wrapcheck
[7]: https://github.com/tomarrell/wrapcheck/releases/tag/v2.3.0
[8]: tomarrell/wrapcheck#2
[9]: https://github.com/golang/lint
[10]: https://github.com/golangci/golangci-lint/releases/tag/v1.40.1
[11]: https://github.com/breml/bidichk
[12]: https://github.com/golangci/golangci-lint/releases/tag/v1.43.0
[13]: https://github.com/Antonboom/nilnil
[14]: https://github.com/sivchari/tenv
[15]: https://github.com/sylvia7788/contextcheck
[16]: https://github.com/golangci/golangci-lint/releases/tag/v1.42.0
[17]: https://github.com/mvdan/gofumpt
[18]: https://github.com/walle/lll
[19]: https://github.com/daixiang0/gci
[20]: https://golangci-lint.run/usage/linters/#gci
[21]: https://github.com/mgechev/revive
[22]: #39

GH-64
svengreb added a commit that referenced this issue Nov 18, 2021
The currently latest `golangci-lint` version 1.43.0 [1] introduced new
linters and updated supported ones:

1. tagliatelle [2] (v1.40.0 [3]) - Handles `struct` tags name casing.
   This linter is disabled by default, but will be enabled for this
   template to improve consistency across tag names.
2. errorlint [4] (v1.40.0 [3]) - This linter has been disabled in
   GH-39 [22] due to prevent false-positive errors, but will be enabled
   again with the newly introduced `errorf` option [5] being disabled to
   prevent this from happening again while still taking advantage of the
   `assert` and `comparison` checks.
3. wrapcheck [6] (v1.40.0 [3]) - This linter is known to cause
   false-positive errors for the main module (`go list -m`) of the
   repository where `golangic-lint` is being run, but in
   version `2.3.0` [7] the `ignorePackageGlobs` option was added that
   allows to ignore packages by pattern.
   Therefore in each project the main module should be added as
   wildcard. Also see tomarrell/wrapcheck#2 [8] for details and
   discussions about this known problem.
4. golint [9] (v1.40.1 [10]) - Remove deprecated linter.
   4.1 The recommended drop-in replacement is revive [21] which is
   disabled by default, but will be enabled for this template.
5. gofumpt [17] (v1.42.0 [16]) - Add the `lang-version` with value set
   to `1.17` to target the (currently) latest Go version.
6. bidichk [11] (v1.43.0 [12]) - Checks for dangerous unicode character
   sequences. This linter is disabled by default, but will be enabled
   for this template to prevent "trojan source" bugs.
7. nilnil [13] (v1.43.0 [12]) - Checks that there is no simultaneous
   return of `nil` error and an invalid value.
   This linter is disabled by default, but will be enabled for this
   template to prevent ambiguous returns.
8. tenv [14] (v1.43.0 [12]) - Detects using `os.Setenv` instead of
   `t.Setenv` since Go 1.17.
   This linter is disabled by default, but will be enabled for this
   template to prevent errors in tests.
9. contextcheck [15] (v1.43.0 [12]) - Checks if functions whether use a
   non-inherited context.
   This linter is disabled by default, but will be enabled for this
   template to broken call chains and loss of context information.
10. lll [18] - Add the `tab-width` option with value set to `2` to use
    two spaces for the width of one tab.
11. gci [19] - Add the comma-separated [list of prefixes for local
    package imports][20] to be put after 3rd-party packages.

[1]: https://github.com/golangci/golangci-lint/releases/tag/v1.43.0
[2]: https://github.com/ldez/tagliatelle
[3]: https://github.com/golangci/golangci-lint/releases/tag/v1.40.0
[4]: https://github.com/polyfloyd/go-errorlint
[5]: https://golangci-lint.run/usage/linters/#errorlint
[6]: https://github.com/tomarrell/wrapcheck
[7]: https://github.com/tomarrell/wrapcheck/releases/tag/v2.3.0
[8]: tomarrell/wrapcheck#2
[9]: https://github.com/golang/lint
[10]: https://github.com/golangci/golangci-lint/releases/tag/v1.40.1
[11]: https://github.com/breml/bidichk
[12]: https://github.com/golangci/golangci-lint/releases/tag/v1.43.0
[13]: https://github.com/Antonboom/nilnil
[14]: https://github.com/sivchari/tenv
[15]: https://github.com/sylvia7788/contextcheck
[16]: https://github.com/golangci/golangci-lint/releases/tag/v1.42.0
[17]: https://github.com/mvdan/gofumpt
[18]: https://github.com/walle/lll
[19]: https://github.com/daixiang0/gci
[20]: https://golangci-lint.run/usage/linters/#gci
[21]: https://github.com/mgechev/revive
[22]: #39

GH-64
svengreb added a commit that referenced this issue Nov 18, 2021
The currently latest `golangci-lint` version 1.43.0 [1] introduced new
linters and updated supported ones:

1. tagliatelle [2] (v1.40.0 [3]) - Handles `struct` tags name casing.
   This linter is disabled by default, but will be enabled for this
   template to improve consistency across tag names.
2. errorlint [4] (v1.40.0 [3]) - This linter has been disabled in
   GH-39 [22] due to prevent false-positive errors, but will be enabled
   again with the newly introduced `errorf` option [5] being disabled to
   prevent this from happening again while still taking advantage of the
   `assert` and `comparison` checks.
3. wrapcheck [6] (v1.40.0 [3]) - This linter is known to cause
   false-positive errors for the main module (`go list -m`) of the
   repository where `golangic-lint` is being run, but in
   version `2.3.0` [7] the `ignorePackageGlobs` option was added that
   allows to ignore packages by pattern.
   Therefore in each project the main module should be added as
   wildcard. Also see tomarrell/wrapcheck#2 [8] for details and
   discussions about this known problem.
4. golint [9] (v1.40.1 [10]) - Remove deprecated linter.
   4.1 The recommended drop-in replacement is revive [21] which is
   disabled by default, but will be enabled for this template.
5. gofumpt [17] (v1.42.0 [16]) - Add the `lang-version` with value set
   to `1.17` to target the (currently) latest Go version.
6. bidichk [11] (v1.43.0 [12]) - Checks for dangerous unicode character
   sequences. This linter is disabled by default, but will be enabled
   for this template to prevent "trojan source" bugs.
7. nilnil [13] (v1.43.0 [12]) - Checks that there is no simultaneous
   return of `nil` error and an invalid value.
   This linter is disabled by default, but will be enabled for this
   template to prevent ambiguous returns.
8. tenv [14] (v1.43.0 [12]) - Detects using `os.Setenv` instead of
   `t.Setenv` since Go 1.17.
   This linter is disabled by default, but will be enabled for this
   template to prevent errors in tests.
9. contextcheck [15] (v1.43.0 [12]) - Checks if functions whether use a
   non-inherited context.
   This linter is disabled by default, but will be enabled for this
   template to broken call chains and loss of context information.
10. lll [18] - Add the `tab-width` option with value set to `2` to use
    two spaces for the width of one tab.
11. gci [19] - Add the comma-separated [list of prefixes for local
    package imports][20] to be put after 3rd-party packages.

[1]: https://github.com/golangci/golangci-lint/releases/tag/v1.43.0
[2]: https://github.com/ldez/tagliatelle
[3]: https://github.com/golangci/golangci-lint/releases/tag/v1.40.0
[4]: https://github.com/polyfloyd/go-errorlint
[5]: https://golangci-lint.run/usage/linters/#errorlint
[6]: https://github.com/tomarrell/wrapcheck
[7]: https://github.com/tomarrell/wrapcheck/releases/tag/v2.3.0
[8]: tomarrell/wrapcheck#2
[9]: https://github.com/golang/lint
[10]: https://github.com/golangci/golangci-lint/releases/tag/v1.40.1
[11]: https://github.com/breml/bidichk
[12]: https://github.com/golangci/golangci-lint/releases/tag/v1.43.0
[13]: https://github.com/Antonboom/nilnil
[14]: https://github.com/sivchari/tenv
[15]: https://github.com/sylvia7788/contextcheck
[16]: https://github.com/golangci/golangci-lint/releases/tag/v1.42.0
[17]: https://github.com/mvdan/gofumpt
[18]: https://github.com/walle/lll
[19]: https://github.com/daixiang0/gci
[20]: https://golangci-lint.run/usage/linters/#gci
[21]: https://github.com/mgechev/revive
[22]: #39

Closes GH-64
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant