Commit Graph

25 Commits

Author SHA1 Message Date
Kir Kolyshkin e8dba98314 ci: add nolintlint, fix found issues
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2025-04-07 13:02:39 -07:00
Kir Kolyshkin 757175d2e6 .golangci.yml: add unused linter
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2025-04-07 13:01:56 -07:00
Kir Kolyshkin e8a5d77b09 ci: switch to golangci-lint v2
Also, add a way to update golangci-lint locally, if an old version is
installed.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2025-04-07 13:01:56 -07:00
Nalin Dahyabhai ca3b80eb0f CI: enable the whitespace linter
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2024-08-15 16:09:25 -04:00
Nalin Dahyabhai 8ae99121c1 CI: enable the gofumpt linter
Turn on the gofumpt linter.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2024-08-15 13:17:44 -04:00
Kir Kolyshkin fd3aba9917 *: use gofmt -s, add gofmt linter
1. Use gofmt to format the code:

	git ls-files \*.go | grep -Ev '/?vendor/' | xargs gofmt -w -s

2. Add gofmt to golangci-lint (it's not enabled by default).

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2024-08-09 17:05:58 -07:00
Kir Kolyshkin acbe301438 .golangci.yml: enable unparam linter
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2022-01-18 13:33:58 -08:00
Kir Kolyshkin 8c14d40c4b tests/tools: bump golangci-lint
... and its dependencies.

Also, modify .golangci.yml since new golangci-lint no longer have some
of the linters mentioned. Besides, it is unsafe to enable all linters,
because (1) not all linters are good/useful; (2) new golangci-lint
releases can bring more linters and thus more CI issues. Instead, use
the default set of linters, plus enable a few more:

 * revive (which replaces golint)
 * unconvert

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2022-01-18 13:33:47 -08:00
Nalin Dahyabhai 09b787a0a3 CI: re-enable several linters
When we carried over the linting configuration from podman, we carried
over the list of checkers that were disabled for podman's sake, even
ones that don't complain about the code in this repository.

Make trivial changes to make gosimple happy.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2020-09-30 13:00:17 -04:00
Valentin Rothberg 4853644e3c tools: update golangci-lint to v1.18.0
Update golangci-lint to v1.18.0.  Purely out of neccessity to get the
tests/tools/go.mod into a working state.  The previous version had a
non-existent dependency which broke all attempts to do anything.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-09-17 15:12:30 +02:00
Chris Evich a13b1de79f
Lint: Use same linters as podman
Signed-off-by: Chris Evich <cevich@redhat.com>
2020-09-16 07:14:00 -04:00
Chris Evich df51162765
Cirrus: Fixes from review feedback
Signed-off-by: Chris Evich <cevich@redhat.com>
2020-05-04 11:45:14 -04:00
Chris Evich 28aa5ee861
golangci-lint: Disable gosimple
For some reason, this particular check causes the process to be killed
after some amount of time.  No error message is displayed, with or
without `--verbose`.  Disable the check with an explanatory comment.

Signed-off-by: Chris Evich <cevich@redhat.com>
2020-04-30 10:09:50 -04:00
Chris Evich 1e8c932143
Lower number of golangci-lint threads
Also add in-line comment explaining why.

Signed-off-by: Chris Evich <cevich@redhat.com>
2020-04-30 10:09:50 -04:00
Giuseppe Scrivano 8a23247ce9
build: drop support for ostree
it is going to be removed from containers/image as well, so no longer
depend on it.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-10-30 10:49:58 +01:00
Sascha Grunert ddbd1e2cdb
Enable interfacer linter and fix lints
This fixes a single issue where the interface could be an `io.Reader`
instead of an `io.ReadCloser`.

Signed-off-by: Sascha Grunert <sgrunert@suse.com>
2019-09-03 17:40:45 +02:00
Sascha Grunert 6b214d2921 Add golint linter and apply fixes
This commit enabled to golint linter in golangci-lint and applies all
necessary fixes.

Signed-off-by: Sascha Grunert <sgrunert@suse.com>

Closes: #1740
Approved by: rhatdan
2019-07-27 09:45:49 +00:00
Sascha Grunert 1d35489ca0
Add misspell linter and apply fixes
Signed-off-by: Sascha Grunert <sgrunert@suse.com>
2019-07-18 10:45:52 +02:00
Sascha Grunert 7eb4e5972d
Add goimports linter and apply fixes
Signed-off-by: Sascha Grunert <sgrunert@suse.com>
2019-07-18 10:42:46 +02:00
Sascha Grunert 3af9f97ce8
Add stylecheck linter and apply fixes
Signed-off-by: Sascha Grunert <sgrunert@suse.com>
2019-07-18 10:38:27 +02:00
Sascha Grunert 8e58ba3cdb
Add unconvert linter and apply fixes
Signed-off-by: Sascha Grunert <sgrunert@suse.com>
2019-07-18 10:37:38 +02:00
Sascha Grunert 16e301031e Add unparam linter and apply fixes
This commit enabled the `unparam` linter and applies all reported issues.

Signed-off-by: Sascha Grunert <sgrunert@suse.com>

Closes: #1719
Approved by: rhatdan
2019-07-16 21:21:32 +00:00
Sascha Grunert 5d723ff5ab Add errcheck linter and fix missing error check
This commit enabled the errcheck linter and fixes an uncovered stat to
`os.DevNull`. Beside this, we disable go modules within the
`tests/tools/Makefile` to allow independent offline builds.

Signed-off-by: Sascha Grunert <sgrunert@suse.com>

Closes: #1713
Approved by: vrothberg
2019-07-10 13:03:22 +00:00
Sascha Grunert d94f238368 Fix response body not closed resource leak
This enabled the `bodyclose` linter and fixes the reported response body
resource leak.

Signed-off-by: Sascha Grunert <sgrunert@suse.com>

Closes: #1711
Approved by: nalind
2019-07-08 14:48:32 +00:00
Sascha Grunert e160a632b7 Switch to golangci-lint
This commit vendors golangci-lint and enables all linters which do not
complain right now. CI and scripting has been adapted as well.

Signed-off-by: Sascha Grunert <sgrunert@suse.com>

Closes: #1706
Approved by: rhatdan
2019-07-07 10:34:01 +00:00