This is the first release that supports the 0.14.0 compiler and its syntactical changes.
Overall, not much has changed. The new syntactic constructs are kind signatures and roles. Kind signatures are formatted like type signatures. Roles are are all on a single line for now.
This release will likely still work for most 0.13.x code. Though there's no explicit support for the 0.13.x series at the moment. The breaking changes are for some edge cases that it doesn't seem like many would run into, but they're breaking for a reason.
This is a small release with all internal-facing changes.
This is mostly updating dependencies and fixing some CI issues. There should be no behavioral change from the previous version.
- Fix AppVeyor image again
- Change formatting goals/non-goals to have links
- Update dependencies
- Update even more dependencies
This is a small release to address the formatting of nested conditionals.
This is a small release with internal project changes.
This is a bug fix release to address a long standing bug.
Trailing comments in a module have been formatted incorrectly since 4.0.0. It was largely tangled up in all trailing comments being formatted incorrectly since 4.0.0. We took some time to dig in further and found a way to address at least this one part.
Another small release. More internal project changes.
Another small release. This should all be internal project changes.
- Put version under
bazel
s control - Move more tests to bazel
- Remove platform handling in
make
- Fix
make package.json
rule
Another small release.
This should all be internal project changes related to using bazel
as the bulk of the build system.
This is a small release to fix an oddity of formatting.
This is a bugfix due to recent changes.
We were accidentally dropping code coverage information whenever purty
was run.
That should be taken care of, now.
This release is all internal project changes.
This release smooths out some rough edges.
First, we added a version
mode so you can know which version of purty
you're using.
It's pretty impressive tha we went this long without it, but it wasn't intentional.
In any case, by default it outputs a verbose, human-readable version information.
There is also a --numeric
flag if you need a more machine-friendly version.
Next, we added a validate
mode so you can check whether a file is formatted correctly.
This mode is useful for using purty
as a lint step.
We hope to expand this mode with more useful output (like a diff of what's unformatted).
Finally, we added a format
mode so you can format a file or directory.
This works exactly like using purty
without the format
mode.
I.e. purty foo
is exactly the same as purty format foo
.
Because these two new modes–validate
and version
–act as commands on the purty
binary, it's entirely possible that they might shadow existing files or directories that would have been formatted before.
E.g. if you had a directory named version
with PureScript files in it, it would no longer be formatted when you said purty version --write
.
To address this breaking change, we added a format
mode to bring back the ability to format any file or directory shadowed by a mode the purty
binary uses.
This even works if there's a file or directory named format
you'd like to format: purty format format
.
This is a smaller release. All of the changes here should be internal to the project.
- Switch from
stylish-haskell
toormolu
- Update
hlint
- Drop
path-io
in exchange forpathwalk
- Move language extensions to the files
- Clean up argument handling
- Validate with
ormolu
This is a big one! There are three important differences from previous verions of `purty:
-
Configuration files are no longer supported. The configuration never panned out how it was supposed to. It was never meant to be for altering formatting, but for configuring the CLI. It was also meant to be an example of using Dhall.
-
Binaries are statically linked. The binaries we were creating up until now have been dynamically linked. We were privvy to the same issues that the PureScript compiler runs into from time to time (runtime libraries not existing). We decide to link binaries statically, so we can mitigate runtime issues. We also can do more interesting things (like creating minimal Docker images) with statically linked binaries.
-
Directories are supported. If you've used
purty
on any non-trivial codebase, you've probably run into an issue with trying to format multiple files. Up until now, you've had to script your own way to run all of these files. Depending on how you runpurty
, this could be a slow and tedious process. Now we support formatting all.purs
recursively in a directory. This should make it easier to usepurty
in larger projects.
There were some other minor changes for dependencies in this release as well.
- Update
purescript
to 0.13.6 - Depend on exact
purescript
modules - Use minimal PureScript parser package
- Update
rio
- Compile static binaries
- Fix Bintray deploy on TravisCI
- Fix uploaded filename for Bintray deployment
There's been a process change. We're not accepting external merge requests for the time being.
This decision has been a long time coming, and it's almost entirely an internally motivated change. This long and short is that I'm burned out from open source work, and would like to try a different approach to developing this project. There's more details in the issue.
In other news, we've got a couple of small fixes to formatting.
We've started working on the emacs integration. So far, there's a elisp file that allows formatting on save. In the coming releases, we hope to make installing and using it easier.
We're not officially supporting the emacs integration, but we're starting work on it!
Mostly infrastructure changes. There should be no breaking changes or formatting changes in this version
A couple of formatting changes and a bit of documentation. The formatting changes should make the output a bit more compatible with compilers older than 0.13.0.
A bug fix for the formatting of unicode and escape characters.
A bug fix for the formatting of multi-line renamed imports.
A fix to the formatting of type annotations.
A fix to the formatting of parenthesized expressions.
Small change to display the file name when reporting errors.
Quick bug fix to get STDIN working over the npm interface.
Some cleanup to formatting. Thanks for all the feedback from the last big release.
We also add support for reading over STDIN.
If the binary is invoked with -
, it will read data over STDIN instead of expecting a file.
E.g. purty -
will read input over STDIN.
Hopefully, this is useful for other tools and integrations to use.
- Fix record indentation
- Cleanup the program runners
- Preserve span in application of expressions
- Insert spaces around all arrays and records
- Revert changes to conditional formatting
A quick bug fix for formatting string literals.
First release in a while. We've moved over to interactive formatting!
We're now based off of the 0.13.x version of the purescript
package.
That means we've got a parser that gives us as close to source code as possible.
Using the newer version, we can format a module much more carefully.
Interactive formatting is something that elm-format
does.
It's not clear if there's an official name for it.
It could also be called VonderHaar-style formatting (after the author of elm-format
).
The way it works is by taking hints from the structure of the file to direct the formatting.
If you have some syntactic construct that could be put on one line,
and there are no line breaks in the construct, purty
will format it on one line.
If you have some syntactic construct that could be put on one line,
and there is at least one line break in the construct,
purty
will format the entire construct as multiple lines.
The formatting does not reach beneath the construct but may reach above it.
For example:
foo = [[1, 2, 3], [4,
5, 6, 7]]
would be formatted as:
foo =
[ [1, 2, 3]
, [ 4
, 5
, 6
, 7
]
]
The array [1, 2, 3]
was formatted on a single line,
since it was initially all on one line.
The array [4, 5, 6, 7]
was formatted over multiple lines,
as it had at least one line break.
Finally, the overall array [[1, 2, 3], [4, 5, 6, 7]]
was formatted over multiple lines,
as it also had at least one line break.
The long and short of the changes here are that the control of formatting is given more to the author of the code. This should still keep with the idea of formatting that works nicely, but it should also give a bit of freedom to people to structure the code a little bit differently if need be.
Bear in mind, almost all of the code is re-written so it's likely to contain a new set of bugs. Please feel free to report any bugs you find.
- Update stack to 1.9.3
- Remove duplicate comments in most expressions
- Format multi-line guards better
- Retain comments at end of file
- Retail lines over infix values
- Retain comments in data declarations
- Fix file path handling
- Fix derived instance formatting
- Add some more tests
Re-publishing to npm. There was a problem with the previous version.
There shouldn't be any changes with purty
itself.
Internal code cleanup. There shouldn't be any changes with purty
itself.
Patch release with a bug fix.
Patch release with bug fixes.
Patch release with CI changes.
Squashing another boug from 3.0.0 changes.
This one was record puns not being formatted correctly. There were also some infrastructure changes.
- Automate more stuff in CI
- Re-add support for record literal puns in expressions
- Update release documentation
Those huge changes from 3.0.0 contained a few bugs :).
This is a quick patch release to address them. If there are more, please report them!
- Add missing npm file
- Fix printing of functions in parentheses
- Support bound value declarations
- Print top level comments
Huge changes to the internals. We've got our own AST! Now, we can format things a bit purty-er.
It's already made some things easier and removed some bugs with the formatting. It should make other formatting easier and also will make implementing interactive formatting much easier.
- Print nested lambdas with a single lambda expression
- Make a pretty print AST
- Remove extra newlines in let bindings
- Fix Trailing spaces in output
Internal changes to the code base. Feature-wise, everything should be the same.
Lots more bug fixes.
Thanks to everyone who reported them. Keep 'em coming!
- Fix Quoted key names unquoted incorrectly
- Fix List pattern matching in case statements breaks
- Fix Syntax error with
if
expression indo
- Fix Infix expressions can lose their back-ticks
Minor bug fix.
A fix for boolean literals.
Official release
It's finally here! The 1.0.0 release!
Let's talk about what 1.0.0 doesn't mean: purty
is now "done," purty
has now become "stable," purty
is now "production ready," purty
generates "nice looking code."
purty
will probably never be "done." A project like this is almost never "done." There will always be some improvement to make, a bug to fix, or a syntax to update. Just as languages continue to evolve, so do do styles of those languages.purty
will not be stable for quite some time. There are many new features in the future and most of these will alter the way modules are formatted.purty
has been "production ready" since about the 0.3.0 or 0.4.0 release. There are still bugs, there are still improvements to make for the formatting. But, runningpurty
should not "eat your code", change the semantics of a module, or break in an otherwise bad way.- Generating "nice looking code" is entirely subjective. There's probably a consensus around what most people would consider nice, but there's no way to put a stamp on things and say
purty
generates "nice looking code."
1.0.0 is only the beginning. purty
does enough now to be "useful." It's no longer a proof of concept, it's a useful tool. It will still have bugs, they will still get fixed. It will still have improvements.
This version also supports PureScript 0.12.0. It should be backwards compatible with PureScript 0.11.7, but there are no guarantees.
Tiny release
One small addition for configuration.
Small bug fixes
Not much happened in this release. There were a couple of bug fixes and a change to import sorting.
Char
s are not printed properly- Let bindings with type signatures print incorrectly
- Sort imported values in import lists
Configuration and customization
This release had only a few additions, but they were big!
The first allows selecting between dynamic and static printing. Dynamic printing is what most people think of when they think of a pretty printer. Static printing is similar to how gofmt
and similar tools work.
The second allows configuring purty
with a file instead of command line arguments. That should allow for more reproducability and ease of use in the future. We're using Dhall as the configuration language because it should make working with the file easier in the long run.
Bug fixes and small features
Most of what happened in this release were bug fixes after being used in a real project.
- Fix printing of open records
- Handle paths that contain
..
- Sort import declarations
- Print record puns when possible
Infrastructure changes
Most of this release was around making the infrastructure of creating purty
. We had a few features and fixes, but mostly infrastructure.
- Run stylish-haskell on CI
- Pretty print files in place
- Run hlint on CI
- Release
purty
as an NPM package
- Return non-zero exit code on parse errors
- Make acceptance tests easier to work with
- Run GitLab CI in one stage
- Remove unnecessary where clause in type class and instance declarations
- Fix Travis CI reporting to pipeline
- Report Travis CI starting on pipeline
Initial release
- Pretty prints PureScript modules
- Verbose mode prints debug logs
- Automatically creates Linux binary
- Automatically creates OSX binary
- Automatically creates Windows binary