naersk
naersk copied to clipboard
chore: formatted code and fixed lints
I took the liberty of formatting all the code with alejandra and resolving a few lint warnings that were thrown by statix.
This should make it a wee bit easier to contribute code to the repo.
While I'm not necessarily the number one fan of this particular formatting style (more of a nixpkgs-fmt guy myself), I think as long as we have something consistent, it's nice -- would it be possible to attach some formatting check into the pipeline as well, so that misformatted code can't be committed?
cc @nmattia, ofc.
Oh yeah, it should be pretty easy to add a format and lint check to the pipeline. I'll push a commit adding that in a little bit.
Oh, I had never heard of Alejandra! I don't have a strong opinion for one style or another, but since this is technically a nix-community project, might be less confusing to use nixpkgs-fmt? or is alejandra the accepted default formatter now?
would it be possible to attach some formatting check into the pipeline
would even go further and say: let's not format anything unless there are CI checks :)
since this is technically a nix-community project, might be less confusing to use nixpkgs-fmt?
That's a good point, I have no problem using nixpkgs-fmt here instead of alejandra if needed.
I just picked alejandra because that's been my goto default for a while now, so it was just force of habit :D
This discussion is what made me choose alejandra for my own projects in case you were interested in giving it a read.
would even go further and say: let's not format anything unless there are CI checks :)
Checks for formatting and linting? Or checks for functionality in general?
For formatting and linting we'd just need actions to run nix run nixpkgs#alejandra -- --check .
and nix run nixpkgs#statix check
.
For general checks, I'm gonna try to get our existing tests to pass over the weekend.
Also for the record, I don't have a preference between nixpkgs-fmt or alejandra, so I'm fine with whatever as long as the outputs are consistent. :D