The golangci-lint tool use //nolint: machine readable comments to disable linter checks for line or block. This is useful to avoid false positives for specific file.
When saving, the comment is reformatted to // nolint:. This make things worse since golangci-lint does not treat this as comment, and it adds 2 extra failures for not formatting the nolint comment properly.
This may need to be fixed by golangci-lint by accepting // nolint:, but I think the formatter should be smarter about such comments since this is a very popular tool.
It seems that the formatter need to learn about //nolint: comments by default, or support anything with this pattern: ^//[\w+]:.
This is a pretty bad bug - your options are:
Use another editor to edit the file and fix the broken comment
Change the code to avoid lint issue
Disable the specific linter globally in the project
Check for existing issues
Describe the bug / provide steps to reproduce it
The golangci-lint tool use
//nolint:
machine readable comments to disable linter checks for line or block. This is useful to avoid false positives for specific file.When saving, the comment is reformatted to
// nolint:
. This make things worse since golangci-lint does not treat this as comment, and it adds 2 extra failures for not formatting the nolint comment properly.This may need to be fixed by golangci-lint by accepting
// nolint:
, but I think the formatter should be smarter about such comments since this is a very popular tool.It seems that the formatter need to learn about
//nolint:
comments by default, or support anything with this pattern:^//[\w+]:
.This is a pretty bad bug - your options are:
All options are bad.
https://golangci-lint.run/usage/false-positives/#nolint-directive
Environment
Zed: v0.162.3 (Zed) OS: macOS 15.1.1 Memory: 32 GiB Architecture: aarch64
If applicable, add mockups / screenshots to help explain present your vision of the feature
No response
If applicable, attach your Zed.log file to this issue.
Zed.log
``` ```