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

Abandoned change to not modify files where fmt makes no changes #794

Closed
hellified opened this issue Jun 14, 2024 · 3 comments
Closed

Abandoned change to not modify files where fmt makes no changes #794

hellified opened this issue Jun 14, 2024 · 3 comments

Comments

@hellified
Copy link

There was an issue: #128
And a code change: 3d478b3

But it looks as though the change was abandoned?
I was hoping either to have the change merged in, since I'm having the same issue as the original issue filer, or learn what the alternative/workaround was.

@a-h
Copy link
Owner

a-h commented Jun 16, 2024

Yeah, I don't know why...

Looks like the design of that section shifted a lot:

func format(write writer, read reader) (err error) {
fileName, src, err := read()
if err != nil {
return err
}
t, err := parser.ParseString(src)
if err != nil {
return err
}
w := new(bytes.Buffer)
if err = t.Write(w); err != nil {
return fmt.Errorf("formatting error: %w", err)
}
return write(fileName, w.String())
}

It would need a revisit to make that work, but seems like a reasonable use case to support.

@a-h
Copy link
Owner

a-h commented Jun 16, 2024

See #797

@hellified
Copy link
Author

Ah, that's wonderful. Just fell through the cracks I guess. Back on track now, so no worries. I'll just watch the PR and anticipate the release.
Thanks!

@a-h a-h closed this as completed in a0f5da5 Jun 27, 2024
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

No branches or pull requests

2 participants