File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11name = " ITensorFormatter"
22uuid = " b6bf39f1-c9d3-4bad-aad8-593d802f65fd"
3- version = " 0.2.28 "
3+ version = " 0.3.0 "
44authors = [" ITensor developers <support@itensor.org> and contributors" ]
55
66[workspace ]
Original file line number Diff line number Diff line change @@ -143,13 +143,25 @@ function process_args(argv)
143143 return (; paths, format, format_yaml)
144144end
145145
146+ function format_stdin ()
147+ content = read (stdin , String)
148+ content = organize_import_blocks_string (content)
149+ content = JuliaFormatter. format_text (content; JULIAFORMATTER_OPTIONS... )
150+ content = Runic. format_string (content)
151+ write (stdout , content)
152+ return 0
153+ end
154+
146155"""
147156$(help_markdown ())
148157"""
149158function main (argv)
150159 (; paths, format, format_yaml) = process_args (argv)
151160 ! format && return 0
152- isempty (paths) && return error (" No input paths provided." )
161+ if isempty (paths)
162+ format_stdin ()
163+ return 0
164+ end
153165 jlfiles = filterpaths (isjlfile, paths)
154166 yamlfiles = format_yaml ? filterpaths (isyamlfile, paths) : String[]
155167 projectomls = filterpaths (isprojecttoml, paths)
You can’t perform that action at this time.
0 commit comments