File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 77## Formatters
88
99- ` lsp ` using ` vim.lsp.buf.format `
10+ - [x] [ alejandra] ( https://github.com/kamadorueda/alejandra )
1011- [x] [ autopep8] ( https://github.com/hhatto/autopep8 )
1112- [x] [ black] ( https://github.com/psf/black )
1213- [x] [ biome] ( https://biomejs.dev )
Original file line number Diff line number Diff line change @@ -6,6 +6,12 @@ M.lsp = {
66 end ,
77}
88
9+ M .alejandra = {
10+ cmd = ' alejandra' ,
11+ args = { ' --quiet' },
12+ stdin = true ,
13+ }
14+
915M .autopep8 = {
1016 cmd = ' autopep8' ,
1117 args = { ' -' },
Original file line number Diff line number Diff line change 1+ describe (' alejandra' , function ()
2+ it (' can format' , function ()
3+ -- pre-test setup
4+ local ft = require (' guard.filetype' )
5+ ft (' nix' ):fmt (' alejandra' )
6+ -- Giving example input to the helper
7+ -- the helper creates a new buffer with it, formats, and returns the formatted output
8+ local formatted = require (' test.formatter.helper' ).test_with (' nix' , {
9+ -- The input code should somewhat reflect the filetype
10+ [[ {inputs={nixpkgs.url="github:NixOS/nixpkgs/nixos-unstable";};}]]
11+ })
12+ -- Show that the input is indeed formatted as intended
13+ assert .are .same ({
14+ [[ {inputs = {nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";};}]]
15+ }, formatted )
16+ end )
17+ end )
Original file line number Diff line number Diff line change @@ -18,6 +18,11 @@ bin="$HOME/.local/bin"
1818gh=" https://github.com"
1919mkdir -p $bin
2020
21+ # alejandra
22+ wget -q $gh " /kamadorueda/alejandra/releases/download/4.0.0/alejandra-x86_64-unknown-linux-musl"
23+ mv ./alejandra-x86_64-unknown-linux-musl $bin /alejandra
24+ chmod +x $bin /alejandra
25+
2126# cbfmt
2227wget -q $gh " /lukas-reineke/cbfmt/releases/download/v0.2.0/cbfmt_linux-x86_64_v0.2.0.tar.gz"
2328tar -xvf cbfmt_linux-x86_64_v0.2.0.tar.gz
You can’t perform that action at this time.
0 commit comments