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

-lint always fails #48

Closed
nobu-k opened this issue Sep 20, 2022 · 5 comments · Fixed by #50
Closed

-lint always fails #48

nobu-k opened this issue Sep 20, 2022 · 5 comments · Fixed by #50
Milestone

Comments

@nobu-k
Copy link

nobu-k commented Sep 20, 2022

I've just started using yamlfmt since v0.4.0, so I don't know how it worked before, but I think this issue was introduced in v0.4.0 because of the new diff library.

https://github.com/RageCage64/multilinediff seems to always return non-empty string but

if diffContent != "" {
detects lint errors by checking if a return value is empty or not. As a result, running yamlfmt with -lint always fails even if there's no diff.

Similarly, -dry always outputs all contents.

@braydonk
Copy link
Collaborator

Thank you for making an issue!

Pretty silly oversight on my part, when I was testing this I only tested it on yaml that needed changes, and forgot the test case of a yaml file that's already formatted. 😧

I can get a patch release out for this tomorrow.

@braydonk
Copy link
Collaborator

While fixing this I found another thing that I meant to fix on v0.4.0, which is that the multiline diffing always assumed \n. This was a bit of a bigger change than I expected that required an API change, so I'll be doing this in a new minor release.

@nobu-k
Copy link
Author

nobu-k commented Sep 21, 2022

Thank you for your quick work!

@braydonk
Copy link
Collaborator

v0.5.0 is released! Thank you for your patience and hopefully this works better.

@nobu-k
Copy link
Author

nobu-k commented Sep 22, 2022

I confirmed it's been fixed! Thank you!

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

Successfully merging a pull request may close this issue.

2 participants