Releases: eclipse-archived/ceylon.formatter
1.3.3
Changes from the previous version (1.3.2):
- Support for new language features:
- Specifying the artifact ID in a module import is now supported. This feature was part of Ceylon 1.3.2, but not added to ceylon.formatter due to an oversight.
- Specifying the classifier in a module descriptor is now supported.
See #139. - The
dynamic [,]
syntax for an empty dynamic array is now supported.
See #137. - Version constant interpolation is now supported.
See #140 and eclipse-archived/ceylon#7157. - Non-disjoint switch cases with
else case
are now supported.
See #141 and eclipse-archived/ceylon#6806.
The .car
file for this release has been made reproducible using a fork of Debian’s strip-nondeterminism
program. The following script, on a fresh Debian Jessie GNU/Linux system, should produce the exact same binary:
#!/bin/bash
languageVersion=1.3.3
languageRelease=0
projectVersion=1.3.3
repoUser=ceylon
repoName=ceylon.formatter
modules=(ceylon.formatter)
repo=https://modules.ceylon-lang.org/repo/1
timestamp=1503800000
# install dependencies
apt install --yes --allow-unauthenticated \
git \
default-jre \
wget \
curl \
ant \
zip \
unzip \
libarchive-zip-perl \
python3
# install Ceylon
cd /opt
wget https://downloads.ceylon-lang.org/cli/ceylon-${languageVersion}_${languageVersion}-${languageRelease}_all.deb
dpkg -i ceylon-${languageVersion}_${languageVersion}-${languageRelease}_all.deb
# build project
git clone https://github.com/$repoUser/$repoName
cd $repoName
git checkout $projectVersion
sed -i "/dist.root.dir=/ s =.*$ =/usr/share/ceylon/$languageVersion " build.properties
ant compile
cd ..
# strip nondeterminism
git clone https://github.com/lucaswerkmeister/strip-nondeterminism
cd strip-nondeterminism
for module in "${modules[@]}"; do
car="../$repoName/modules/${module//\.//}/$projectVersion/$module-$projectVersion.car"
perl -I lib -- bin/strip-nondeterminism -t car -T $timestamp "$car"
echo -n $(sha1sum "$car" | cut -f1 -d' ') > "$car".sha1
done
cd ..
# compare checksums
for module in "${modules[@]}"; do
echo
echo "$module"
cat "$repoName/modules/${module//\.//}/$projectVersion/$module-$projectVersion.car.sha1"; echo
curl "$repo/${module//\.//}/$projectVersion/$module-$projectVersion.car.sha1"; echo
done
exit 0
1.3.2
Changes from the previous version (1.3.1):
- Code style changes:
- While the formatter usually forces each statement of a body or block to have its own line, it sometimes permits single-statement blocks to be collapsed into a single line with their braces. This has been restricted, and most kinds of blocks are no longer eligible for this. In some cases, like functions and getters, the arrow form should be used instead; other cases simply should not be compressed that much, and should span several lines, as the formatter will now enforce.
See #130. - A new boolean option (flag),
indentComprehensionClauses
, has been added (default:true
). It controls whether comprehension clauses are indented by one level each (forming a cascade), or not (resembling SQL).
See #134.
- While the formatter usually forces each statement of a body or block to have its own line, it sometimes permits single-statement blocks to be collapsed into a single line with their braces. This has been restricted, and most kinds of blocks are no longer eligible for this. In some cases, like functions and getters, the arrow form should be used instead; other cases simply should not be compressed that much, and should span several lines, as the formatter will now enforce.
- Support for new language features:
- The new extended module descriptor syntax, specifying namespace, group ID and artifact ID is supported.
See eclipse-archived/ceylon#6872. - Interpolated assertion messages are supported. (This required no changes in the formatter itself, but previous versions of the formatter do not support this since they import an older version of the parser.)
- The new extended module descriptor syntax, specifying namespace, group ID and artifact ID is supported.
- Other changes:
- The CLI now warns about implicit pipe mode (no file specifications and no
--pipe
). If you want to use pipe mode, please specify the--pipe
flag. Implicit pipe mode will be removed in the next major release. - The CLI attempts to copy ownership information when formatting to new files and directories.
- The CLI now uses the encoding declared in the Ceylon configuration to read and write files.
See #133.
- The CLI now warns about implicit pipe mode (no file specifications and no
The .car
file for this release has been made reproducible using a fork of Debian’s strip-nondeterminism
program. The following script, on a fresh Debian Jessie GNU/Linux system, should produce the exact same binary:
#!/bin/bash
languageVersion=1.3.2
languageRelease=0
projectVersion=1.3.2
repoUser=ceylon
repoName=ceylon.formatter
modules=(ceylon.formatter)
repo=https://modules.ceylon-lang.org/repo/1
timestamp=1488442200
# install dependencies
apt install --yes --allow-unauthenticated \
git \
default-jre \
wget \
curl \
ant \
zip \
unzip \
libarchive-zip-perl \
python3
# install Ceylon
cd /opt
wget https://downloads.ceylon-lang.org/cli/ceylon-${languageVersion}_${languageVersion}-${languageRelease}_all.deb
dpkg -i ceylon-${languageVersion}_${languageVersion}-${languageRelease}_all.deb
# build project
git clone https://github.com/$repoUser/$repoName
cd $repoName
git checkout $projectVersion
sed -i "/dist.root.dir=/ s =.*$ =/usr/share/ceylon/$languageVersion " build.properties
ant compile
cd ..
# strip nondeterminism
git clone https://github.com/lucaswerkmeister/strip-nondeterminism
cd strip-nondeterminism
for module in "${modules[@]}"; do
car="../$repoName/modules/${module//\.//}/$projectVersion/$module-$projectVersion.car"
perl -I lib -- bin/strip-nondeterminism -t car -T $timestamp "$car"
echo -n $(sha1sum "$car" | cut -f1 -d' ') > "$car".sha1
done
cd ..
# compare checksums
for module in "${modules[@]}"; do
echo
echo "$module"
cat "$repoName/modules/${module//\.//}/$projectVersion/$module-$projectVersion.car.sha1"; echo
curl "$repo/${module//\.//}/$projectVersion/$module-$projectVersion.car.sha1"; echo
done
exit 0
1.3.1
Changes from the previous version (1.3.0):
- Support for new language features:
- Nested imports are now supported.
See #129.
- Nested imports are now supported.
- Other changes:
- A new option,
--pipe
, has been added.
In pipe mode, the formatter reads from standard input
until end of file and then writes the formatted code
to standard output.--pipe
may be combined with other
file specifications, e. g.ceylon format foo.ceylon --pipe
,
which will format that file and then standard input.
The old behavior of implicit pipe mode if there are no
file specifications given is still supported, but deprecated;
the current plan is to make it emit a warning
to standard error in the next minor release,
and to completely remove it in the next major release.
Please explicitly specify--pipe
instead. /dev/stdin
and/dev/stdout
are now supported as file names.
This is actually a side effect of the above feature,
but is also declared a feature of its own
and intended to remain supported for a while.
Note that/dev/stdin
may only be used once.
- A new option,
The .car
file for this release has been made reproducible using a fork of Debian’s strip-nondeterminism
program. The following script, on a fresh Debian GNU/Linux system, should produce the exact same binary:
#!/bin/bash
version=1.3.1
project=ceylon.formatter
modules=(ceylon.formatter)
repo=https://modules.ceylon-lang.org/repo/1
timestamp=1479660000
# install dependencies
apt install --yes --allow-unauthenticated \
git \
default-jre \
wget \
curl \
ant \
zip \
unzip \
libarchive-zip-perl \
python3
# install Ceylon
cd /opt
wget https://downloads.ceylon-lang.org/cli/ceylon-1.3.1_1.3.1-1_all.deb
dpkg -i ceylon-1.3.1_1.3.1-1_all.deb
# build project
git clone https://github.com/ceylon/$project
cd $project
git checkout $version
sed -i 's ../ceylon/dist/dist /usr/share/ceylon/1.3.1/ ' build.properties
ant compile
cd ..
# strip nondeterminism
git clone https://github.com/lucaswerkmeister/strip-nondeterminism
cd strip-nondeterminism
for module in "${modules[@]}"; do
car="../$project/modules/${module//\.//}/$version/$module-$version.car"
perl -I lib -- bin/strip-nondeterminism -t car -T $timestamp "$car"
echo -n $(sha1sum "$car" | cut -f1 -d' ') > "$car".sha1
done
cd ..
# compare checksums
for module in "${modules[@]}"; do
echo
echo "$module"
cat "$project/modules/${module//\.//}/$version/$module-$version.car.sha1"; echo
curl "$repo/${module//\.//}/$version/$module-$version.car.sha1"; echo
done
exit 0
On other systems, adjust the first two command sections to use the correct package manager, and potentially the sed build.properties line to point to the correct Ceylon distribution directory.
Note that the build seems to depend on the Java version. On Debian Jessie, with Java 7, you get the file on Herd; on Debian Stretch, with Java 8, you get a different one, with the hash 48b9c5fec0c7cedc64da23bda9f001aa0c574265
. The only difference is that some entries in the META-INF/MANIFEST.MF
file are ordered differently.
1.3.0
Changes from the previous version (1.2.2):
- Code style changes:
- Resources in a resource list are now indented by one level.
- Import aliases are now considered when checking annotations against the
inlineAnnotations
option.
- Support for new language features:
- Repository types (aka namespaces).
- Other changes:
- Updates for plugin system changes.
- Build file changes.
- Test improvements.
- Bugfixes.
The .car
file for this release has been made reproducible using a fork of Debian’s strip-nondeterminism
program. The following script, on a fresh Debian GNU/Linux system, should produce the exact same binary:
#!/bin/bash
version=1.3.0
project=ceylon.formatter
modules=(ceylon.formatter)
repo=https://modules.ceylon-lang.org/repo/1
timestamp=1473950000
# install dependencies
apt install --yes --allow-unauthenticated \
git \
default-jre \
wget \
curl \
ant \
zip \
unzip \
libarchive-zip-perl \
python3
# install Ceylon
cd /opt
wget https://downloads.ceylon-lang.org/cli/ceylon-1.3.0_1.3.0_all.deb
dpkg -i ceylon-1.3.0_1.3.0_all.deb
# build project
git clone https://github.com/ceylon/$project
cd $project
git checkout $version
sed -i 's ../ceylon/dist/dist /usr/share/ceylon/1.3.0/ ' build.properties
ant compile
cd ..
# strip nondeterminism
git clone https://github.com/lucaswerkmeister/strip-nondeterminism
cd strip-nondeterminism
for module in "${modules[@]}"; do
car="../$project/modules/${module//\.//}/$version/$module-$version.car"
perl -I lib -- bin/strip-nondeterminism -t car -T $timestamp "$car"
echo -n $(sha1sum "$car" | cut -f1 -d' ') > "$car".sha1
done
cd ..
# compare checksums
for module in "${modules[@]}"; do
echo
echo "$module"
cat "$project/modules/${module//\.//}/$version/$module-$version.car.sha1"; echo
curl "$repo/${module//\.//}/$version/$module-$version.car.sha1"; echo
done
exit 0
On other systems, adjust the first two command sections to use the correct package manager, and potentially the sed build.properties
line to point to the correct Ceylon distribution directory.
1.2.2
Changes from the previous version (1.2.1):
- The copyright information in
ceylon format --version
now includes the correct year. - Build file changes.
The only reason to release version 1.2.2 is its use in the 1.2.2 IDE. If you use the CLI version, you can keep using ceylon.formatter 1.2.1.
The .car
file for this release has been made reproducible using a fork of Debian’s strip-nondeterminism
program. The following script, on a fresh Arch Linux system, should produce the exact same binary:
#!/bin/bash
version=1.2.2
project=ceylon.formatter
modules=(ceylon.formatter)
repo=https://modules.ceylon-lang.org/repo/1
timestamp=1457872000
# install dependencies
pacman -S --noconfirm \
git \
jdk8-openjdk \
wget \
curl \
apache-ant \
zip \
unzip \
perl-archive-zip \
python
# install Ceylon
cd /opt
wget https://downloads.ceylon-lang.org/cli/ceylon-$version.zip
unzip ceylon-$version.zip
export PATH="$PATH:/opt/ceylon-$version/bin"
# build project
git clone https://github.com/ceylon/$project
cd $project
git checkout $version
sed -i "s|../ceylon/dist/dist|/opt/ceylon-$version|" build.properties
ant compile
cd ..
# strip nondeterminism
git clone https://github.com/lucaswerkmeister/strip-nondeterminism
cd strip-nondeterminism/lib
for module in "${modules[@]}"; do
car="../../$project/modules/${module//\.//}/$version/$module-$version.car"
../bin/strip-nondeterminism -t car -T $timestamp "$car"
echo -n $(sha1sum "$car" | cut -f1 -d' ') > "$car".sha1
done
# compare checksums
for module in "${modules[@]}"; do
echo
echo "$module"
cat "../../$project/modules/${module//\.//}/$version/$module-$version.car.sha1"; echo
curl "$repo/${module//\.//}/$version/$module-$version.car.sha1"; echo
done
(This is almost certainly not specific to Arch Linux, but that’s where it was tested. On other systems, adjust the pacman -S
line to use the correct package manager, or remove it entirely if the packages are already installed.)
ceylon.formatter 1.2.1
Changes from the previous version (1.2.0):
-
Indentation is now much more flexible internally. To the user, this means that the formatter can now correctly indent
=
and=>
: Where it previously produced horrors such asshared actual Boolean equals(Object that) => if (is This that) then this.thing == that.thing else false; shared Float distance(Point p1, Point p2) => let (x1 = p1.x, y1 = p1.y, x2 = p2.x, y2 = p2.y) let (dx = (x2-x1).magnitude, dy = (y2-y1).magnitude) sqrt(dx^2 + dy^2);
it now instead produces
shared actual Boolean equals(Object that) => if (is This that) then this.thing == that.thing else false; shared Float distance(Point p1, Point p2) => let (x1 = p1.x, y1 = p1.y, x2 = p2.x, y2 = p2.y) let (dx = (x2 - x1).magnitude, dy = (y2 - y1).magnitude) sqrt(dx^2 + dy^2);
That is, the indentation both before and after a
=
and=>
stacks if, and only if, it was actually applied, that is, if there is a line break before or after the=
or=>
token. This also removes support for theindentationAfterSpecifierExpressionStart
option. See #105 and #37. -
If there is a line break after an inline annotation (option
inlineAnnotations
), it is now removed. Previously, the formatter would keep existing line breaks after such annotations. See #126.
The .car
file for this release has been made reproducible using a fork of Debian’s strip-nondeterminism
program.
The following script, on a fresh Arch Linux system, should produce the exact same binary:
#!/bin/sh
# install dependencies
pacman -S --noconfirm \
git \
jdk8-openjdk \
wget \
curl \
apache-ant \
zip \
unzip \
perl-archive-zip \
python
# install Ceylon
cd /opt
wget https://downloads.ceylon-lang.org/cli/ceylon-1.2.1.zip
unzip ceylon-1.2.1.zip
export PATH="$PATH:/opt/ceylon-1.2.1/bin"
# build formatter
git clone https://github.com/ceylon/ceylon.formatter
cd ceylon.formatter
sed -i '
/^ceylon\.root\.dir/ d
/^dist\.dir/ s|^.*$|dist.dir=/opt/ceylon-1.2.1|
' build.properties
ant compile
cd ..
# strip nondeterminism
git clone https://github.com/lucaswerkmeister/strip-nondeterminism
cd strip-nondeterminism/lib
car='../../ceylon.formatter/modules/ceylon/formatter/1.2.1/ceylon.formatter-1.2.1.car'
../bin/strip-nondeterminism -t car -T 1455136200 "$car"
echo -n $(sha1sum "$car" | cut -f1 -d' ') > "$car".sha1
# compare checksums
cat "$car".sha1; echo
curl https://modules.ceylon-lang.org/repo/1/ceylon/formatter/1.2.1/ceylon.formatter-1.2.1.car.sha1; echo
(This is almost certainly not specific to Arch Linux, but that’s where it was tested. On other systems, adjust the pacman -S
line to use the correct package manager, or remove it entirely if the packages are already installed.)
ceylon.formatter 1.2.0
Changes from the previous version (1.1.0):
- Support for new language features
- constructors
if
,switch
,object
, andlet
expressions- destructuring of tuples and entries
- type constructors
- spread types
- length-based tuple abbreviation (
T[3]
) else if
inswitch
statements- abbreviated syntax for references:
module
,class
etc. - declaring variables inside
switch
clauses - empty type argument lists
- negated
exists
andnonempty
conditions
- Code style changes:
-
Spacing around binary operators has been improved; within other operators, the spaces around some operators may be omitted, like here:
value v = w*h*d - iW*iH*iD;
This is controlled with the new configuration setting
spaceOptionalAroundOperatorLevel
. -
Spacing in type parameter and argument lists is now controlled by three options:
spaceAfterTypeParamListComma
(defaulttrue
),spaceAfterTypeArgListComma
(defaultfalse
), andspaceAroundTypeParamListEqualsSign
(defaultfalse
). The first two supersede the previous single optionspaceAfterTypeArgOrParamListComma
, which is still supported as a legacy option (setting both new options at once).This changes the default style from
void f<Param1 = Default1,Param2 = Default2>() {} f<Arg1, Arg2>();
to
void f<Param1=Default1, Param2=Default2>() {} f<Arg1,Arg2>();
In addition to this, line breaks are no longer allowed around a default type argument’s
=
, or before a type parameter or argument list,
. -
A single blank line between imports is now allowed, and a blank line between imports and declarations is enforced.
-
sealed
is now an inline annotation.
-
- Many Bugfixes; notable:
- support for the following language features was missing:
- annotations on setters
- use-site variance
maxLineLength
is now actually useful
- support for the following language features was missing:
--help=options
on the command line prints all options with their documentation
Initial release of ceylon.formatter
Command-line usage:
ceylon run ceylon.formatter source/
or, if you have the format
script installed (either from the Ceylon
distribution or after running ant install
):
ceylon format source/
You can also use ceylon.formatter programmatically, with the format
function (or using FormattingVisitor
directly). For a complete example
of this, see the ceylon.formatter IDE integration in the
ceylon/ceylon-ide-eclipse repository (FormatAction.java
).