You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Your feature request related to a problem? Please describe
Currently, golines applies --max-len uniformly across all AST nodes. When setting a reasonable limit (e.g., -m 120) to keep business logic and comments readable, it forces function signatures with 4-5 parameters to wrap across multiple lines.
The Go standard library frequently keeps function signatures on a single line even when they exceed typical column limits (e.g., image/draw has signatures over 140 characters). The current golines behavior forces a choice: either accept multiline signatures that diverge from standard library style, or increase --max-len globally and lose formatting strictness for the rest of the file.
Describe the solution you'd like
I would like an option to prevent golines from wrapping function signatures, or to allow them a separate, longer length limit.
Potential solutions:
A boolean flag (e.g., --ignore-func-signatures) that skips formatting for func declaration nodes.
A separate length configuration (e.g., --max-sig-len=150) that applies a different boundary specifically to function signatures.
Describe alternatives you've considered
//golines:ignore: Manually adding this comment above every long signature works, but adds noise and requires manual upkeep.
Parameter Objects: Grouping parameters into a dedicated struct just to reduce the signature length. This introduces unnecessary indirection and creates types whose only purpose is to satisfy the formatter.
Accepting Multiline Signatures: Letting golines format them across multiple lines. This is my current workaround, but I would prefer the option to maintain single-line signatures.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Welcome
How did you install golines?
Official binary
Your feature request related to a problem? Please describe
Currently, golines applies
--max-lenuniformly across all AST nodes. When setting a reasonable limit (e.g.,-m 120) to keep business logic and comments readable, it forces function signatures with 4-5 parameters to wrap across multiple lines.The Go standard library frequently keeps function signatures on a single line even when they exceed typical column limits (e.g., image/draw has signatures over 140 characters). The current golines behavior forces a choice: either accept multiline signatures that diverge from standard library style, or increase
--max-lenglobally and lose formatting strictness for the rest of the file.Describe the solution you'd like
I would like an option to prevent golines from wrapping function signatures, or to allow them a separate, longer length limit.
Potential solutions:
Describe alternatives you've considered
//golines:ignore: Manually adding this comment above every long signature works, but adds noise and requires manual upkeep.Additional context
No response
Beta Was this translation helpful? Give feedback.
All reactions