Added an option to let dogma parse source from stdin #194
Conversation
def version, do: @version | ||
|
||
defp read_from_stdin(source \\ "") do | ||
case IO.read(:stdio, :line) do |
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.
Is there an argument to read entirely to EOF in one go?
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 was thinking to read the source in one go so its easier to add a check later to detect if the source is valid before we hand it off for parsing ?
How might we be able to test this? |
I have no idea how to test it.... :/ |
Just an idea, but maybe this could be generalised a bit so that dogma supported reading from files passed on the command line, with stdin being a special type of file. That way you could test most of this change by passing it some files. Might not fully test the stdin case - but it should only be a line or two of difference. |
@kthelgason I would be very happy if you could jump in :) after using spacemacs for about two months, I reverted back to the Intelli-J lineup of IDE's since I missed the deeper code integration / analyzation and other tools. |
I'm closing this due to inactivity. Reopen if you want to continue with this :) |
This pull request will enable dogma to parse source from stdin.
see discussion : #193