fix(visitor): detect repeated literals inside composite literal elements by TobyTheHutt · Pull Request #46 · jgautheron/goconst (original) (raw)
Signed-off-by: Tobias Harnickell tobias@harnickell.ch
Signed-off-by: Tobias Harnickell tobias@harnickell.ch
TobyTheHutt deleted the feat/44-detect-string-literals-inside-composite-literals branch
armru pushed a commit to leonardoce/cloudnative-pg that referenced this pull request
Bump golangci-lint to v2.12.2 in CI. The new version bundles an updated goconst that also scans composite literals (jgautheron/goconst#46), surfacing repeated strings that were previously invisible to the linter.
Address the new warnings by:
- replacing "postgresql.cnpg.io" literals with apiv1.SchemeGroupVersion.Group across webhooks, specs, and RBAC helpers; this also fixes a latent bug in scheduledbackup_webhook.go where the group was incorrectly "scheduledBackup.cnpg.io"
- introducing pgdataVolumeName and walLevelMinimal constants for strings repeated across volume and WAL-level validation logic
- replacing reflect.Ptr with reflect.Pointer in configparser (govet inline)
- renaming gomodguard to gomodguard_v2 per the new linter registry name
Configure goconst with min-occurrences=10 and ignore RBAC verb strings ("get", "list", "watch", etc.) which are stable Kubernetes API values not defined as constants in k8s.io/api/rbac/v1 — extracting them would add noise without reducing risk. Extend the goconst exclusion to cover tests/ in addition to *_test.go files.
Signed-off-by: Leonardo Cecchi leonardo.cecchi@enterprisedb.com
armru pushed a commit to cloudnative-pg/cloudnative-pg that referenced this pull request
Bump golangci-lint to v2.12.2 in CI. The new version bundles an updated goconst that also scans composite literals (jgautheron/goconst#46), surfacing repeated strings that were previously invisible to the linter.
Address the new warnings by:
- replacing "postgresql.cnpg.io" literals with apiv1.SchemeGroupVersion.Group across webhooks, specs, and RBAC helpers; this also fixes a latent bug in scheduledbackup_webhook.go where the group was incorrectly "scheduledBackup.cnpg.io"
- introducing pgdataVolumeName and walLevelMinimal constants for strings repeated across volume and WAL-level validation logic
- replacing reflect.Ptr with reflect.Pointer in configparser (govet inline)
- renaming gomodguard to gomodguard_v2 per the new linter registry name
Configure goconst with min-occurrences=10 and ignore RBAC verb strings ("get", "list", "watch", etc.) which are stable Kubernetes API values not defined as constants in k8s.io/api/rbac/v1 — extracting them would add noise without reducing risk. Extend the goconst exclusion to cover tests/ in addition to *_test.go files.
Signed-off-by: Leonardo Cecchi leonardo.cecchi@enterprisedb.com
cnpg-bot pushed a commit to cloudnative-pg/cloudnative-pg that referenced this pull request
Bump golangci-lint to v2.12.2 in CI. The new version bundles an updated goconst that also scans composite literals (jgautheron/goconst#46), surfacing repeated strings that were previously invisible to the linter.
Address the new warnings by:
- replacing "postgresql.cnpg.io" literals with apiv1.SchemeGroupVersion.Group across webhooks, specs, and RBAC helpers; this also fixes a latent bug in scheduledbackup_webhook.go where the group was incorrectly "scheduledBackup.cnpg.io"
- introducing pgdataVolumeName and walLevelMinimal constants for strings repeated across volume and WAL-level validation logic
- replacing reflect.Ptr with reflect.Pointer in configparser (govet inline)
- renaming gomodguard to gomodguard_v2 per the new linter registry name
Configure goconst with min-occurrences=10 and ignore RBAC verb strings ("get", "list", "watch", etc.) which are stable Kubernetes API values not defined as constants in k8s.io/api/rbac/v1 — extracting them would add noise without reducing risk. Extend the goconst exclusion to cover tests/ in addition to *_test.go files.
Signed-off-by: Leonardo Cecchi leonardo.cecchi@enterprisedb.com (cherry picked from commit c9ea3aa)
cnpg-bot pushed a commit to cloudnative-pg/cloudnative-pg that referenced this pull request
Bump golangci-lint to v2.12.2 in CI. The new version bundles an updated goconst that also scans composite literals (jgautheron/goconst#46), surfacing repeated strings that were previously invisible to the linter.
Address the new warnings by:
- replacing "postgresql.cnpg.io" literals with apiv1.SchemeGroupVersion.Group across webhooks, specs, and RBAC helpers; this also fixes a latent bug in scheduledbackup_webhook.go where the group was incorrectly "scheduledBackup.cnpg.io"
- introducing pgdataVolumeName and walLevelMinimal constants for strings repeated across volume and WAL-level validation logic
- replacing reflect.Ptr with reflect.Pointer in configparser (govet inline)
- renaming gomodguard to gomodguard_v2 per the new linter registry name
Configure goconst with min-occurrences=10 and ignore RBAC verb strings ("get", "list", "watch", etc.) which are stable Kubernetes API values not defined as constants in k8s.io/api/rbac/v1 — extracting them would add noise without reducing risk. Extend the goconst exclusion to cover tests/ in addition to *_test.go files.
Signed-off-by: Leonardo Cecchi leonardo.cecchi@enterprisedb.com (cherry picked from commit c9ea3aa)
armru pushed a commit to cloudnative-pg/cloudnative-pg that referenced this pull request
Bump golangci-lint to v2.12.2 in CI. The new version bundles an updated goconst that also scans composite literals (jgautheron/goconst#46), surfacing repeated strings that were previously invisible to the linter.
Address the new warnings by:
- replacing "postgresql.cnpg.io" literals with apiv1.SchemeGroupVersion.Group across webhooks, specs, and RBAC helpers; this also fixes a latent bug in scheduledbackup_webhook.go where the group was incorrectly "scheduledBackup.cnpg.io"
- introducing pgdataVolumeName and walLevelMinimal constants for strings repeated across volume and WAL-level validation logic
- replacing reflect.Ptr with reflect.Pointer in configparser (govet inline)
- renaming gomodguard to gomodguard_v2 per the new linter registry name
Configure goconst with min-occurrences=10 and ignore RBAC verb strings ("get", "list", "watch", etc.) which are stable Kubernetes API values not defined as constants in k8s.io/api/rbac/v1 — extracting them would add noise without reducing risk. Extend the goconst exclusion to cover tests/ in addition to *_test.go files.
Signed-off-by: Leonardo Cecchi leonardo.cecchi@enterprisedb.com (cherry picked from commit c9ea3aa)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
[ Show hidden characters]({{ revealButtonHref }})