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

Fix and enable tfproviderlint R010 check: Prefer d.Get() over d.GetChange() when only using second return value #12085

Closed
1 task
bflad opened this issue Feb 19, 2020 · 3 comments
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. technical-debt Addresses areas of the codebase that need refactoring or redesign. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.

Comments

@bflad
Copy link
Contributor

bflad commented Feb 19, 2020

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

Simplifies code and less computational.

tfproviderlint check references:

Fixes required:

aws/resource_aws_appmesh_mesh.go:152:3: R010: prefer d.Get() over d.GetChange() when only using second return value
aws/resource_aws_appmesh_route.go:258:3: R010: prefer d.Get() over d.GetChange() when only using second return value
aws/resource_aws_appmesh_virtual_node.go:371:3: R010: prefer d.Get() over d.GetChange() when only using second return value
aws/resource_aws_appmesh_virtual_router.go:190:3: R010: prefer d.Get() over d.GetChange() when only using second return value
aws/resource_aws_appmesh_virtual_service.go:185:3: R010: prefer d.Get() over d.GetChange() when only using second return value
aws/resource_aws_cloudwatch_log_group.go:210:3: R010: prefer d.Get() over d.GetChange() when only using second return value
aws/resource_aws_codedeploy_deployment_group.go:662:3: R010: prefer d.Get() over d.GetChange() when only using second return value
aws/resource_aws_codedeploy_deployment_group.go:667:3: R010: prefer d.Get() over d.GetChange() when only using second return value
aws/resource_aws_codedeploy_deployment_group.go:672:3: R010: prefer d.Get() over d.GetChange() when only using second return value
aws/resource_aws_codedeploy_deployment_group.go:678:3: R010: prefer d.Get() over d.GetChange() when only using second return value
aws/resource_aws_codedeploy_deployment_group.go:684:3: R010: prefer d.Get() over d.GetChange() when only using second return value
aws/resource_aws_codedeploy_deployment_group.go:690:3: R010: prefer d.Get() over d.GetChange() when only using second return value
aws/resource_aws_codedeploy_deployment_group.go:696:3: R010: prefer d.Get() over d.GetChange() when only using second return value
aws/resource_aws_codedeploy_deployment_group.go:706:3: R010: prefer d.Get() over d.GetChange() when only using second return value
aws/resource_aws_codedeploy_deployment_group.go:712:3: R010: prefer d.Get() over d.GetChange() when only using second return value
aws/resource_aws_codedeploy_deployment_group.go:717:3: R010: prefer d.Get() over d.GetChange() when only using second return value
aws/resource_aws_codedeploy_deployment_group.go:722:3: R010: prefer d.Get() over d.GetChange() when only using second return value
aws/resource_aws_codedeploy_deployment_group.go:727:3: R010: prefer d.Get() over d.GetChange() when only using second return value
aws/resource_aws_db_subnet_group.go:170:3: R010: prefer d.Get() over d.GetChange() when only using second return value
aws/resource_aws_docdb_subnet_group.go:155:3: R010: prefer d.Get() over d.GetChange() when only using second return value
aws/resource_aws_eks_cluster.go:341:3: R010: prefer d.Get() over d.GetChange() when only using second return value
aws/resource_aws_elb.go:446:3: R010: prefer d.Get() over d.GetChange() when only using second return value
aws/resource_aws_iam_group.go:104:3: R010: prefer d.Get() over d.GetChange() when only using second return value
aws/resource_aws_iam_user.go:143:3: R010: prefer d.Get() over d.GetChange() when only using second return value
aws/resource_aws_kinesis_firehose_delivery_stream.go:2328:3: R010: prefer d.Get() over d.GetChange() when only using second return value
aws/resource_aws_neptune_subnet_group.go:166:3: R010: prefer d.Get() over d.GetChange() when only using second return value
aws/resource_aws_redshift_subnet_group.go:140:3: R010: prefer d.Get() over d.GetChange() when only using second return value
aws/resource_aws_sns_platform_application.go:145:5: R010: prefer d.Get() over d.GetChange() when only using second return value
aws/resource_aws_sns_topic.go:181:4: R010: prefer d.Get() over d.GetChange() when only using second return value
aws/resource_aws_sns_topic.go:197:4: R010: prefer d.Get() over d.GetChange() when only using second return value
aws/resource_aws_sqs_queue.go:252:5: R010: prefer d.Get() over d.GetChange() when only using second return value
aws/resource_aws_ssm_parameter.go:213:3: R010: prefer d.Get() over d.GetChange() when only using second return value
aws/resource_aws_subnet.go:301:3: R010: prefer d.Get() over d.GetChange() when only using second return value

