Releases: kamadorueda/alejandra
3.1.0
Added
- Thank you messages for the different people
who have helped improving Alejandra. - Pre-commit hooks with no prerequisites and instructions on how to update the pre-commit hooks.
- A meta.mainProgram to our
flake.nix
. - Refreshed docs (updated moved links, integrations instructions, maintainer instructions).
Changed
- The pre-commit option
alejandra
was renamed toalejandra-nix
. - Upgraded dependencies to its latest version.
- Blank lines are no longer added after comments in
inherit
.
Fixed
- A syntax error in one of the pre-commit hooks.
Pull Requests
- refactor: remove old asciinema by @kamadorueda in #347
- fix: Avoid syntax error by @l0b0 in #355
- Fix #354 by @tobiasBora in #358
- feat: add two new contributors by @kamadorueda in #359
- feat: upgrade dependencies by @kamadorueda in #362
- feat: pre-commit hook with no prerequisites by @l0b0 in #371
- Add ALE to list of neovim plugins by @n8henrie in #374
- Make test failures more informative by @9999years in #378
- Don't add blank lines after comments in
inherit
by @9999years in #379 - Improve tests by @piegamesde in #384
- update dependencies by @kamadorueda in #391
- add thanks to contributors by @kamadorueda in #392
- Remove URL literal in inputs by @UserSv4 in #397
- flake: add meta.mainProgram by @ConnorBaker in #400
- Update instructions for Doom Emacs by @theutz in #413
- README: update link to current wiki. by @Mic92 in #414
- Update NixOS Wiki link by @nixos-wiki in #416
- feat: release 3.1.0 by @kamadorueda in #420
New Contributors
- @l0b0 made their first contribution in #355
- @tobiasBora made their first contribution in #358
- @n8henrie made their first contribution in #374
- @9999years made their first contribution in #378
- @piegamesde made their first contribution in #384
- @UserSv4 made their first contribution in #397
- @theutz made their first contribution in #413
- @nixos-wiki made their first contribution in #416
Full Changelog: 3.0.0...3.1.0
3.0.0
Added
-
Different levels of --quiet by repeating the
-q
flag,
which makes Vim users have a better formatting experience by using:%!alejandra -qq
to format the current buffer,
specially when the file has syntax errors. -
The possibility for companies to promote their business
by placing an add at the end of Alejandra's terminal output, and thank you messages for the sponsors of the project.You can obtain this benefits in @kamadorueda's sponsor page.
-
Thank you messages for the different people
who have helped improving Alejandra.
Changed
- Now big files are formatted first,
making faster the formatting process
when using many threads and
when formatting a big file is slower
than formatting all the other smaller files in the repository.
For instance in Nixpkgs. - The CLI was simplified,
removing the elements that people find less useful
and polishing those that people use the most.
The screen is not cleared anymore. - Upgraded dependencies to its latest version.
Fixed
- The name displayed in the CLI application used to be
alejandra_cli
,
now it isAlejandra
. - Typos here and there.
Pull Requests
- feat: release 2.0.0 by @kamadorueda in #328
- feat: upgrade front dependencies by @kamadorueda in #330
- refactor: apply formatter by @kamadorueda in #332
- docs: update benchmarks by @kamadorueda in #333
- fix: name in the cli by @kamadorueda in #334
- perf: format big files first by @kamadorueda in #335
- feat: minimalist cli by @kamadorueda in #336
- feat: add some random ads at the end by @kamadorueda in #337
- refactor: rename changed to formatted by @kamadorueda in #338
- docs: update timings after last perf improvement by @kamadorueda in #339
- feat: put ads in stderr and respect --quiet by @kamadorueda in #340
- typo by @mkenigs in #342
- feat: more levels of --quiet by @kamadorueda in #341
- feat: sponsor benefits by @kamadorueda in #343
- feat: thank sponsors by @kamadorueda in #345
New Contributors
Full Changelog: 2.0.0...3.0.0
2.0.0
Added
-
A Style Guide,
explaining why certain decisions were taken
and why they are optimal
from a productive Nix hacker point of view.This guide is a work in progress,
but the aim is that it eventually documents
all of the aspects of the Nix language,
so that we all have the peace of mind
that comes from knowing that the style in Alejandra
is the way it is for a reason. -
Integration guides for: Neovim and GNU Emacs.
-
Published Alejandra as a crate,
and added API documentation
so other tools and integrations can be built in top of it.
Changed
-
Now running:
$ alejandra -
formats stdin,
as POSIX
suggests. -
Comments are now indented by a multiple of 2
issues/294:Previously
(notice how some lines are indented with 3 and 5 spaces):/* Bla bla bla. More bla: - Bla bla - Bla */ 123
Now (all lines are indented to 2 and 4 spaces):
/* Bla bla bla. More bla: - Bla bla - Bla */ 123
This makes it easier to write comments on major code editors,
where a<TAB>
(or<Shift>+<Tab>
)
moves the cursor/content to the next multiple of 2,
and so indenting the comment contents
to an odd number of spaces (like 3, 5, 7)
is uncomfortable and unproductive.This change also allows cooperation
with other tools
like EditorConfig,
to further exercise good practices over a codebase. -
Updated dependencies to its latest version.
Fixed
- Empty lines in comments are now effectively empty,
avoiding git from warning about extra whitespace:
issues/314.
Pull Requests
- feat: release 1.5.0 by @kamadorueda in #304
- docs: add neovim integration by @kamadorueda in #305
- feat: simplify nix stable installation by @kamadorueda in #307
- feat: rename alejandra_engine to alejandra by @kamadorueda in #308
- docs: null-ls for neovim by @kamadorueda in #309
- docs: emacs integration by @kamadorueda in #311
- docs: use proper capitalization by @kamadorueda in #312
- docs: add style guide by @kamadorueda in #313
- Use clap-derive by @Sciencentistguy in #315
- refactor: use more rustfmt rules by @kamadorueda in #316
- feat: respect - for stdin by @kamadorueda in #317
- docs: update changelog by @kamadorueda in #318
- docs: style guide of functions with destructuring by @kamadorueda in #319
- docs: link style guide in the readme by @kamadorueda in #320
- docs: add a contributing file [skip ci] by @kamadorueda in #321
- docs: add a code of conduct [skip ci] by @kamadorueda in #322
- docs: link discussions [skip ci] by @kamadorueda in #323
- feat: conform comments to editorconfig with
indent_size = 2
by @blaggacao in #324 - feat: document crate by @kamadorueda in #325
- docs: update changelog [skip ci] by @kamadorueda in #326
- feat: update dependencies by @kamadorueda in #327
New Contributors
- @Sciencentistguy made their first contribution in #315
Full Changelog: 1.5.0...2.0.0
1.5.0
What's Changed
- docs: add pre-commit-hooks.nix example by @loicreynier in #296
- docs: publishing extension to open-vsx by @kamadorueda in #299
- docs: simplify readme by @kamadorueda in #300
- feat: update dependencies by @kamadorueda in #301
- feat: update dependencies by @kamadorueda in #303
Full Changelog: 1.4.0...1.5.0
1.4.0
Added
- A pre-commit hook (requires Alejandra to be installed in the host).
What's Changed
- feat: add an overlay by @kamadorueda in #287
- feat: add system pre-commit hook by @loicreynier in #289
- feat: document hook by @kamadorueda in #290
Full Changelog: 1.3.0...1.4.0
1.3.0
Added
- A pre-commit hook (requires Nix to be installed in the host).
Changed
- Updated dependencies to its latest version.
What's Changed
- feat: add licenses metadata by @kamadorueda in #278
- refactor: rm authors from help by @kamadorueda in #279
- feat: add pre-commit hook (without altering repo structure) by @loicreynier in #281
- docs: add pre-commit example by @kamadorueda in #282
- feat: more robust pre-commit hook by @kamadorueda in #283
- feat: push build deps to cachix by @kamadorueda in #284
- feat: release 1.3.0 by @kamadorueda in #285
New Contributors
- @loicreynier made their first contribution in #281
Full Changelog: 1.2.0...1.3.0
1.2.0
Added
- A new i686-linux system to the flake.
apps.${system}.default
to the Flake
so that newer versions of Nix
understand this instead ofdefaultApp.${system}
.
Fixed
- A typo in the documentation where
aarch64-linux
appeared twice
andaarch64-darwin
didn't.
Security
- New CVEs were discovered in the third party dependencies of our website:
https://kamadorueda.github.io/alejandra/
and so we updated those front-end dependencies to their latest version.
What's Changed
- README: fix aarch64-linux appearing twice by @ConnorBaker in #261
- Supply an i686-linux package by @rehno-lindeque in #262
- Kamadorueda by @kamadorueda in #264
- build(deps): bump node-forge from 1.2.1 to 1.3.0 in /front by @dependabot in #265
- build(deps): bump minimist from 1.2.5 to 1.2.6 in /integrations/vscode by @dependabot in #266
- build(deps): bump minimist from 1.2.5 to 1.2.6 in /front by @dependabot in #267
- feat: update front dependencies by @kamadorueda in #268
- feat: update vscode deps by @kamadorueda in #269
- feat: update alejandra dependencies by @kamadorueda in #270
- feat: --check no longer modifies files in-place by @kamadorueda in #272
New Contributors
- @Mic92 made their first contribution in #256
- @ConnorBaker made their first contribution in #261
- @rehno-lindeque made their first contribution in #262
- @dependabot made their first contribution in #265
Full Changelog: 1.1.0...1.2.0
1.1.0
Added
- Emacs integration instructions.
- A
--quiet
flag to the CLI which hide output details,
disable the TUI
and only print error messages.
Changed
- Updated dependencies to its latest version.
Pull requests
- fix: plural conditions by @kamadorueda in #254
- feat: quiet mode by @kamadorueda in #255
- README: add doom-emacs integration by @Mic92 in #256
New Contributors
Full Changelog: 1.0.0...1.1.0
1.0.0
Added
- NixOS installation instructions
Changed
-
The indentation for function applications was improved,
so that indentation is now correct to the human eye in all cases:- name2 = function arg { - asdf = 1; - } - argument; + name2 = + function arg { + asdf = 1; + } + argument;
-
String interpolations (
"${something}"
)
now follow the same logic as parentheses ((something)
),
since ultimately, they are the same family of elements. -
Parentheses handling logic was rewritten
and by extension string interpolations as well.- ( - self: super: { - # ... - } - ) + (self: super: { + # ... + })
- builtins.map ( - pkg: { - name = "alejandra-${pkg.stdenv.targetPlatform.config}"; - value = pkg; - } - ) + builtins.map (pkg: { + name = "alejandra-${pkg.stdenv.targetPlatform.config}"; + value = pkg; + })
- ( - fenix.combine [ - fenix.latest.rustc - fenix.latest.toolchain - fenix.targets."wasm32-unknown-unknown".latest.rust-std - ] - ) + (fenix.combine [ + fenix.latest.rustc + fenix.latest.toolchain + fenix.targets."wasm32-unknown-unknown".latest.rust-std + ])
pkgs.writeText "other-modules.json" (l.toJSON - (l.mapAttrs - (pname: subOutputs: let - pkg = subOutputs.packages."${pname}".overrideAttrs (old: { - buildScript = "true"; - installMethod = "copy"; - }); - in "${pkg}/lib/node_modules/${pname}/node_modules") - outputs.subPackages)) + (l.mapAttrs + (pname: subOutputs: + let + pkg = subOutputs.packages."${pname}".overrideAttrs (old: { + buildScript = "true"; + installMethod = "copy"; + }); + in + "${pkg}/lib/node_modules/${pname}/node_modules") + outputs.subPackages))
- (with a; - /* - comment - */ - with b; - with c; { - a = 1; - b = 2; - }) + (with a; + /* + comment + */ + with b; + with c; { + a = 1; + b = 2; + })
In some cases it's possible to insert a newline after the
opening element (either(
or${
) to force a tall formatting.
Removed
- A few internal position counters, nothing visible from the outside.
- The new features cost a little of runtime speed,
but anyway we are still pretty fast. ⚡
What's Changed
- feat: even more simplification by @kamadorueda in #231
- perf: no need for pos_new by @kamadorueda in #233
- feat: try parentheses heuristics by @kamadorueda in #234
- perf: split children rewrittes by @kamadorueda in #235
- feat: add rustc to dev shell by @kamadorueda in #236
- feat: improve parentheses handling by @kamadorueda in #237
- test: add more apply cases by @kamadorueda in #238
- feat: better apply indentation by @kamadorueda in #239
- docs: document nixos installation by @kamadorueda in #243
- refactor: reuse parens on string interpol by @kamadorueda in #244
- feat: allow choosing loose parens by @kamadorueda in #245
Full Changelog: 0.7.0...1.0.0
0.7.0
Added
- Inline comments support in binary operators:
- ++ - # subsections go last + ++ # subsections go last
- Inline comments support in
with
andassert
expressions:- assert (libXft != null) -> libpng != null; - # probably a bug - assert stdenv.isDarwin -> libXaw != null; - # fails to link otherwise + assert (libXft != null) -> libpng != null; # probably a bug + + assert stdenv.isDarwin -> libXaw != null; # fails to link otherwise +
- Inline comments support for
if-then-else
expressions:if y ? ${a} - then v x.${a} y.${a} - # both have attr, use merge func - else x.${a} - # only x has attr + then v x.${a} y.${a} # both have attr, use merge func + else x.${a} # only x has attr
- Inline comments support for
inherit
expressions:inherit (callPackage ../development/tools/ocaml/ocamlformat {}) - ocamlformat - # latest version + ocamlformat # latest version ocamlformat_0_11_0
- Inline comments support for
parenthesis
expressions:- || ( - # Accept {} for tests that are unsupported + || ( # Accept {} for tests that are unsupported isDerivation x && x ? meta.timeout );
Changed
-
Linux binaries now use mimalloc
to provide much better performance when formatting Nixpkgs:-
x86_64-unknown-linux-gnu, 1.3x faster,
from 0m10.639s to 0m8.381s -
x86_64-unknown-linux-musl, 15.8x faster,
from 2m32.686s to 0m9.642s -
On QEMU aarch64-unknown-linux-musl,
4.6x faster,
from 5m26s to 1m10s -
On QEMU armv6l-unknown-linux-musleabihf,
1.05x faster,
from 8m7s to 7m41s -
On QEMU armv7l-unknown-linux-musleabihf,
1.15x faster,
from 5m54s to 5m7s -
On QEMU i686-unknown-linux-musl,
1.07x faster,
from 2m44s to 2m33s
-
-
After profiling the code as suggested by
nnethercote's perf-book
one critical path of Alejandra was identified an optimized,
yielding huge performance boosts:-
x86_64-unknown-linux-gnu, 2.5x faster,
from 0m8.381s to 0m3.410s -
x86_64-unknown-linux-musl, 2.3x faster,
from 0m9.642s to 0m4.134s -
On QEMU aarch64-unknown-linux-musl,
2.4x faster,
from 1m10s to 0m29s -
On QEMU armv6l-unknown-linux-musleabihf,
1.85x faster,
from 7m41s to 4m8.399s -
On QEMU armv7l-unknown-linux-musleabihf,
1.88x faster,
from 5m7s to 2m42.595s -
On QEMU i686-unknown-linux-musl,
1.65x faster,
from 2m33s to 1m32.671s
In general this is an algorithmic improvement
and therefore the following platforms should be faster as well
by a similar ratio
(not measured):- aarch64-apple-darwin
- x86_64-apple-darwin
-
-
A
--threads
flag, so you can pick how many formatting threads to spawn.
Defaults to the number of logical CPUs in your system. -
Position counters were improved to offer an extra 1.13x speedup.
What's Changed
- refactor: remove unnecessary code by @kamadorueda in #204
- refactor: simplify code by @kamadorueda in #205
- refactor: mark as pub(crate) by @kamadorueda in #206
- refactor: remove unnecessary code by @kamadorueda in #207
- perf: use mimalloc by @kamadorueda in #208
- docs: simplify installation by @kamadorueda in #209
- docs: add nixpkgs installation method by @kamadorueda in #210
- perf: lazy position by @kamadorueda in #211
- feat: --threads flag by @kamadorueda in #213
- refactor: split apply by @kamadorueda in #214
- refactor: split assert or with by @kamadorueda in #215
- refactor: apply by @kamadorueda in #216
- refactor: if else by @kamadorueda in #217
- perf: O(n) update of position by @kamadorueda in #218
- refactor: solve clippy warnings by @kamadorueda in #219
- refactor: bin-op by @kamadorueda in #220
- feat: support more inline comments by @kamadorueda in #223
- feat: support more inline comments by @kamadorueda in #224
- feat: support inline comments in if-else by @kamadorueda in #225
- feat: inline comments on inherit by @kamadorueda in #226
- feat: support inline comments on parens by @kamadorueda in #227
- feat: simplify parens by @kamadorueda in #228
- feat: simplify parens by @kamadorueda in #229
Full Changelog: 0.6.0...0.7.0