-
-
Notifications
You must be signed in to change notification settings - Fork 112
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
vars and consts grouped #33
Comments
Thanks! I wonder if this would be too noisy to do for two lines, as we double the amount of source lines. But I'd definitely agree that this should happen for three or more contiguous lines. |
I think I'd still prefer it with only 2 or more. Maybe that could be configurable? |
I'm afraid configuration is near impossible; if we added any flags, config files, or env vars, then this tool would no longer be a drop-in replacement for gofmt. I also want this tool to be a "gofmt with some extras", so it should work out of the box without any extra configuration needed. If anything requires the user to make a decision, it's not worth doing in a formatting tool that's opinionated. Having said this, we could make different decisions based on the context. For example, I think globals should be grouped if there are at least 2. Local variables could have a higher threshold (like 3) if 2 is too noisy. |
Ideally, it would be best to group all
vars
/consts
that are defined close to each other.Example:
bad:
good:
The text was updated successfully, but these errors were encountered: