Skip to content

Commit

Permalink
feat(outputs): add pre-commit-hooks for spell checking, markdown lint…
Browse files Browse the repository at this point in the history
…ing, etc.
  • Loading branch information
ryan4yin committed Mar 16, 2024
1 parent 9d4b8ef commit 1e38f7b
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 8 deletions.
8 changes: 8 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
LICENSE.md
dist
pnpm-lock.yaml
flake.lock
vercel.json
cache
temp
.temp
5 changes: 5 additions & 0 deletions .prettierrc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# https://prettier.io/docs/en/options
semi: false
singleQuote: false
printWidth: 80
trailingComma: es5
6 changes: 3 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 21 additions & 5 deletions outputs/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
mylib = import ../lib {inherit lib;};
myvars = import ../vars {inherit lib;};

# Add my custom lib, vars, nixpkgs instance, and all the inputs to sepcialArgs,
# Add my custom lib, vars, nixpkgs instance, and all the inputs to specialArgs,
# so that I can use them in all my nixos/home-manager/darwin modules.
genSpecialArgs = system:
inputs
Expand Down Expand Up @@ -96,12 +96,20 @@ in {
src = mylib.relativeToRoot ".";
hooks = {
alejandra.enable = true; # formatter
typos.enable = true; # Source code spell checker
prettier.enable = true;
# deadnix.enable = true; # detect unused variable bindings in `*.nix`
# statix.enable = true; # lints and suggestions for Nix code(auto suggestions)
# prettier = {
# enable = true;
# excludes = [".js" ".md" ".ts"];
# };
};
settings = {
typos = {
write = true; # Automatically fix typos
ignored-words = [];
};
prettier = {
write = true; # Automatically format files
configPath = "./.prettierrc.yaml";
};
};
};
}
Expand All @@ -118,6 +126,14 @@ in {
bashInteractive
# fix `cc` replaced by clang, which causes nvim-treesitter compilation error
gcc
# Nix-related
alejandra
deadnix
statix
# spell checker
typos
# code formatter
nodePackages.prettier
];
name = "dots";
shellHook = ''
Expand Down

0 comments on commit 1e38f7b

Please sign in to comment.