Skip to content

Fix staticcheck issues (ST1001, QF1008, ST1005) #1321

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 4 commits into from
Jul 15, 2025

Conversation

kashitaka
Copy link
Contributor

This is part of the fix for issue #1318.

I’ve addressed only ST1001 (“dot imports are discouraged”) for now, as it was a straightforward change.
Since fixing all staticcheck issues would involve changes across many files, I'd prefer to proceed step by step and confirm the approach with maintainers.

Please let me know if this direction looks good.

Copy link
Member

@mmontes11 mmontes11 left a comment

Choose a reason for hiding this comment

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

The approach looks legit to me. Left a naming suggestion to avoid clashing with our current imports.

Thanks for willing to contribute!

@kashitaka kashitaka requested a review from mmontes11 July 11, 2025 18:35
@kashitaka kashitaka marked this pull request as ready for review July 11, 2025 18:36
@kashitaka
Copy link
Contributor Author

The approach looks legit to me. Left a naming suggestion to avoid clashing with our current imports.
Thanks for willing to contribute!

Thank you for your feedback. I'll work on other typecheck issues except naming rule(ST1003) then.

@kashitaka
Copy link
Contributor Author

I Fixed two more staticcheck issues.

Fixing QF1008 just slightly affects on readability, but I think it's small changes no problem on the software behavior.

However, fixing ST1005 changes error messages that users may see, and it can also introduce some inconsistencies (for example, Galera becomes lowercase when it appears at the beginning of a message).

Please take a look at the ST1005-related commit and let me know your preference. If you prefer, we can also add //nolint:staticcheck comments on specific lines where we want to ignore the warning.

Copy link
Member

@mmontes11 mmontes11 left a comment

Choose a reason for hiding this comment

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

QF1008

LGTM!

ST1005

Could we ignore this rule in the following cases?

  • When referring to an API type i.e. Pod or Backup
  • When referring to names i.e. Galera

Thank you! You are on the right track.

@kashitaka kashitaka force-pushed the kashi/issue-1318 branch 2 times, most recently from b159cc1 to e691502 Compare July 14, 2025 12:32
Copy link
Contributor Author

@kashitaka kashitaka left a comment

Choose a reason for hiding this comment

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

add //nolint to error messages starting with

  • API names like Pod, Certificate, Backup and Job
  • specific name or variable name like Galera and Authorization

@kashitaka
Copy link
Contributor Author

Thank you for the review! I’ve addressed the comments.
To make it easier to review, I’ve squashed all the ST1005-related changes into a single commit. You can check it here: e691502

Let me know if anything else needs adjustment!

@kashitaka kashitaka requested a review from mmontes11 July 14, 2025 12:46
@kashitaka kashitaka changed the title chore: fix staticcheck ST1001 issues (remove dot imports) fix: resolve staticcheck issues (ST1001, QF1008, ST1005) Jul 14, 2025
@kashitaka
Copy link
Contributor Author

@mmontes11 Thanks for updating the commits! Let me know if there's anything else you'd like me to do.

Copy link
Member

@mmontes11 mmontes11 left a comment

Choose a reason for hiding this comment

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

LGTM! Thank you very much for this contribution! 🦭

Will be released in 25.08

@mmontes11 mmontes11 merged commit 2d52da0 into mariadb-operator:main Jul 15, 2025
7 checks passed
@mmontes11 mmontes11 changed the title fix: resolve staticcheck issues (ST1001, QF1008, ST1005) Resolve staticcheck issues (ST1001, QF1008, ST1005) Jul 18, 2025
@mmontes11 mmontes11 changed the title Resolve staticcheck issues (ST1001, QF1008, ST1005) Fix staticcheck issues (ST1001, QF1008, ST1005) Jul 18, 2025
@mmontes11 mmontes11 mentioned this pull request Jul 18, 2025
8 tasks
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.

2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy