mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-01-11 14:20:23 +01:00
feat(outputs): add pre-commit-hooks for spell checking, markdown linting, etc.
This commit is contained in:
8
.prettierignore
Normal file
8
.prettierignore
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
LICENSE.md
|
||||||
|
dist
|
||||||
|
pnpm-lock.yaml
|
||||||
|
flake.lock
|
||||||
|
vercel.json
|
||||||
|
cache
|
||||||
|
temp
|
||||||
|
.temp
|
||||||
5
.prettierrc.yaml
Normal file
5
.prettierrc.yaml
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
# https://prettier.io/docs/en/options
|
||||||
|
semi: false
|
||||||
|
singleQuote: false
|
||||||
|
printWidth: 80
|
||||||
|
trailingComma: es5
|
||||||
6
flake.lock
generated
6
flake.lock
generated
@@ -1356,11 +1356,11 @@
|
|||||||
"nixpkgs-stable": "nixpkgs-stable_5"
|
"nixpkgs-stable": "nixpkgs-stable_5"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1707297608,
|
"lastModified": 1708018599,
|
||||||
"narHash": "sha256-ADjo/5VySGlvtCW3qR+vdFF4xM9kJFlRDqcC9ZGI8EA=",
|
"narHash": "sha256-M+Ng6+SePmA8g06CmUZWi1AjG2tFBX9WCXElBHEKnyM=",
|
||||||
"owner": "cachix",
|
"owner": "cachix",
|
||||||
"repo": "pre-commit-hooks.nix",
|
"repo": "pre-commit-hooks.nix",
|
||||||
"rev": "0db2e67ee49910adfa13010e7f012149660af7f0",
|
"rev": "5df5a70ad7575f6601d91f0efec95dd9bc619431",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
mylib = import ../lib {inherit lib;};
|
mylib = import ../lib {inherit lib;};
|
||||||
myvars = import ../vars {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.
|
# so that I can use them in all my nixos/home-manager/darwin modules.
|
||||||
genSpecialArgs = system:
|
genSpecialArgs = system:
|
||||||
inputs
|
inputs
|
||||||
@@ -96,12 +96,20 @@ in {
|
|||||||
src = mylib.relativeToRoot ".";
|
src = mylib.relativeToRoot ".";
|
||||||
hooks = {
|
hooks = {
|
||||||
alejandra.enable = true; # formatter
|
alejandra.enable = true; # formatter
|
||||||
|
typos.enable = true; # Source code spell checker
|
||||||
|
prettier.enable = true;
|
||||||
# deadnix.enable = true; # detect unused variable bindings in `*.nix`
|
# deadnix.enable = true; # detect unused variable bindings in `*.nix`
|
||||||
# statix.enable = true; # lints and suggestions for Nix code(auto suggestions)
|
# statix.enable = true; # lints and suggestions for Nix code(auto suggestions)
|
||||||
# prettier = {
|
};
|
||||||
# enable = true;
|
settings = {
|
||||||
# excludes = [".js" ".md" ".ts"];
|
typos = {
|
||||||
# };
|
write = true; # Automatically fix typos
|
||||||
|
ignored-words = [];
|
||||||
|
};
|
||||||
|
prettier = {
|
||||||
|
write = true; # Automatically format files
|
||||||
|
configPath = "./.prettierrc.yaml";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -118,6 +126,14 @@ in {
|
|||||||
bashInteractive
|
bashInteractive
|
||||||
# fix `cc` replaced by clang, which causes nvim-treesitter compilation error
|
# fix `cc` replaced by clang, which causes nvim-treesitter compilation error
|
||||||
gcc
|
gcc
|
||||||
|
# Nix-related
|
||||||
|
alejandra
|
||||||
|
deadnix
|
||||||
|
statix
|
||||||
|
# spell checker
|
||||||
|
typos
|
||||||
|
# code formatter
|
||||||
|
nodePackages.prettier
|
||||||
];
|
];
|
||||||
name = "dots";
|
name = "dots";
|
||||||
shellHook = ''
|
shellHook = ''
|
||||||
|
|||||||
Reference in New Issue
Block a user