mirror of
https://github.com/NixOS/nix
synced 2025-06-25 06:31:14 +02:00
Merge pull request #11438 from zimbatm/nix-fmt-pwd
fix(nix fmt): remove the default "." argument
This commit is contained in:
commit
c60e1be62c
4 changed files with 28 additions and 13 deletions
|
@ -5,11 +5,11 @@ source common.sh
|
|||
TODO_NixOS # Provide a `shell` variable. Try not to `export` it, perhaps.
|
||||
|
||||
clearStoreIfPossible
|
||||
rm -rf $TEST_HOME/.cache $TEST_HOME/.config $TEST_HOME/.local
|
||||
rm -rf "$TEST_HOME"/.cache "$TEST_HOME"/.config "$TEST_HOME"/.local
|
||||
|
||||
cp ./simple.nix ./simple.builder.sh ./fmt.simple.sh ./config.nix $TEST_HOME
|
||||
cp ./simple.nix ./simple.builder.sh ./fmt.simple.sh ./config.nix "$TEST_HOME"
|
||||
|
||||
cd $TEST_HOME
|
||||
cd "$TEST_HOME"
|
||||
|
||||
nix fmt --help | grep "Format"
|
||||
|
||||
|
@ -30,6 +30,9 @@ cat << EOF > flake.nix
|
|||
};
|
||||
}
|
||||
EOF
|
||||
nix fmt ./file ./folder | grep 'Formatting: ./file ./folder'
|
||||
# No arguments check
|
||||
[[ "$(nix fmt)" = "Formatting(0):" ]]
|
||||
# Argument forwarding check
|
||||
nix fmt ./file ./folder | grep 'Formatting(2): ./file ./folder'
|
||||
nix flake check
|
||||
nix flake show | grep -P "package 'formatter'"
|
||||
|
|
|
@ -1 +1,2 @@
|
|||
echo Formatting: "${@}"
|
||||
#!/usr/bin/env bash
|
||||
echo "Formatting(${#}):" "${@}"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue