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

Split ST1003 in multiple checks / allow to partially disable ST1003 #1575

Open
iTrooz opened this issue Jul 16, 2024 · 3 comments
Open

Split ST1003 in multiple checks / allow to partially disable ST1003 #1575

iTrooz opened this issue Jul 16, 2024 · 3 comments
Labels
needs-decision We have to decide if this check is feasible and desirable

Comments

@iTrooz
Copy link

iTrooz commented Jul 16, 2024

All identifiers, such as variables and package names, are grouped under ST1003.

I think it'd be good to have the possibility to only enable ST1003 for the given types of identifier, e.g, variables

My use case: I work on a project where renaming the packages into compliance is not an option, so I had to disable ST1003. But I still would like to check for incorrect variables names / other incorrect identifiers other than package names

@iTrooz iTrooz added the needs-triage Newly filed issue that needs triage label Jul 16, 2024
@iTrooz
Copy link
Author

iTrooz commented Jul 16, 2024

Another case where this could be useful: github CLI: https://github.com/cli/cli/blob/1a102edb52153bd90a3d339af4686d8d1af84bbf/pkg/cmd/root/root.go#L123-L139

Their package names (e.g. versionCmd) do not satisfy ST1003, but they still seem like a good choice in this case

@iTrooz
Copy link
Author

iTrooz commented Jul 17, 2024

I found a workaround with golangci-lint by adding this to the configuration:

issues:
  exclude:
    - "should not use MixedCaps in package name"

I wonder if there is a way to do it using pure staticcheck

@dominikh
Copy link
Owner

I wonder if there is a way to do it using pure staticcheck

Not at the moment, no. I'll have to think about it.

@dominikh dominikh added needs-decision We have to decide if this check is feasible and desirable and removed needs-triage Newly filed issue that needs triage labels Jul 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-decision We have to decide if this check is feasible and desirable
Projects
None yet
Development

No branches or pull requests

2 participants