Definition of Done

  • The -R010 flag is added to the tfproviderlint/awsproviderlint command in GNUmakefile and CI passes
@bflad bflad added tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. technical-debt Addresses areas of the codebase that need refactoring or redesign. provider Pertains to the provider itself, rather than any interaction with AWS. labels Feb 19, 2020
@github-actions github-actions bot added the needs-triage Waiting for first response or review from a maintainer. label Feb 19, 2020
@bflad bflad removed the needs-triage Waiting for first response or review from a maintainer. label Feb 19, 2020
bflad added a commit that referenced this issue Jul 14, 2020
…nd platform_princial hash removal

Reference: #3894
Reference: #9951
Reference: #12085
Reference: #13406

This also attempts to prevent the SetPlatformApplicationAttributes API call if no API updates need to occur. While we are in the midst of breaking changes and since this resource cannot be acceptance tested by the HashiCorp maintainers, this also fixes some other technical debt issues.
@bflad
Copy link
Contributor Author

bflad commented Aug 24, 2020

Snapshot of current reports:

aws/resource_aws_appmesh_mesh.go:153:3: R010: prefer d.Get() over d.GetChange() when only using second return value
aws/resource_aws_appmesh_route.go:367:3: R010: prefer d.Get() over d.GetChange() when only using second return value
aws/resource_aws_appmesh_virtual_node.go:356:3: R010: prefer d.Get() over d.GetChange() when only using second return value
aws/resource_aws_appmesh_virtual_router.go:181:3: R010: prefer d.Get() over d.GetChange() when only using second return value
aws/resource_aws_appmesh_virtual_service.go:186:3: R010: prefer d.Get() over d.GetChange() when only using second return value
aws/resource_aws_cloudwatch_log_group.go:211:3: R010: prefer d.Get() over d.GetChange() when only using second return value
aws/resource_aws_codedeploy_deployment_group.go:673:3: R010: prefer d.Get() over d.GetChange() when only using second return value
aws/resource_aws_codedeploy_deployment_group.go:678:3: R010: prefer d.Get() over d.GetChange() when only using second return value
aws/resource_aws_codedeploy_deployment_group.go:683:3: R010: prefer d.Get() over d.GetChange() when only using second return value
aws/resource_aws_codedeploy_deployment_group.go:689:3: R010: prefer d.Get() over d.GetChange() when only using second return value
aws/resource_aws_codedeploy_deployment_group.go:695:3: R010: prefer d.Get() over d.GetChange() when only using second return value
aws/resource_aws_codedeploy_deployment_group.go:701:3: R010: prefer d.Get() over d.GetChange() when only using second return value
aws/resource_aws_codedeploy_deployment_group.go:707:3: R010: prefer d.Get() over d.GetChange() when only using second return value
aws/resource_aws_codedeploy_deployment_group.go:717:3: R010: prefer d.Get() over d.GetChange() when only using second return value
aws/resource_aws_codedeploy_deployment_group.go:723:3: R010: prefer d.Get() over d.GetChange() when only using second return value
aws/resource_aws_codedeploy_deployment_group.go:728:3: R010: prefer d.Get() over d.GetChange() when only using second return value
aws/resource_aws_codedeploy_deployment_group.go:733:3: R010: prefer d.Get() over d.GetChange() when only using second return value
aws/resource_aws_codedeploy_deployment_group.go:738:3: R010: prefer d.Get() over d.GetChange() when only using second return value
aws/resource_aws_db_subnet_group.go:171:3: R010: prefer d.Get() over d.GetChange() when only using second return value
aws/resource_aws_docdb_subnet_group.go:156:3: R010: prefer d.Get() over d.GetChange() when only using second return value
aws/resource_aws_eks_cluster.go:376:3: R010: prefer d.Get() over d.GetChange() when only using second return value
aws/resource_aws_elb.go:440:3: R010: prefer d.Get() over d.GetChange() when only using second return value
aws/resource_aws_iam_group.go:108:3: R010: prefer d.Get() over d.GetChange() when only using second return value
aws/resource_aws_iam_user.go:147:3: R010: prefer d.Get() over d.GetChange() when only using second return value
aws/resource_aws_kinesis_firehose_delivery_stream.go:2294:3: R010: prefer d.Get() over d.GetChange() when only using second return value
aws/resource_aws_neptune_subnet_group.go:167:3: R010: prefer d.Get() over d.GetChange() when only using second return value
aws/resource_aws_redshift_subnet_group.go:143:3: R010: prefer d.Get() over d.GetChange() when only using second return value
aws/resource_aws_sns_topic.go:161:3: R010: prefer d.Get() over d.GetChange() when only using second return value
aws/resource_aws_sns_topic.go:167:3: R010: prefer d.Get() over d.GetChange() when only using second return value
aws/resource_aws_sns_topic.go:173:3: R010: prefer d.Get() over d.GetChange() when only using second return value
aws/resource_aws_sns_topic.go:179:3: R010: prefer d.Get() over d.GetChange() when only using second return value
aws/resource_aws_sns_topic.go:185:3: R010: prefer d.Get() over d.GetChange() when only using second return value
aws/resource_aws_sns_topic.go:191:3: R010: prefer d.Get() over d.GetChange() when only using second return value
aws/resource_aws_sns_topic.go:197:3: R010: prefer d.Get() over d.GetChange() when only using second return value
aws/resource_aws_sns_topic.go:203:3: R010: prefer d.Get() over d.GetChange() when only using second return value
aws/resource_aws_sns_topic.go:209:3: R010: prefer d.Get() over d.GetChange() when only using second return value
aws/resource_aws_sns_topic.go:215:3: R010: prefer d.Get() over d.GetChange() when only using second return value
aws/resource_aws_sns_topic.go:221:3: R010: prefer d.Get() over d.GetChange() when only using second return value
aws/resource_aws_sns_topic.go:227:3: R010: prefer d.Get() over d.GetChange() when only using second return value
aws/resource_aws_sns_topic.go:233:3: R010: prefer d.Get() over d.GetChange() when only using second return value
aws/resource_aws_sns_topic.go:239:3: R010: prefer d.Get() over d.GetChange() when only using second return value
aws/resource_aws_sns_topic.go:245:3: R010: prefer d.Get() over d.GetChange() when only using second return value
aws/resource_aws_sns_topic.go:251:3: R010: prefer d.Get() over d.GetChange() when only using second return value
aws/resource_aws_sns_topic.go:257:3: R010: prefer d.Get() over d.GetChange() when only using second return value
aws/resource_aws_sns_topic.go:271:3: R010: prefer d.Get() over d.GetChange() when only using second return value
aws/resource_aws_sns_topic.go:277:3: R010: prefer d.Get() over d.GetChange() when only using second return value
aws/resource_aws_sns_topic.go:283:3: R010: prefer d.Get() over d.GetChange() when only using second return value
aws/resource_aws_sns_topic.go:289:3: R010: prefer d.Get() over d.GetChange() when only using second return value
aws/resource_aws_sns_topic.go:295:3: R010: prefer d.Get() over d.GetChange() when only using second return value
aws/resource_aws_sns_topic.go:301:3: R010: prefer d.Get() over d.GetChange() when only using second return value
aws/resource_aws_sns_topic.go:307:3: R010: prefer d.Get() over d.GetChange() when only using second return value
aws/resource_aws_sns_topic.go:313:3: R010: prefer d.Get() over d.GetChange() when only using second return value
aws/resource_aws_sns_topic.go:319:3: R010: prefer d.Get() over d.GetChange() when only using second return value
aws/resource_aws_sns_topic.go:325:3: R010: prefer d.Get() over d.GetChange() when only using second return value
aws/resource_aws_sns_topic.go:331:3: R010: prefer d.Get() over d.GetChange() when only using second return value
aws/resource_aws_sns_topic.go:337:3: R010: prefer d.Get() over d.GetChange() when only using second return value
aws/resource_aws_sns_topic.go:343:3: R010: prefer d.Get() over d.GetChange() when only using second return value
aws/resource_aws_sns_topic.go:349:3: R010: prefer d.Get() over d.GetChange() when only using second return value
aws/resource_aws_sns_topic.go:355:3: R010: prefer d.Get() over d.GetChange() when only using second return value
aws/resource_aws_sns_topic.go:361:3: R010: prefer d.Get() over d.GetChange() when only using second return value
aws/resource_aws_sns_topic.go:367:3: R010: prefer d.Get() over d.GetChange() when only using second return value
aws/resource_aws_sqs_queue.go:252:5: R010: prefer d.Get() over d.GetChange() when only using second return value
aws/resource_aws_ssm_parameter.go:246:3: R010: prefer d.Get() over d.GetChange() when only using second return value

@bflad bflad added the linter Pertains to changes to or issues with the various linters. label Oct 28, 2020
@github-actions
Copy link

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 Oct 18, 2022
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Nov 18, 2022
@github-actions
Copy link

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 Dec 19, 2022
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. technical-debt Addresses areas of the codebase that need refactoring or redesign. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

No branches or pull requests

1 participant