CI: add more linters#92
Conversation
|
@kolyshkin can you rebase this one and move it out of draft? |
|
(changes look good) |
This warning
> sharedsubtree_linux_test.go:329:74: comparing with != will fail on wrapped errors. Use errors.Is to check for a specific error (errorlint)
> if err := Mount(sourceDir, targetDir, "none", "bind,rw"); err != nil && errors.Unwrap(err) != unix.EINVAL {
> ^
is not making much sense, since the code is legit, but in general it's
better to use errors.Is, so let's switch to it.
Signed-off-by: Kir Kolyshkin <[email protected]>
Errors returned from x/sys/unix are bare, so it's OK to compare
directly.
Fixes warnings like this one:
> mount_unix.go:26:19: comparing with == will fail on wrapped errors. Use errors.Is to check for a specific error (errorlint)
> if err == nil || err == unix.EINVAL {
> ^
Signed-off-by: Kir Kolyshkin <[email protected]>
Signed-off-by: Kir Kolyshkin <[email protected]>
19c3240 to
d7d54c4
Compare
d7d54c4 to
fd2b311
Compare
|
This presumably fails on windows because of windows-style line endings, presumably brought in by git checkout. Looking. |
fd2b311 to
89da06c
Compare
Force UNIX-style line endings for go files. Signed-off-by: Kir Kolyshkin <[email protected]>
Release notes: https://github.com/golangci/golangci-lint/releases Signed-off-by: Kir Kolyshkin <[email protected]>
Signed-off-by: Kir Kolyshkin <[email protected]>
89da06c to
9a90d6d
Compare
Yes. Basically, git converts text files (including *.go) to use CRLF (aka Windows-style) line endings, and then gofumpt complains about bad formatting (in a not-so-clear way). Apparently, in Go every file is supposed to have LF (aka UNIX-style) line endings even on Windows (see e.g. golang/go#16355), this way the formatting is truly enforced. The way to do that wrt git is to have |
|
CRLF should be banned! 😂 |
(currently a draft pending #90 merge)Fixes: #91