48 Commits

Author SHA1 Message Date
Matthieu MOREL
34cfdfdbe5 chore: enable contextcheck, fatcontext and noctx linters
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2026-06-19 08:37:48 +00:00
George Jenkins
253da5106a Merge pull request #32171 from mmorel-35/empty-len
Fix empty and len testifylint violations across test files
2026-06-18 19:57:07 +12:00
Terry Howe
b3fbf8d0f7 Merge pull request #30808 from mmorel-35/errorlint
chore: enable errorlint
2026-06-12 20:03:14 -06:00
George Jenkins
81d6f04c82 Merge pull request #30867 from mmorel-35/gocritic
chore: fix deprecatedComment issues from gocritic
2026-06-13 11:34:16 +12:00
Terry Howe
59b57c5c31 Merge pull request #31885 from mmorel-35/whitespace
chore: fix whitespace linter
2026-05-30 05:19:51 -06:00
Matthieu MOREL
488c4a805d Fix empty and len testifylint violations across test files
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2026-05-29 08:02:24 +02:00
Evans Mungai
d374e823b2 Merge pull request #32086 from mmorel-35/error-is-as
testifylint: enable error-is-as and error-nil rules
2026-05-28 17:53:03 +01:00
Arnav Nagzirkar
e679ec9f04 ci: enable bidichk linter to prevent invisible Unicode characters
Adds the bidichk linter to .golangci.yml to detect dangerous invisible
Unicode characters (ZWSP, bidi controls) in source files during CI.

Fixes #32137

