Name |
Ceylon Source Code Formatter |
---|---|
Category |
Command-line plugins
Modules which have command-line plugins available. You can install them with |
Backends | JVM |
Maven coordinates | |
Compatible Ceylon release |
JVM: 1.2.x, 1.3.x (latest) |
Published | Mar 2, 2017 |
Stats |
Downloads (JVM): 383 Source downloads: 416 |
Authors |
Lucas Werkmeister <mail@lucaswerkmeister.de> |
License | https://www.apache.org/licenses/LICENSE-2.0.html |
Description |
A formatter for the Ceylon programming language. Command line usageNote: if the ceylon plugin install ceylon.formatter/1.3.2 To format all Ceylon code in the ceylon format source test-source To format all Ceylon code in the ceylon format source --to source-formatted To format all Ceylon code in the ceylon format source --and test-source --to source-formatted (This results in two subdirectories You can specify an arbitrary amount of these formatting commands: ceylon format \ source --to source-formatted \ test-source --to test-source-formatted (The line breaks are only included for clarity and not a part of the command line syntax.) If no formatting commands are present, the formatter operates in “pipe mode”, reading code from standard input and writing to standard output. OptionsYou can specify formatting options using the following syntax: --optionName=optionValue # or --optionName optionValue For available option names, see
Library usageUse the If the node was parsed from an existing file, don’t forget
to pass the token stream to To construct FormattingOptions, usage of named arguments is highly recommended: FormattingOptions { indentMode = Spaces(8); maxLineLength = 80; } You can also use SparseFormattingOptions and combinedOptions to compose several sets of options, like this: combinedOptions { baseOptions = companyWideOptions; SparseFormattingOptions { indentMode = Spaces(1); // our department has very small screens :-( } } |
Dependencies |
ceylon.file/1.3.2
shared
com.redhat.ceylon.cli/1.3.2
shared
java.base/7 JDK
shared
|
Usage |
import ceylon.formatter "1.3.2"; $ ceylon run ceylon.formatter/1.3.2 <property name="ceylon.home" value="…"/> <property name="ceylon.ant.lib" value="${ceylon.home}/lib/ceylon-ant.jar"/> <path id="ant-tasks"> <pathelement path="${ceylon.ant.lib}"/> </path> <typedef resource="com/redhat/ceylon/ant/antlib.xml" classpathref="ant-tasks"/> <target name="run"> <ceylon-run module="ceylon.formatter/1.3.2"/> </target> $ ceylon plugin install ceylon.formatter/1.3.2 <property name="ceylon.home" value="…"/> <property name="ceylon.ant.lib" value="${ceylon.home}/lib/ceylon-ant.jar"/> <path id="ant-tasks"> <pathelement path="${ceylon.ant.lib}"/> </path> <typedef resource="com/redhat/ceylon/ant/antlib.xml" classpathref="ant-tasks"/> <target name="run"> <ceylon-plugin mode=install module="ceylon.formatter/1.3.2"/> </target> |
Module links |
Members Imported By Home Code repository Issue tracker Browse Download .car No .js archive Download source archive Download scripts archive Scripts Download module documentation View API documentation |