Popularity
2 Stars
Updated Last
1 Year Ago
Started In
March 2014

AutoFormat.jl

Build Status

Basic autoformat tool for Julialang

Notice

As Stefan mentioned the right way to do this is to enhance the printing of Julia ASTs to the point where the printed form of an expression object is the properly formatted version.

Read list:

Installing Unregistered Packages

 Pkg.clone("git://github.com/yulijia/AutoFormat.jl.git")

Example

using AutoFormat
format("/home/yu/messy_code.jl","/home/yu/messy_code_format.jl",2)
    # usage : format_demo(input_file,output_file,tab_width)
    # download a messy code file example at https://gist.github.com/yulijia/9391666

Todo

  • Learning abstract syntax tree
  • Fix bugs
    • can not format one line block
    • matrix alignment
    • wrong comments style
  • Other features
    • indent with tabs
    • print result with STDOUT
    • print comments or not
    • display diffs instead of rewriting files