Skip to content

Releases: kamadorueda/alejandra

4.0.0

10 Apr 22:34

Choose a tag to compare

Added

  • (experimental) Configurable indentation (two spaces, four spaces and tabs).
  • Pipe operators (a |> b and a <| b) are now supported.
  • Doc comments (/** */) are handled more graciously.

Changed

  • Upgraded dependencies to its latest version.

Pull Requests

New Contributors

Full Changelog: 3.1.0...4.0.0

3.1.0

04 Nov 03:00

Choose a tag to compare

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 to alejandra-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

New Contributors

Full Changelog: 3.0.0...3.1.0

3.0.0

15 Aug 19:40

Choose a tag to compare

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 is Alejandra.
  • Typos here and there.

Pull Requests

New Contributors

Full Changelog: 2.0.0...3.0.0

2.0.0

14 Jul 05:30
142f048

Choose a tag to compare

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

New Contributors

Full Changelog: 1.5.0...2.0.0

1.5.0

22 Jun 22:23
2627a96

Choose a tag to compare

What's Changed

Full Changelog: 1.4.0...1.5.0

1.4.0

19 May 15:30
96deb34

Choose a tag to compare

Added

  • A pre-commit hook (requires Alejandra to be installed in the host).

What's Changed

Full Changelog: 1.3.0...1.4.0

1.3.0

13 May 19:55

Choose a tag to compare

Added

  • A pre-commit hook (requires Nix to be installed in the host).

Changed

  • Updated dependencies to its latest version.

What's Changed

New Contributors

Full Changelog: 1.2.0...1.3.0

1.2.0

05 Apr 20:46
d34bf2f

Choose a tag to compare

Added

  • A new i686-linux system to the flake.
  • apps.${system}.default to the Flake
    so that newer versions of Nix
    understand this instead of defaultApp.${system}.

Fixed

  • A typo in the documentation where aarch64-linux appeared twice
    and aarch64-darwin didn't.

Security

What's Changed

New Contributors

Full Changelog: 1.1.0...1.2.0

1.1.0

10 Mar 18:50

Choose a tag to compare

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

New Contributors

Full Changelog: 1.0.0...1.1.0

1.0.0

04 Mar 02:38

Choose a tag to compare

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

Full Changelog: 0.7.0...1.0.0