build: add pre-commit hooks

This commit is contained in:
winston 2023-02-10 09:03:25 +01:00
parent dbf1331abb
commit 8f4f64aa70
Signed by: winston
GPG key ID: 3786770EDBC2B481
9 changed files with 32 additions and 10 deletions

4
.gitignore vendored
View file

@ -1,3 +1,7 @@
# secrets
.gitsecret/keys/random_seed .gitsecret/keys/random_seed
!*.secret !*.secret
modules/secrets.nix modules/secrets.nix
# Generated by nix-pre-commit-hooks
/.pre-commit-config.yaml

14
default.nix Normal file
View file

@ -0,0 +1,14 @@
let
nix-pre-commit-hooks =
import (builtins.fetchTarball
"https://github.com/cachix/pre-commit-hooks.nix/tarball/master");
in {
pre-commit-check = nix-pre-commit-hooks.run {
src = ./.;
hooks = {
alejandra.enable = true;
shellcheck.enable = true;
stylua.enable = true;
};
};
}

View file

@ -1,5 +1,7 @@
local present, colorizer = pcall(require, "colorizer") local present, colorizer = pcall(require, "colorizer")
if not present then return end if not present then
return
end
colorizer.setup({ colorizer.setup({
user_default_options = { user_default_options = {

View file

@ -1,5 +1,7 @@
local present, indent_blankline = pcall(require, "indent_blankline") local present, indent_blankline = pcall(require, "indent_blankline")
if not present then return end if not present then
return
end
indent_blankline.setup({ indent_blankline.setup({
space_char_blankline = " ", space_char_blankline = " ",

View file

@ -28,6 +28,10 @@ local feedkey = function(key, mode)
) )
end end
vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, {
border = "double",
})
cmp.setup({ cmp.setup({
snippet = { snippet = {
expand = function(args) expand = function(args)

View file

@ -13,7 +13,6 @@
"cmp-vsnip": { "branch": "main", "commit": "989a8a73c44e926199bfd05fa7a516d51f2d2752" }, "cmp-vsnip": { "branch": "main", "commit": "989a8a73c44e926199bfd05fa7a516d51f2d2752" },
"copilot.lua": { "branch": "master", "commit": "a54e7b11a2c6efc9ddd3f42e56cf7d9eed1a9683" }, "copilot.lua": { "branch": "master", "commit": "a54e7b11a2c6efc9ddd3f42e56cf7d9eed1a9683" },
"dressing.nvim": { "branch": "master", "commit": "db716a0f1279f79a886c0e0b6ab3c3d5ffdb42fe" }, "dressing.nvim": { "branch": "master", "commit": "db716a0f1279f79a886c0e0b6ab3c3d5ffdb42fe" },
"easypick.nvim": { "branch": "main", "commit": "3f6af7b34eca30b81a8090ea6e5aa56212f8e746" },
"editorconfig.nvim": { "branch": "master", "commit": "5b9e303e1d6f7abfe616ce4cc8d3fffc554790bf" }, "editorconfig.nvim": { "branch": "master", "commit": "5b9e303e1d6f7abfe616ce4cc8d3fffc554790bf" },
"feline.nvim": { "branch": "master", "commit": "d48b6f92c6ccdd6654c956f437be49ea160b5b0c" }, "feline.nvim": { "branch": "master", "commit": "d48b6f92c6ccdd6654c956f437be49ea160b5b0c" },
"fidget.nvim": { "branch": "main", "commit": "9dc6d15fdb877b2fb09ea0ba2dfde9beccb5965a" }, "fidget.nvim": { "branch": "main", "commit": "9dc6d15fdb877b2fb09ea0ba2dfde9beccb5965a" },
@ -42,6 +41,7 @@
"nvim-ts-autotag": { "branch": "main", "commit": "fdefe46c6807441460f11f11a167a2baf8e4534b" }, "nvim-ts-autotag": { "branch": "main", "commit": "fdefe46c6807441460f11f11a167a2baf8e4534b" },
"nvim-ts-rainbow": { "branch": "master", "commit": "ef95c15a935f97c65a80e48e12fe72d49aacf9b9" }, "nvim-ts-rainbow": { "branch": "master", "commit": "ef95c15a935f97c65a80e48e12fe72d49aacf9b9" },
"nvim-web-devicons": { "branch": "master", "commit": "ade34ca7d19543904b28b903e606be8930fb9ee3" }, "nvim-web-devicons": { "branch": "master", "commit": "ade34ca7d19543904b28b903e606be8930fb9ee3" },
"octo.nvim": { "branch": "master", "commit": "7900dc0cd37e7bb5d4175a37c9c4c3dfb94a1f7b" },
"playground": { "branch": "master", "commit": "c481c660fa903a0e295902b1765ecfbd6e76a556" }, "playground": { "branch": "master", "commit": "c481c660fa903a0e295902b1765ecfbd6e76a556" },
"plenary.nvim": { "branch": "master", "commit": "9a0d3bf7b832818c042aaf30f692b081ddd58bd9" }, "plenary.nvim": { "branch": "master", "commit": "9a0d3bf7b832818c042aaf30f692b081ddd58bd9" },
"presence.nvim": { "branch": "main", "commit": "87c857a56b7703f976d3a5ef15967d80508df6e6" }, "presence.nvim": { "branch": "main", "commit": "87c857a56b7703f976d3a5ef15967d80508df6e6" },

View file

@ -1,7 +0,0 @@
column_width = 80
line_endings = "Unix"
indent_type = "Spaces"
indent_width = 2
quote_style = "AutoPreferDouble"
collapse_simple_statement = "Never"
call_parentheses = "Always"

View file

@ -7,4 +7,7 @@ in
git-secret git-secret
just just
]; ];
shellHook = ''
${(import ./default.nix).pre-commit-check.shellHook}
'';
} }