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

Add --skip-elm-format flag #447

Merged
merged 8 commits into from
Feb 3, 2021
Merged

Conversation

lydell
Copy link
Contributor

@lydell lydell commented Feb 1, 2021

This is useful in Dockerfiles:

  • There’s no need for elm-format in a build. Installing it and running it slows the build down. This is true for other builds than Docker ones, too.

  • elm-format does not work in all Docker images. In Alpine images, it does not work at all. The default node image uses Debian Stretch, but elm-format 0.8.4 requires Debian Buster. Sometimes it’s easier to disable elm-format than to switch image. Dillon also mentioned that elm-format 0.8.4 is also causing issues in the default Netlify build.

This PR adds a --skip-elm-format flag that skips running elm-format on the generated output.

Unfortunately, the generated Elm code is not syntactically valid. The Elm compiler does not accept it, but elm-format’s more lenient parser does. So I had to add a space here and there in the code generation so the output of a elm-graphql --skip-elm-format run is still valid. I think it’s good not to rely on elm-format’s parser anyway.

I recommend reviewing commit by commit in order not to get lost in the sea of no-format-example/ files.

@dillonkearns dillonkearns merged commit a45cd42 into dillonkearns:master Feb 3, 2021
@dillonkearns
Copy link
Owner

This is perfect, thank you very much Simon! 🙏

@lydell lydell deleted the elm-format branch February 3, 2021 07:24
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 this pull request may close these issues.

2 participants