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

tests/provider: Fix and enable wastedassign linter #18596

Closed
bflad opened this issue Apr 6, 2021 · 5 comments · Fixed by #40810
Closed

tests/provider: Fix and enable wastedassign linter #18596

bflad opened this issue Apr 6, 2021 · 5 comments · Fixed by #40810
Labels
linter Pertains to changes to or issues with the various linters. provider Pertains to the provider itself, rather than any interaction with AWS. stale Old or inactive issues managed by automation, if no further action taken these will get closed. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Milestone

Comments

@bflad
Copy link
Contributor

bflad commented Apr 6, 2021

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Description

The wastedassign linter finds wasted assignment statements. This typically represents a stylistic coding issue and fixing reports will increase code readability. This linter is similar to ifeffassign, but catches different reports. It is supported in golangci-lint.

Affected Resource(s)

aws/data_source_aws_s3_bucket_object.go:220:3: reassigned, but reassigned without using the value (wastedassign)
                contentType := ""
                ^
aws/data_source_aws_sagemaker_prebuilt_ecr_image.go:343:2: reassigned, but reassigned without using the value (wastedassign)
        id := ""
        ^
aws/resource_aws_autoscaling_group_waiting.go:79:2: reassigned, but reassigned without using the value (wastedassign)
        recentStatus := ""
        ^
aws/resource_aws_dx_gateway_association.go:124:2: reassigned, but reassigned without using the value (wastedassign)
        associationId := ""
        ^
aws/resource_aws_ebs_volume.go:235:5: reassigned, but never used afterwards (wastedassign)
                                resp = nil
                                ^
aws/resource_aws_efs_file_system.go:145:2: reassigned, but reassigned without using the value (wastedassign)
        creationToken := ""
        ^
aws/resource_aws_opsworks_permission.go:85:2: reassigned, but reassigned without using the value (wastedassign)
        id := ""
        ^
aws/resource_aws_opsworks_rds_db_instance.go:109:2: reassigned, but reassigned without using the value (wastedassign)
        id := ""
        ^

Definition of Done

  • Existing reports fixed and verified via golangci-lint --max-issues-per-linter 0 --enable wastedassign run ./aws
  • wastedassign added to .golangci.yml and CI passes
@bflad bflad added tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. provider Pertains to the provider itself, rather than any interaction with AWS. linter Pertains to changes to or issues with the various linters. labels Apr 6, 2021
@ewbankkit
Copy link
Contributor

Copy link

github-actions bot commented Jan 6, 2025

Marking this issue as stale due to inactivity. This helps our maintainers find and focus on the active issues. If this issue receives no comments in the next 30 days it will automatically be closed. Maintainers can also remove the stale label.

If this issue was automatically closed and you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thank you!

@github-actions github-actions bot added the stale Old or inactive issues managed by automation, if no further action taken these will get closed. label Jan 6, 2025
Copy link

github-actions bot commented Jan 7, 2025

Warning

This issue has been closed, meaning that any additional comments are hard for our team to see. Please assume that the maintainers will not see them.

Ongoing conversations amongst community members are welcome, however, the issue will be locked after 30 days. Moving conversations to another venue, such as the AWS Provider forum, is recommended. If you have additional concerns, please open a new issue, referencing this one where needed.

@github-actions github-actions bot added this to the v5.83.0 milestone Jan 7, 2025
Copy link

github-actions bot commented Jan 9, 2025

This functionality has been released in v5.83.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

Copy link

github-actions bot commented Feb 9, 2025

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 9, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
linter Pertains to changes to or issues with the various linters. provider Pertains to the provider itself, rather than any interaction with AWS. stale Old or inactive issues managed by automation, if no further action taken these will get closed. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants