Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-enable goconst linter for test files #9623

Closed
adityabhatia opened this issue Oct 26, 2023 · 7 comments
Closed

Re-enable goconst linter for test files #9623

adityabhatia opened this issue Oct 26, 2023 · 7 comments
Labels
area/testing Issues or PRs related to testing help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. triage/accepted Indicates an issue or PR is ready to be actively worked on.

Comments

@adityabhatia
Copy link
Contributor

In this PR goconst linter was disabled for test files - to exclude test files from creating lint issues, for a string value with > 3 occurrences.

However most of these string values in test files enhance the readability if the respective test cases. E.g. https://github.com/kubernetes-sigs/cluster-api/blob/main/bootstrap/kubeadm/types/utils_test.go#L260

The linter should not be completely excluded for tests in the long term.
A solution to either fix all lint issues or increase the occurrence default value should be implemented.

@k8s-ci-robot k8s-ci-robot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Oct 26, 2023
@adityabhatia adityabhatia changed the title Re-enable goconst linter for tests Re-enable goconst linter for test files Oct 26, 2023
@killianmuldoon
Copy link
Contributor

/triage accepted

Thanks!

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Oct 26, 2023
@killianmuldoon
Copy link
Contributor

/help

First steps to figure this out are to try some of the other configuration options for goconst and see what the tradeoffs are.

@k8s-ci-robot
Copy link
Contributor

@killianmuldoon:
This request has been marked as needing help from a contributor.

Guidelines

Please ensure that the issue body includes answers to the following questions:

  • Why are we solving this issue?
  • To address this issue, are there any code changes? If there are code changes, what needs to be done in the code and what places can the assignee treat as reference points?
  • Does this issue have zero to low barrier of entry?
  • How can the assignee reach out to you for help?

For more details on the requirements of such an issue, please see here and ensure that they are met.

If this request no longer meets these requirements, the label can be removed
by commenting with the /remove-help command.

In response to this:

/help

First steps to figure this out are to try some of the other configuration options for goconst and see what the tradeoffs are.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added the help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. label Oct 26, 2023
@sbueringer
Copy link
Member

Increase the occurrence default value should be implemented.

Sounds reasonable

@sbueringer sbueringer added the area/testing Issues or PRs related to testing label Oct 31, 2023
@vincepri
Copy link
Member

vincepri commented Nov 1, 2023

fwiw, I'm fine, for tests, to have this disabled

@vincepri
Copy link
Member

vincepri commented Nov 8, 2023

Closing this, no need to have constants in tests unless absolutely necessary.

/close

@k8s-ci-robot
Copy link
Contributor

@vincepri: Closing this issue.

In response to this:

Closing this, no need to have constants in tests unless absolutely necessary.

/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/testing Issues or PRs related to testing help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

No branches or pull requests

5 participants