@@ -26,7 +26,8 @@ defmodule JS2E do
26
26
27
27
@ spec main ( [ String . t ( ) ] ) :: :ok
28
28
def main ( args ) do
29
- { options , paths , errors } = OptionParser . parse ( args , switches: [ module_name: :string ] )
29
+ { options , paths , errors } =
30
+ OptionParser . parse ( args , switches: [ module_name: :string ] )
30
31
31
32
if Enum . empty? ( paths ) == true do
32
33
IO . puts ( @ moduledoc )
@@ -41,7 +42,9 @@ defmodule JS2E do
41
42
files = resolve_all_paths ( paths )
42
43
43
44
if Enum . empty? ( files ) == true do
44
- print_error ( "Error: Could not find any " <> "JSON files in path: #{ inspect ( paths ) } " )
45
+ print_error (
46
+ "Error: Could not find any JSON files in path: #{ inspect ( paths ) } "
47
+ )
45
48
46
49
exit ( :no_files )
47
50
end
@@ -122,9 +125,11 @@ defmodule JS2E do
122
125
else
123
126
Logger . info ( "Converting to Elm code!" )
124
127
125
- printer_result = Printer . print_schemas ( parser_result . schema_dict , module_name )
128
+ printer_result =
129
+ Printer . print_schemas ( parser_result . schema_dict , module_name )
126
130
127
- tests_printer_result = Printer . print_schemas_tests ( parser_result . schema_dict , module_name )
131
+ tests_printer_result =
132
+ Printer . print_schemas_tests ( parser_result . schema_dict , module_name )
128
133
129
134
cond do
130
135
length ( printer_result . errors ) > 0 ->
@@ -163,7 +168,7 @@ defmodule JS2E do
163
168
String . replace ( module_name , "." , "/" )
164
169
)
165
170
166
- Logger . debug ( fn -> "Writing file '#{ normalized_file_path } '" end )
171
+ Logger . debug ( "Writing file '#{ normalized_file_path } '" )
167
172
{ :ok , file } = File . open ( normalized_file_path , [ :write ] )
168
173
IO . binwrite ( file , file_content )
169
174
File . close ( file )
@@ -210,7 +215,8 @@ defmodule JS2E do
210
215
"-" ,
211
216
max (
212
217
0 ,
213
- 74 - String . length ( pretty_warning_type ) - String . length ( file_path )
218
+ 74 - String . length ( pretty_warning_type ) -
219
+ String . length ( file_path )
214
220
)
215
221
)
216
222
@@ -305,7 +311,8 @@ defmodule JS2E do
305
311
end
306
312
307
313
defp warning_header do
308
- header = String . duplicate ( "^" , 35 ) <> " WARNINGS " <> String . duplicate ( "^" , 35 )
314
+ header =
315
+ String . duplicate ( "^" , 35 ) <> " WARNINGS " <> String . duplicate ( "^" , 35 )
309
316
310
317
IO . puts ( IO.ANSI . format ( [ :yellow , header ] ) )
311
318
end
0 commit comments