refactor: move actions from alejandra>nixpkgs-fmt

This commit is contained in:
Swarsel 2024-07-20 00:09:57 +02:00
parent 23cfb96adb
commit 2a08576697
Signed by: swarsel
GPG key ID: 26A54C31F2A4FD84
2 changed files with 4 additions and 4 deletions

View file

@ -19,4 +19,4 @@ jobs:
- name: Check for lints in .nix files - name: Check for lints in .nix files
run: nix run nixpkgs#statix -- check run: nix run nixpkgs#statix -- check
- name: Check formatting in .nix files - name: Check formatting in .nix files
run: git ls-files '*.nix' | xargs nix run nixpkgs#alejandra -- --check run: git ls-files '*.nix' | xargs nix run nixpkgs#nixpkgs-fmt -- --check

View file

@ -7572,10 +7572,10 @@ This section handles everything that shoudld happen when I save =SwarselSystems.
We set a hook that runs everytime we save the file. It would be a bit more efficient to only export and format when we enter a magit window for instance (since especially the html export takes times), however, since I cannot be sure to only ever commit from magit (I do indeed sometimes use git from the command line), I prefer this approach. We set a hook that runs everytime we save the file. It would be a bit more efficient to only export and format when we enter a magit window for instance (since especially the html export takes times), however, since I cannot be sure to only ever commit from magit (I do indeed sometimes use git from the command line), I prefer this approach.
#+begin_src emacs-lisp #+begin_src emacs-lisp
(defun run-alejandra () (defun swarsel/run-formatting ()
(interactive) (interactive)
(let ((default-directory (expand-file-name "~/.dotfiles"))) (let ((default-directory (expand-file-name "~/.dotfiles")))
(shell-command "alejandra . -q"))) (shell-command "nixpkgs-fmt . > /dev/null")))
(defun swarsel/org-babel-tangle-config () (defun swarsel/org-babel-tangle-config ()
(when (string-equal (buffer-file-name) (when (string-equal (buffer-file-name)
@ -7584,7 +7584,7 @@ We set a hook that runs everytime we save the file. It would be a bit more effic
(let ((org-confirm-babel-evaluate nil)) (let ((org-confirm-babel-evaluate nil))
(org-html-export-to-html) (org-html-export-to-html)
(org-babel-tangle) (org-babel-tangle)
(run-alejandra)))) (swarsel/run-formatting))))
(setq org-html-htmlize-output-type nil) (setq org-html-htmlize-output-type nil)