aonemd / code-formatter

Portable code formatting library. Format any Lisp from any Lisp.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

A scheme code formatter

Usage

$ scheme-format path/to/my/scheme/file.scm

Formatted scheme code is output to Standard Out.

If you'd like to edit a file in place you can use the -i option

$ scheme-format -i path/to/my/scheme/file.scm

It is recommended that you integrate this with your favorite editor such that it can replace the current version of your code with the formatted one produced by this.

See the GitHub Issues for future enhancements.

Note

This formatter is ok, but needs some love. Check out the GitHub Issues for some more details. The long term goal is to bring it more in line with the scheme-style style guide.

We can, of course, add in some custom formatting options, but the default should be close to that. Any help you can provide to move us forward would be greatly appreciated.

Features

  • Runs from the command line
  • Makes decisions about line breaks as well as indentation
  • Sorts terms such as function definitions alphabetically where this will not change the meaning of the program

Current Status

A straight port of code-formatter (previously known as "scheme-format") to Chicken 5.x with a minor amount of cleanup.

Building From Source

Requires Chicken Scheme 5.x

Just run the install-deps.sh and build.sh files and add the resulting scheme-format file to your $PATH

If you edit the etc.scm or format.scm files you'll want to run

csc -s etc.scm -j etc
csc -s format.scm -j format

To regenerate the .import.scm and .sofiles before running the bulid script, or manually runningcsc -static main.scm -o scheme-formatter`

About

Portable code formatting library. Format any Lisp from any Lisp.

License:MIT License


Languages

Language:Scheme 97.1%Language:Batchfile 2.3%Language:Shell 0.6%