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

[Req] Flag to ignore errors #203

Closed
pakoito opened this issue May 31, 2018 · 11 comments
Closed

[Req] Flag to ignore errors #203

pakoito opened this issue May 31, 2018 · 11 comments

Comments

@pakoito
Copy link

pakoito commented May 31, 2018

I currently have a codebase that mixes classes and regular files that I'd like formatted in one go. At the moment, all the errors when Fatal error: exception ("Internal Error: classes not implemented") create an empty file that's not cleaned up and pollutes the repository.

I'd like to have an option --ignore-errors that skips files with errors, or just logs them to console.

@hcarty
Copy link
Contributor

hcarty commented May 31, 2018

One option you could use for now is to add a [@@@ocamlformat.disable] annotation to the source files which don't format properly. This will cause ocamlformat to leave their code unmodified.

Have you tried the latest masterbranch of ocamlformat? There have been several class- and object-related fixes which may help as well.

@pakoito
Copy link
Author

pakoito commented May 31, 2018

I'll check with the other owners re annotations.

I have not tried master. Is it possible to pin the latest master from opam? Or does it require to build from source? I'm fairly new to the ecosystem :D

@hcarty
Copy link
Contributor

hcarty commented May 31, 2018

opam pin add ocamlformat --dev-repo should do it. That will give you a build from the latest commit to master.

@pakoito
Copy link
Author

pakoito commented May 31, 2018

Thanks! What's the command to pin it back to a release version?

@hcarty
Copy link
Contributor

hcarty commented May 31, 2018

opam pin remove ocamlformat

@pakoito
Copy link
Author

pakoito commented May 31, 2018

Perfect. Thanks again ^^

@pakoito
Copy link
Author

pakoito commented May 31, 2018

Should I close this ticket, or is it a suggestion worth considering?

@pakoito
Copy link
Author

pakoito commented Jul 17, 2018

Ping

@hhugo
Copy link
Collaborator

hhugo commented Jul 17, 2018

Keep it open. I'd love to have this as well. I might even have a patch for it already.

@hhugo
Copy link
Collaborator

hhugo commented Aug 1, 2018

I think we can close this one now that #243 is merged:

  • process all files instead of stopping at the first error.
  • accept a --quiet flag to quiet errors due to invalid source files.

@pakoito
Copy link
Author

pakoito commented Aug 1, 2018

Thank you @hhugo! That's two coffees I owe you this week ^^

@pakoito pakoito closed this as completed Aug 1, 2018
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

4 participants