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

Report missing formatter #167

Closed
ccoVeille opened this issue Apr 3, 2024 · 4 comments · Fixed by #180
Closed

Report missing formatter #167

ccoVeille opened this issue Apr 3, 2024 · 4 comments · Fixed by #180

Comments

@ccoVeille
Copy link
Contributor

Following #158 idea

Another interesting idea could be to be able to report when our code found block code you could have checked/formatted but you couldn't because the parser is not available.

My point is the fact someone may install your tool, but nothing else.

It will launch mdsf on his markdown files, but it will provide nothing.

So maybe, something you could report at the end as a warning.

@hougesen
Copy link
Owner

hougesen commented Apr 4, 2024

Missing binaries are actually reported when running with --debug. But yes, it should also be shown to the user when running without --debug

image

@hougesen
Copy link
Owner

hougesen commented Apr 4, 2024

Could be something like this based on your idea from #158

file1.md (unchanged) 1466 ms with 1 missing binaries (rustfmt)
file2.md (unchanged) 1466 ms with 2 errors and 4 missing binaries (prettier, just, biome, rustfmt)

or a sum after

file1.md (unchanged) 123ms
file2.md (unchanged) 123ms

Formatted 2 files in 246ms with 2 errors (file2.md) and 4 missing binaries (prettier, just, biome, rustfmt)

@ccoVeille
Copy link
Contributor Author

My point was more about the fact your tool might be unable to format at block because you find no binaries for a format you support.

So, I think you should talk about formatter and not binaries

I mean if you are formatting a shell script and any of beautysh or shfmt is present, it's OK

the issue is when none of these binary is present

@ccoVeille
Copy link
Contributor Author

ccoVeille commented Apr 4, 2024

So yes, summing up at the end would be better

Something like

Warning the following files were not fully formatted because there is no formatter found for: xml, ocaml

  • file2.md
  • file3.md
    ...

Please consider installing some to be able to format these files

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