Skip to content

Unwrap lines when wrapping isn't needed #70

@glacials

Description

@glacials

Hi, thanks for golines, it's a fantastic tool! I'm just wondering if there are any plans to add "unwraps" for lines that are wrapped but don't need to be?

As a real world example, if I write this:

return nil, fmt.Errorf("cannot get frontmatter from Markdown file `%s`: %w", path, err)

And running golines formats it to this:

return nil, fmt.Errorf(
  "cannot get frontmatter from Markdown file `%s`: %w",
  path,
  err,
)

But then let's say I simplify the error message. Current behavior would be to leave the line breaks in place:

return nil, fmt.Errorf(
  "cannot get frontmatter: %w",
  err,
)

But what I would want is this:

return nil, fmt.Errorf("can't get frontmatter: %w", err)

Thanks for considering!

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions