bold-commerce / go-shopify

Go client for the Shopify API
MIT License
330 stars 256 forks source link

Fix some linting warnings (plus future use of staticcheck?) #226

Closed c9845 closed 1 year ago

c9845 commented 1 year ago

There are a lot of other warnings shown by staticcheck that were not fixed (staticcheck isn't in use for this repo). Most of these warnings are for the checks listed below. Fixing these is a rather big change, just due to volume of lines changed. Whether or not we want to implement staticcheck is the question.

Changing field names per warning ST1003 is a breaking change, so is probably best to be avoided (staticcheck.conf would be set to checks="all", "-ST1003"]). Fixes for the other warnings are no issue since these are just a documentation change.

Examples to be fixed...

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (d54f22b) 100.00% compared to head (7868d1a) 100.00%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #226 +/- ## ========================================= Coverage 100.00% 100.00% ========================================= Files 46 46 Lines 2088 2088 ========================================= Hits 2088 2088 ``` | [Files Changed](https://app.codecov.io/gh/bold-commerce/go-shopify/pull/226?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Bold+Commerce) | Coverage Δ | | |---|---|---| | [customer\_address.go](https://app.codecov.io/gh/bold-commerce/go-shopify/pull/226?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Bold+Commerce#diff-Y3VzdG9tZXJfYWRkcmVzcy5nbw==) | `100.00% <ø> (ø)` | | | [product\_listing.go](https://app.codecov.io/gh/bold-commerce/go-shopify/pull/226?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Bold+Commerce#diff-cHJvZHVjdF9saXN0aW5nLmdv) | `100.00% <ø> (ø)` | | | [goshopify.go](https://app.codecov.io/gh/bold-commerce/go-shopify/pull/226?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Bold+Commerce#diff-Z29zaG9waWZ5Lmdv) | `100.00% <100.00%> (ø)` | |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

oliver006 commented 1 year ago

Thanks for opening this PR - it still seems to be WIP - ping me when you're ready for review or feedback.

c9845 commented 1 year ago

@oliver006 I am done with this for now.

The questions becomes, do we want to implement staticcheck for the repo. If yes, then this becomes a much larger change.

oliver006 commented 1 year ago

Thanks for clarifying. Leaving commented out code in the repo is not a good practice, dead code should just be removed unless there's a very good reason. The rest of the changes look alright. If you could clean up the commented-out code stuff then I think we should e good to go.

c9845 commented 1 year ago

@oliver006 Commented out code has been removed.

What are your thoughts on utilizing staticcheck?

oliver006 commented 1 year ago

Thanks @c9845 - this should be good to go. I don't think there's an urgent need for adding staticcheck to the CI right now. If you submit a PR then I'll review it but I don't have the time right now to add it myself.