-
Notifications
You must be signed in to change notification settings - Fork 528
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
Configure formatter width #1156
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -5,13 +5,11 @@ defmodule Absinthe.Schema.Notation.SDL.Render do | |||
|
||||
alias Absinthe.Blueprint | ||||
|
||||
@line_width 120 | ||||
|
||||
def inspect(term, %{pretty: true}) do | ||||
def inspect(term, %{pretty: true, width: width}) do | ||||
term | ||||
|> render() | ||||
|> concat(line()) | ||||
|> format(@line_width) | ||||
|> format(width) | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should this not be applied in the There are two intermedate representations in Absinthe of schema/executable documents. The Language structs, which is the result of the lexer/parser. And the Blueprint structs, which is used to build schema's and execute them. Both representations can be rendered to the graphql string representation. The Language representation can be converted to executable documents. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, I overlooked that. I'm happy to make the change wherever it makes the most sense to you 😄 . There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. absinthe/lib/absinthe/language/render.ex Line 12 in 102360e
|
||||
|> to_string | ||||
end | ||||
|
||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will only match if a width is passed as an opt right? Do you also need another clause that does not match on width?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe we benefit here from the default Inspect.Opts.