Skip to content

zprint-filter-1.0.2

Choose a tag to compare

@kkinnear kkinnear released this 09 Nov 22:24
· 206 commits to master since this release

Several very useful features here -- note particularly the "in-place" formatting (using -w), subsuming most of what lein zprint does, and that all line endings are now fully supported.

Added

  • A new swtich for the uberjar and pre-built binaries: -w and --write. This performs in-place formatting, reading the file, formatting it, and re-writing it in place. It will work for one file or a set of file. For instance: $ zprint -w *.clj will format all of the .clj files in the current directory. If any of the files have errors, the contents of that file are left unchanged, an error is written to stderr, and the exit-status is set to 1. This runs faster (possibly much faster) than lein zprint, and does essentially the same thing. Issue #159.

  • A new style: :dark-color-map, which sets both the :color-map and the :uneval {:color-map ...} to new colors which may not be your favorites, but are at least visible with a dark terminal theme.

  • You can now change the things considered "constant" for constant-pairing. If you configure a one argument function as the value of :constant-pair-fn, it will be called with something to determine if it is a "constant", and therefore should be paired up. In this way, you can alter the pairing behavior of constant-pairing. Issue #56.

  • A new style, :moustache, which adds vectors to the elements to be paired by constant-pairing for the function app. Issue #56.

Fixed

  • If a file doesn't format correctly (perhaps because of a malformed ;!zprint directive), the file is unchanged, the error is sent to stderr, and the exit-status is 1. Issue #160.

  • All standard line endings (e.g., \n \r\n and \r) are now fully supported in all aspects of zprint. The line ending is determined by what zprint sees in the first 2000 characters of the string or file. Issue #150.