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 Golangci Lint Integration #453

Merged
merged 5 commits into from
May 13, 2022
Merged

Fix Golangci Lint Integration #453

merged 5 commits into from
May 13, 2022

Conversation

peterstace
Copy link
Owner

Description

Golangci-lint was reporting some false positives, e.g. https://github.com/peterstace/simplefeatures/actions/runs/2316868808

I'm not really sure why that started happening all of a sudden (if anyone has any theories, I'd love to know).

This PR upgrades to the latest golangci-lint version, and fixes some new lint problems identified. That seems to get the build green again.

Check List

Have you:

  • Added unit tests? N/A

  • Add cmprefimpl tests? (if appropriate?) N/A

  • Updated release notes? (if appropriate?) N/A

Related Issue

N/A

Benchmark Results

N/A

@peterstace peterstace self-assigned this May 13, 2022
@@ -10,9 +10,9 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: sudo apt update && sudo sudo apt install libgdal-dev libgeos-dev libproj-dev
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gdal and proj were unneeded.

if b.IsEmpty() {
b, a = a, b
nonEmpty = a
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was to fix a lint error that complained that a was never used after this assignment. The lint error was accurate, and I think using a new nonEmpty variable better expresses what's going on here anyway.

@@ -380,7 +380,7 @@ func TestEnvelopeInvalidXYInteractions(t *testing.T) {
t.Run(fmt.Sprintf("extend_to_include_invalid_xy_%d", i), func(t *testing.T) {
env, err := NewEnvelope([]XY{{-1, -1}, {1, 1}})
expectNoErr(t, err)
env, err = env.ExtendToIncludeXY(tc)
_, err = env.ExtendToIncludeXY(tc)
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was to fix a lint error complaining that env was never used after this assignment (which was true!).

Copy link
Collaborator

@albertteoh albertteoh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice 👍🏼

@peterstace
Copy link
Owner Author

Thanks for the review!

@peterstace peterstace merged commit 9d7f7aa into master May 13, 2022
@peterstace peterstace deleted the fix_golangci-lint branch May 13, 2022 03:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants