Skip to content

chore: enable exhaustruct linter #8403

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

Merged
merged 7 commits into from
Jul 11, 2023
Merged

chore: enable exhaustruct linter #8403

merged 7 commits into from
Jul 11, 2023

Conversation

johnstcn
Copy link
Member

@johnstcn johnstcn commented Jul 10, 2023

Just enabling on httpmw\.\w+ for now. We can add coverage as we go.

@johnstcn johnstcn self-assigned this Jul 10, 2023
@johnstcn johnstcn marked this pull request as ready for review July 11, 2023 11:58
@johnstcn johnstcn requested review from mafredri, Emyrk and mtojek July 11, 2023 11:58
@@ -527,6 +527,7 @@ distro() {

if [ -f /etc/os-release ]; then
(
# shellcheck disable=SC1091
Copy link
Member Author

@johnstcn johnstcn Jul 11, 2023

Choose a reason for hiding this comment

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

review: this was making lint fail locally on darwin

Copy link
Member

@mafredri mafredri left a comment

Choose a reason for hiding this comment

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

Looks great, I think this will can be a really valuable tool which forces us to recognize edge-cases and expanded API surface in relevant places!

Copy link
Member

@Emyrk Emyrk left a comment

Choose a reason for hiding this comment

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

👍

One thing that we can do if some structs are just annoying, it maybe adopt a New() style init and use chaining to fill fields. If there are big structs that annoying to populate each time.

@@ -390,6 +390,7 @@ func New(options *Options) *API {
RedirectToLogin: false,
DisableSessionExpiryRefresh: options.DeploymentValues.DisableSessionExpiryRefresh.Value(),
Optional: false,
SessionTokenFunc: nil, // Default behavior
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 need to have the // Default behavior comment?

The comment on the field says: If nil, the default behavior is used.

Copy link
Member Author

Choose a reason for hiding this comment

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

We don't need the comment, I was just being super explicit about what it means.

@johnstcn johnstcn merged commit 3f6a158 into main Jul 11, 2023
@johnstcn johnstcn deleted the cj/exhaustruct branch July 11, 2023 13:30
@github-actions github-actions bot locked and limited conversation to collaborators Jul 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants