Skip to content

feat: add golangci-lint#48

Merged
mdelapenya merged 1 commit intotestcontainers:mainfrom
hhsnopek:golangci-lint
Nov 21, 2022
Merged

feat: add golangci-lint#48
mdelapenya merged 1 commit intotestcontainers:mainfrom
hhsnopek:golangci-lint

Conversation

@hhsnopek
Copy link
Contributor

Context

This pull request introduces golangci-lint into the existing CI/CD Pipeline to increase the project's code health. Applying go fmt to all files and fixes a lot of missing error handling.

@hhsnopek hhsnopek requested a review from mdelapenya November 10, 2022 21:03
main.go Outdated
cli.ContainerRemove(context.Background(), container.ID, types.ContainerRemoveOptions{RemoveVolumes: true, Force: true})
err := cli.ContainerRemove(context.Background(), container.ID, types.ContainerRemoveOptions{RemoveVolumes: true, Force: true})
if err != nil {
log.Println(err)
Copy link
Member

Choose a reason for hiding this comment

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

Do we want to continue here to avoid incrementing the number of deleted containers?

Copy link
Member

@kiview kiview Nov 17, 2022

Choose a reason for hiding this comment

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

If I am nitpicking, I would probably add this in a follow-up bugfix PR, to have a slightly better Git history and keep this PR here focused on the linting change 🙂

Copy link
Member

Choose a reason for hiding this comment

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

Mmmm I think it is actually part of the change: handle the error, which was not handled in the past

Copy link
Member

Choose a reason for hiding this comment

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

Which number of deleted containers we would have before? Probably no output, since it would fail? Or we would have the wrong number?

Copy link
Member

Choose a reason for hiding this comment

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

The error was swallowed, the execution continued adding a container to the map.

Being strict, it could be considered a fix, yeah

Copy link
Member

Choose a reason for hiding this comment

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

But we can also be pragmatic and fix it here. I think having the discussion was more important than the detail where we fix it (as long as we fix it).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm unsure what the expected functionality should be at this time, happy to discuss it further in another PR as there are a handful of unhandled errors.

Copy link
Member

@mdelapenya mdelapenya left a comment

Choose a reason for hiding this comment

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

LGTM, although we left a a few comments that need to be addressed before the final approval.

Could you please also resolve the conflicts after recent merges?

Thanks for your time @hhsnopek!

@hhsnopek
Copy link
Contributor Author

@mdelapenya @kiview I apologize for the force push, but I've resolved the comments which means I've removed the additional error handling/logs in-favor of keeping the scope to adding golangci-lint.

@hhsnopek hhsnopek requested review from kiview and mdelapenya and removed request for kiview and mdelapenya November 20, 2022 23:12
@mdelapenya mdelapenya self-assigned this Nov 21, 2022
@mdelapenya mdelapenya merged commit 8f512d3 into testcontainers:main Nov 21, 2022
@hhsnopek hhsnopek deleted the golangci-lint branch November 21, 2022 16:49
@mdelapenya mdelapenya added the chore Changes that do not impact the existing functionality label Nov 29, 2022
mdelapenya added a commit to gesellix/moby-ryuk that referenced this pull request Dec 1, 2022
* main:
  feat: add golangci-lint (testcontainers#48)
  chore: add unit tests for Prune function (testcontainers#46)
  chore(ci): only push Docker image on tags (testcontainers#47)
  chore: bump build system versions (testcontainers#45)
  chore: rename branch to main (testcontainers#44)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Changes that do not impact the existing functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants