smutel / terraform-provider-netbox

Terraform provider for Netbox
ISC License
58 stars 19 forks source link

fix: Fix linter deprecation warnings #164

Closed amhn closed 1 year ago

amhn commented 1 year ago

Fixes #163

This PR fixes the deprecation warnings from golangci-lint by replacing the linters.

Missing check for d.Set is no longer excluded in the linter config and fixed in all files.

JSON data sources now have a DO NOT EDIT note in the source. With this note some editors e.g. VS Code warn when editing the file.

smutel commented 1 year ago

We have still some linter issues:

netbox/resource_netbox_virtualization_vm.go:283:10: Error return value of `d.Set` is not checked (errcheck)

=> Fix missing

netbox/resource_netbox_virtualization_vm.go:227:1: cyclomatic complexity 37 of func `resourceNetboxVirtualizationVMRead` is high (> 30) (gocyclo)

=> Not sure it's a good idea to resolve this right now in this PR

netbox/util.go:86:6: func `purgeNestedTagsToNestedTags` is unused (unused)

=> Unused function

Also do you why the CI is not crashing with these issues left ?

amhn commented 1 year ago

For the first 2 I have prepared a commit. Unfortunately this commit is based on #161. I will create an issue after that one is merged.

The third is addressed in #161

reviewdog: No results found for "golangci". 3 results found outside diff.

This is the reason these are not errors. The second one should have been an error in #158. Not sure why this was not caught there.

smutel commented 1 year ago

So can we merge https://github.com/smutel/terraform-provider-netbox/pull/161 first ?

amhn commented 1 year ago

Yes. Then I can push the other commit into this branch.

amhn commented 1 year ago
  reviewdog: No results found for "golangci". 0 results found outside diff.

:smile:

smutel commented 1 year ago

Wonderful :+1: