-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
Description
Describe the bug
Currently the python testing driver runs this check on each test script
nixpkgs/nixos/lib/testing-python.nix
Line 38 in 85f3d86
| black --check --diff ${testDriverScript} |
And this is great because it ensures a good code style within the testing scripts.
But unfortunately it isn't as straightforward as this, I can think of couple cases already where this can cause headaches for people
- generated testing scripts/injected
I wrote
, preTestScript ? ""
recently and it can error out on the final testing script, but that is already abstracted by this function so it doesn't really matter. I had to make special measure to try to appease black.
- nix store paths/nix values
We used nix to keep line width manageable in this test
nixpkgs/nixos/tests/gnome3.nix
Line 28 in 85f3d86
# Keep line widths somewhat managable
but if I were to port this to python I'd need to format the code like
machine.wait_until_succeeds(
"su - alice -c '${startingUp} | grep -q true,..false'"
)
because those values get interpolated and then became really long.
Same if you use a nix store path attribute anywhere, it'll likely error out on the line being too long.
Solutions
We need to relax a lot of black's settings.
@adisbladis pasted these, as to what they're using personally:
- http://dpaste.com/1MPTRKR
- http://dpaste.com/2TW6V8N
And for sure relax string literal lengths to be larger, because of the reasons I mentioned.