Closed robinmonjo closed 6 years ago
Ok I think I'm done with this PR. @yordis if you want to have a look, be my guest 😊
Did you ran elixir format
?
Yes I did ran mix format
, formatting is also checked by CI but I didn't include .formatter.exs
in the list of file to format 😊. Fixed in last commit
Add .editorconfig
, it will help with situations of trimming the spaces and adding the jump of line at the end of the file
# .editorconfig
root = true
[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[*.md]
trim_trailing_whitespace = false
Well you need to install the plugin for your editor for sure 😄
Don't you think this would be redundant with mix format
? I think mix format
already ensure everything you list in the config file
@robinmonjo does mix format
add the jump at the end of the file or trim trailing whitespace?
I think it doesn't because some of your files are missing the jump at the end of the line
Also is for all the files on the system
Yes it does add the jumpline (only on files that matches the patterns defined in .formatter.exs
. As for trailing whitespaces I'm not sure my editor does it for me. Will take a look at editor config (you are the first one who talk to me about this)
I like editorconfig
because you help the people that contributes to the project and you mitigate the issue with IDE/Editors configuration, at least they could install the plugin (which some of the editors and IDE already have it by default) and it will help us out.
Ok @yordis I added the .editorconfig
file :+1:
@yordis is it all good for you ? Should we merge this ?
@robinmonjo all good man! Amazing work 😎
👍 thanks again for the review and advices ! I started to read the "Metaprogramming Elixir" book to see what can be done with the AST and how to use it to build a "blockchain language" for smart contracts. Lot's of work, big subject but might be interesting :)
The goal of this PR is to use the Elixir 1.6 code formatter and write type specs on the entire codebase
So far I set up the code formatter. I had to:
TODOs:
run dialyzer in the CI ? (this will make things slow or maybe Travis can cache PLT ?)possible http://blog.danielberkompas.com/elixir/2015/04/03/run-dialyzer-on-elixir-on-travis.html but won't do it ...Once Elixir 1.6 is released I will have to "simplify" the
travis.yml
Fix: https://github.com/robinmonjo/coincoin/issues/14 Fix: https://github.com/robinmonjo/coincoin/issues/18