Conversation
neslinesli93
left a comment
There was a problem hiding this comment.
Amazing work, for real ❤️
Unfortunately, our CI service is purposely disabled for public projects, so it can't be run on this PR 😢
I've tried locally to run credo and dialyzer and I got a bunch of errors. You can try mix check and see that credo complains about single pipes, and some other stuff.
Apart from that, I'm not a huge fan of having a Posexional.Field.Field module, mostly for the repetition of words and because imho it's not that self-explanatory. Maybe something like TypedField would be better? I like the reference to Ecto, but the repetition kills me :D
…stency on Posexional.Row.read/2. Fixed credo complains
|
Hey @neslinesli93, Thank you for your review! I've already tackled everything you pointed out! If you have anything more to add, please feel free to do it! :) |
|
Hi @GPrimola ! You have done a really great work here! Thank you for you contribution! I have run dialyzer locally (in the container) and there are still some issues (I count 9 of those). Let us know if you need help to solve them! We are glad to help! Thank you again! |
|
@GPrimola is it ready to be merged? |
|
Hey @chess4ever, thanks! Actually I missed letting dialyzer run fully. Thank you! |
Posexional row as struct (primait#29)
This is a proposal for #11.
Obs 1: There's no breaking changes.
Obs 2: I apologize about the size of this PR. 😅
Major Changes
[:as_struct]toPosexionalRow.__using__/1macro. Not breaking.Posexional.Field.Fieldthat parses field type text. It behaves likeEcto.Schema.field/3. Not breaking.Examples
PosexionalRow.__using__/1with option[:as_struct]andPosexionalRow.field/4with simple data types:Suppose we have the following row definition to be mapped to a struct:
and a positional file (example.txt - not included) with the content
row1123ABA00432.99falseJohn Doe. ThenPosexionalRow.__using__/1with option[:as_struct]andPosexionalRow.field/4with complex data types:If you want more information about the behaviour, you can check the
test/posexional/field/field_test.exsfile where there are examples of bad input and how it's been handled.Please, feel free to comment, propose changes, code refactor, variable, module, function and option naming, etc. I'll be glad to tackle everything!
Congrats about the lib, though! It's been very helpful! 😄