Skip to content

Daemonized version of ceylon.formatter

License

Apache-2.0, LGPL-3.0 licenses found

Licenses found

Apache-2.0
LICENSE
LGPL-3.0
LICENSE.LGPLv3
Notifications You must be signed in to change notification settings

lucaswerkmeister/cformat

Repository files navigation

cformat

A daemonized version of the ceylon.formatter command line tool (ceylon format), mostly to showcase ceylond.

Installation

make install # install to home directory
systemctl --user daemon-reload # make user manager see cformat.{service,socket} units
systemctl --user enable --now cformat.socket # start daemon

The cformat binary will be installed in $(systemd-path user-binaries), which is ~/.local/bin with the default XDG paths. Ensure that this directory is contained in your PATH.

To uninstall, run the reverse commands:

systemctl --user disable --now cformat.service cformat.socket
make uninstall
systemctl --user daemon-reload

Usage

cformat is a drop-in replacement for ceylon format (except for some very minor caveats around pipe mode):

cformat source # to format all Ceylon code in source
cformat source --to source-formatted # if you’re afraid I might break your code – directory structure is preserved
cformat source test-source # to format all Ceylon code in source and test-source
cformat source --and test-source --to formatted # to format all Ceylon code in source and test-source into formatted

Performance

The first invocation of cformat, which launches the daemon, will be slightly slower, since the JVM has to load, run and optimize more code. But after that, cformat can be vastly faster than ceylon format, since the daemon just keeps running and is optimized further and further by the JVM:

License

The content of this repository is released under the ASL v2.0 as provided in the LICENSE file that accompanied this code.

By submitting a “pull request” or otherwise contributing to this repository, you agree to license your contribution under the license mentioned above.

cformat uses ceylond, which is published under the LGPLv3, as provided in the LICENSE.LGPLv3 file that accompanied this code.