alejandra icon indicating copy to clipboard operation
alejandra copied to clipboard

The Uncompromising Nix Code Formatter

Results 68 alejandra issues
Sort by recently updated
recently updated
newest added

### Expected ```nix { /** Convert a boolean to a "yes" or "no" string. Commonly useful in program configuration files. Type: boolToOnOffString :: boolean -> string */ boolToOnOffString = value:...

```nix { # why is the formatting like this for concatenated values: test = { foo = "foo"; } // { bar = "bar"; }; test2 = '' foo ''...

Alejandra 3.0.0 input: ```nix { buildersBySubsystem.${cfg.subsystem}.default = import (../../../../.. + "/src/subsystems/${cfg.subsystem}/builders/${cfg.builder}/default.nix") { inherit lib pkgs utils; dlib = {}; }; } ``` output: ```nix { buildersBySubsystem.${cfg.subsystem}.default = import (../../../../.. +...

alejandra: 3.0.0 input: ```nix let loadField = field: val: # This commend is indented incorrectly if field == val then "foo" else "bar"; in loadField ``` output: ```nix let loadField...

When there are multiple nested anonymous functions, some of which have comment before argument, the arguments without a comment are collapsed, which looks weird: https://kamadorueda.com/alejandra/?before=pkgs%3A%0A%0A%23+Overlay+to+be+passed+as+packageOverrides+to+Nixpkgs%E2%80%99s+generic+PHP+builder%3A%0A%0Afinal%3A%0Aprev%3A%0A%0Alet%0A++foo+%3D+5%3B%0Ain%0Afoo Noticed in https://github.com/fossar/nix-phps/pull/190#discussion_r1070282362

```nix { outputs = { utils }: # For each supported platform, utils.lib.eachDefaultSystem (system: {}); } ``` gets turned into the following, with comment not aligned with what it is...

This evals correctly using nix, `test.nix`: ``` nix { pkgs }: { a = ''TRACKERSE+=$(echo $url | ${pkgs.gnused}/bin/sed 's/ /%20/g;s/!/%21/g;s/"/%22/g;s/#/%23/g;s/\$/%24/g;s/\&/%26/g;s/'\''\''/%27/g;s/(/%28/g;s/)/%29/g;s/\//%2F/g;s/:/%3A/g')''; } ``` but alejandra chokes on it: ``` $ nix...

Running alejandra on this file ```nix {python = pkgs.python3.withPackages (ps: [rmt-utilities] ++ (with ps; [bunch codecov coverage docutils flake8 ipython matplotlib numpydoc sphinx-copybutton sphinx_rtd_theme sphinx-autoapi sphinx-argparse sphinx twine versioneer]));} ```...

```diff - xdgUserDirsProjects = - "${config.home.homeDirectory}/${config.lib.local.xdgUserDirsProjectsRel}"; + xdgUserDirsProjects = "${config.home.homeDirectory}/${config.lib.local.xdgUserDirsProjectsRel}"; ``` The formatted line is too long, but without a more complicated expression, I can’t break it. Alejandra is happy...

When writing inlined inherit statements, I find that alejandra makes them look worse than required. This is may well be controlled by rules not specific to `inherit`, and may read...