代码拉取完成,页面将自动刷新
{
description = "A Nix-flake-based Python development environment";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/release-23.11";
flake-utils.url = "github:numtide/flake-utils";
pre-commit-hooks.url = "github:cachix/pre-commit-hooks.nix";
};
outputs = {
self,
nixpkgs,
flake-utils,
pre-commit-hooks,
}:
flake-utils.lib.eachDefaultSystem (system: let
pkgs = import nixpkgs {inherit system;};
in {
checks = {
pre-commit-check = pre-commit-hooks.lib.${system}.run {
src = ./.;
hooks = {
typos.enable = true; # Source code spell checker
prettier.enable = true; # Markdown & TS formatter
};
settings = {
typos = {
write = true; # Automatically fix typos
configPath = "./.typos.toml";
};
prettier = {
write = true; # Automatically format files
configPath = "./.prettierrc.yaml";
};
};
};
};
devShells.default = pkgs.mkShell {
packages = with pkgs; [
# spell checker
typos
# code formatter
nodePackages.prettier
];
shellHook = ''
${self.checks.${system}.pre-commit-check.shellHook}
'';
};
});
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。