Skip to content

Commit

Permalink
refactor: move actions from alejandra>nixpkgs-fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
Swarsel committed Jul 19, 2024
1 parent 23cfb96 commit 2a08576
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/flake-checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ jobs:
- name: Check for lints in .nix files
run: nix run nixpkgs#statix -- check
- 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
6 changes: 3 additions & 3 deletions SwarselSystems.org
Original file line number Diff line number Diff line change
Expand Up @@ -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.

#+begin_src emacs-lisp
(defun run-alejandra ()
(defun swarsel/run-formatting ()
(interactive)
(let ((default-directory (expand-file-name "~/.dotfiles")))
(shell-command "alejandra . -q")))
(shell-command "nixpkgs-fmt . > /dev/null")))

(defun swarsel/org-babel-tangle-config ()
(when (string-equal (buffer-file-name)
Expand All @@ -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))
(org-html-export-to-html)
(org-babel-tangle)
(run-alejandra))))
(swarsel/run-formatting))))

(setq org-html-htmlize-output-type nil)

Expand Down

0 comments on commit 2a08576

Please sign in to comment.