Signed-off-by: Arnav Nagzirkar <arnav.nagzirkar@mail.utoronto.ca>
2026-05-25 22:42:31 -07:00
Matthieu MOREL
f8ba28bb17 testifylint: enable error-is-as and error-nil rules
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2026-04-27 20:04:39 +02:00
George Jenkins
4bd9e90aa0 Merge pull request #30811 from mmorel-35/testifylint
chore: fix bool-compare issues from testifylint
2026-04-24 21:35:35 -07:00
George Jenkins
ce203dc568 Merge pull request #31938 from mmorel-35/perfsprint
chore: enable perfsprint linter
2026-03-23 09:57:14 -07:00
Matthieu MOREL
7edfff33eb chore: fix unnecessary-format issues from revive
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2026-03-23 07:07:27 +01:00
Matthieu MOREL
071558d69f chore: fix bool-compare issues from testifylint
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2026-03-14 09:40:34 +01:00
Matthieu MOREL
83a0138172 chore: fix deprecatedComment issues from gocritic
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2026-03-14 09:39:49 +01:00
Matthieu MOREL
af31a67924 chore: enable errorlint linter
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2026-03-14 09:06:55 +01:00
Matthieu MOREL
62494896e9 chore: enable perfsprint linter
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2026-03-14 08:50:41 +01:00
Matthieu MOREL
1e0f702f00 chore: fix whitespace linter
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2026-03-14 08:47:43 +01:00
Matthieu MOREL
e31a078e6e chore: enable modernize linter (#31860)
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2026-03-06 14:54:33 +00:00
Matthieu MOREL
5b6c6bbfc7 fix: enable nolinlint linter
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2026-02-25 07:50:29 +01:00
Brenden Ehlers
9a898af7f2 enable exhaustive linter
Signed-off-by: Brenden Ehlers <brenden@theehlers.org>
2025-12-22 07:40:40 -07:00
Brenden Ehlers
1c119bcaa6 fix: add default casess to switch statements
Signed-off-by: Brenden Ehlers <brenden@theehlers.org>
2025-12-21 09:13:24 -07:00
Mads Jensen
a18e59e465 Enable the sloglint linter
Signed-off-by: Mads Jensen <atombrella@users.noreply.github.com>
2025-12-09 08:24:36 +01:00
Matt Farina
0d359d44ea Restore lint rule for excluding meaningless name
This rule is needed for packages like 'util'. Changes to those
packages trigger this rule.

Signed-off-by: Matt Farina <matt.farina@suse.com>
2025-09-25 09:13:47 +02:00
Benoit Tigeot
34c2d5c1a9 Remove unused golangci-lint rules that produce warning
Avoid this noisy output when running local linting:

```sh
❯ golangci-lint run ./...
WARN [runner/exclusion_rules] Skipped 0 issues by rules: [Text: "var-naming: avoid meaningless package names", Linters: "revive"]
```

Signed-off-by: Benoit Tigeot <benoit.tigeot@lifen.fr>
2025-09-22 23:20:01 +02:00
Matt Farina
9dcc49cbd5 Move lint pkg to be part of each chart version
Linting is specific to the chart versions. A v2 and v3 chart will
lint differently.

To accomplish this, packages like engine need to be able to handle
different chart versions. This was accomplished by some changes:

1. The introduction of a Charter interface for charts
2. The ChartAccessor which is able to accept a chart and then
   provide access to its data via an interface. There is an
   interface, factory, and implementation for each version of
   chart.
3. Common packages were moved to a common and util packages.
   Due to some package loops, there are 2 packages which may
   get some consolidation in the future.

The new interfaces provide the foundation to move the actions
and cmd packages to be able to handle multiple apiVersions of
charts.

Signed-off-by: Matt Farina <matt.farina@suse.com>
2025-09-02 12:14:37 -04:00
Matthieu MOREL
56a2bb4188 chore: enable usetesting linter
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-05-30 08:12:11 +02:00
Robert Sirchia
1b21f04b3b Merge pull request #30865 from mmorel-35/github.com/evanphx/json-patch/v5
fix: update json-patch import path and add gomodguard settings
2025-05-22 10:34:35 -04:00
Matthieu MOREL
157f0ba10a chore: enable thelper
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-05-16 10:25:08 +02:00
Matthieu MOREL
706392fabb fix: update json-patch import path and add gomodguard settings
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-05-16 09:40:56 +02:00
Robert Sirchia
4d580c6b95 Merge pull request #30810 from mmorel-35/usestdlibvars
chore: enable usestdlibvars linter
2025-05-08 10:35:10 -04:00
Adharsh
7801588957 Fix bug in .golangci.yml configuration
The initial configuration was missing rules that caused the linter to skip
certain important checks. This update adds the missing rules to ensure the
code quality checks are correctly enforced across the repository.
Signed-off-by: Adharsh <adharshunni0007@gmail.com>
2025-05-04 01:53:01 +05:30
Matthieu MOREL
77a267dacf chore: enable usestdlibvars linter
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-04-27 22:44:46 +02:00
Matthieu MOREL
3270d35d3f refactor: reorganize .golangci.yml for better clarity and structure
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-04-24 07:15:21 +02:00
Justen Stall
700103d76a chore: add depguard rule for github.com/pkg/errors
Signed-off-by: Justen Stall <39888103+justenstall@users.noreply.github.com>
2025-04-22 13:34:33 -04:00
Matthieu MOREL
d3eeb2c942 chore: remove github.com/hashicorp/go-multierror dependency
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-04-21 19:27:15 +02:00
Benoit Tigeot
d878548168 Migrate golint to v2
```
WARN The configuration comments are not migrated.
WARN Details about the migration: https://golangci-lint.run/product/migration-guide/
WARN The configuration `run.timeout` is ignored. By default, in v2, the timeout is disabled.
```

I've backported comment and timeout

Signed-off-by: Benoit Tigeot <benoit.tigeot@lifen.fr>
2025-04-14 10:28:19 +02:00
Matt Farina
2236294119 Updating to helm.sh/helm/v4
Since Helm is going through breaking changes with Helm v4, the version path to
Helm needs to be updated.

Signed-off-by: Matt Farina <matt.farina@suse.com>
2024-12-26 16:33:51 -05:00
Matt Farina
66f84e510e Update golangci-lint version
Signed-off-by: Matt Farina <matt.farina@suse.com>
2024-12-19 13:54:44 -05:00
Matt Farina
5727f56a96 Update to Go 1.23
Multiple changes were made to pass linting. Some Go built-in names
are being used for variables (e.g., min). This happens in the Go
source itself including the Go standard library and is not always
a bad practice.

To handle allowing some built-in names to be used the linter config
is updated to allow (via opt-in) some names to pass. This allows us
to still check for re-use of Go built-in names and opt-in to any
new uses.

There were also several cases where a value was checked for nil
before checking its length when this is already handled by len()
or the types default value. These were cleaned up.

The license validation was updated because it was checking everything
in the .git directory including all remote content that was local.
The previous vendor directory was from a time prior to Go modules
when Helm handled dependencies differently. It was no longer needed.

Signed-off-by: Matt Farina <matt.farina@suse.com>
2024-12-19 10:27:38 -05:00
Fish-pro
c1108177a9 the linter varcheck and deadcode are deprecated (since v1.49.0)
Signed-off-by: Fish-pro <zechun.chen@daocloud.io>
2023-02-01 11:19:09 +08:00
yanggang
61374f6554 update .golangci for go1.18
Signed-off-by: yanggang <gang.yang@daocloud.io>
2022-10-31 23:58:25 +08:00
Martin Hickey
f0fd37d2c5 Replace golint with revive
golint which is used as one of the sublinters in golangci-lint is deprecated.
It is replaced with revive which is a drop-in replacement.

Signed-off-by: Martin Hickey <martin.hickey@ie.ibm.com>

Co-authored-by: Martin Mulholland <mmulholl@redhat.com>
2022-01-20 15:19:40 +00:00
Adam Reese
d1da9e757e fix(ci-lint): increase timeout for golangci-lint
Signed-off-by: Adam Reese <adam@reese.io>
2021-07-06 10:37:37 -07:00
Matt Butcher
16024dc19a fix: add new static linter and fix issues it found (#7655)
* fix: add new static linter and fix issues it found

Signed-off-by: Matt Butcher <matt.butcher@microsoft.com>

* fixed two additional linter errors.

Signed-off-by: Matt Butcher <matt.butcher@microsoft.com>
2020-03-03 17:28:57 -07:00
sayboras
693bce93a0 Used timeout instead of deadline
Signed-off-by: sayboras <sayboras@yahoo.com>
2019-11-09 20:00:45 +11:00
Matthew Fisher
b048f8914b fix(coverage): cd to root dir to avoid adding godir to go modules
Signed-off-by: Matthew Fisher <matt.fisher@microsoft.com>
2019-10-22 13:52:30 -07:00
Adam Reese
895e9192d4 feat(*): use vanity import helm.sh/helm
Signed-off-by: Adam Reese <adam@reese.io>
2019-03-13 13:43:47 -07:00
Adam Reese
21d3a40f3b feat(tests): replace gometalinter with golangci-lint
Signed-off-by: Adam Reese <adam@reese.io>
2019-03-08 11:45:42 -08:00