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

updates and fixes to linters #4828

Merged
merged 3 commits into from
Apr 9, 2024
Merged

Conversation

tonistiigi
Copy link
Member

Enable new nilness and unusedwrite linters that seem to be quite useful and did point to some actual issues.

Signed-off-by: Tonis Tiigi <[email protected]>
Signed-off-by: Tonis Tiigi <[email protected]>
.golangci.yml Outdated
- unusedwrite
# enable-all: true
# disable:
# - fieldalignment
Copy link
Member Author

@tonistiigi tonistiigi Apr 9, 2024

Choose a reason for hiding this comment

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

fieldalignment is also somewhat interesting. Enabling it would mean 100+ updates to current structs. How many of these cases actually have practical benefits is not fully clear to me yet. This could be considered but needs more analysis before.

Shadow could catch some issues, but currently there are quite a lot of places where we intentionally use the same variable name, and changing it could hurt readability.

Copy link
Member

Choose a reason for hiding this comment

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

With fieldalignment, wouldn't that mean we couldn't keep our structs ordered for readability? Unless the memory usage is incredibly dramatic, I'd prefer to allow ordering/grouping of struct fields to be done to keep readability of the code.

Signed-off-by: Tonis Tiigi <[email protected]>
Copy link
Collaborator

@profnandaa profnandaa left a comment

Choose a reason for hiding this comment

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

LGTM. +1 code format standardization 👍

@tonistiigi tonistiigi merged commit b650785 into moby:master Apr 9, 2024
72 checks passed
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.

4 participants