From d6e77b62b497a0454682ff7c4a2e464af0f5ddad Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Fri, 27 Sep 2024 14:09:07 +0000 Subject: [PATCH 1/3] project: add typos configuration --- .typos.toml | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .typos.toml diff --git a/.typos.toml b/.typos.toml new file mode 100644 index 0000000..2f82d13 --- /dev/null +++ b/.typos.toml @@ -0,0 +1,7 @@ +[default] +extend-ignore-re = [ + # spellchecker:disable-line + "(?Rm)^.*(#|//|--)\\s*spellchecker:disable-line$", + # spellchecker: + "(?s)(#|//|--)\\s*spellchecker:off.*?\\n\\s*(#|//|--)\\s*spellchecker:on", +] From e08f3e5b2ea36d45edc30f0dc26c01bcb50ff9f5 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Fri, 27 Sep 2024 14:10:02 +0000 Subject: [PATCH 2/3] treewide: add 'typos' ignore directives --- modules/home/vim/after/plugin/mappings/unimpaired.lua | 4 ++-- modules/home/wm/i3/default.nix | 3 +-- modules/home/wm/i3bar/default.nix | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/modules/home/vim/after/plugin/mappings/unimpaired.lua b/modules/home/vim/after/plugin/mappings/unimpaired.lua index 82aab05..6716a82 100644 --- a/modules/home/vim/after/plugin/mappings/unimpaired.lua +++ b/modules/home/vim/after/plugin/mappings/unimpaired.lua @@ -109,13 +109,13 @@ local keys = { { "yoc", desc = "Cursor line" }, { "yod", desc = "Diff" }, { "yof", "FormatToggle", desc = "LSP Formatting" }, - { "yoh", desc = "Search high-lighting" }, + { "yoh", desc = "Search high-lighting" }, -- spellchecker:disable-line { "yoi", desc = "Case insensitive search" }, { "yol", desc = "List mode" }, { "yon", desc = "Line numbers" }, { "yop", "(qf_loc_toggle)", desc = "Location list" }, { "yoq", "(qf_qf_toggle)", desc = "Quickfix list" }, - { "yor", desc = "Relative line numbers" }, + { "yor", desc = "Relative line numbers" }, -- spellchecker:disable-line { "you", desc = "Cursor column" }, { "yov", desc = "Virtual editing" }, { "yow", desc = "Text wrapping" }, diff --git a/modules/home/wm/i3/default.nix b/modules/home/wm/i3/default.nix index 69246f0..1c2b8e9 100644 --- a/modules/home/wm/i3/default.nix +++ b/modules/home/wm/i3/default.nix @@ -12,8 +12,7 @@ let movementKeys = [ "Left" "Down" "Up" "Right" ]; vimMovementKeys = [ "h" "j" "k" "l" ]; shutdownMode = - "(l)ock, (e)xit, switch_(u)ser, (h)ibernate, (r)eboot, (Shift+s)hutdown"; - + "(l)ock, (e)xit, switch_(u)ser, (h)ibernate, (r)eboot, (Shift+s)hutdown"; # spellchecker:disable-line # Takes an attrset of bindings for movement keys, transforms it to Vim keys toVimKeyBindings = let diff --git a/modules/home/wm/i3bar/default.nix b/modules/home/wm/i3bar/default.nix index 5ae0e7d..2080704 100644 --- a/modules/home/wm/i3bar/default.nix +++ b/modules/home/wm/i3bar/default.nix @@ -49,7 +49,7 @@ in }) (lib.optionalAttrs config.my.home.bluetooth.enable { block = "bluetooth"; - mac = "F7:78:BA:76:52:F7"; + mac = "F7:78:BA:76:52:F7"; # spellchecker:disable-line format = " $icon MX Ergo{ $percentage|} "; disconnected_format = ""; }) From db89917840014e51c2c048c96e8e4afe25e9cf1b Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Fri, 27 Sep 2024 14:10:24 +0000 Subject: [PATCH 3/3] flake: checks: enable 'typos' --- flake/checks.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/flake/checks.nix b/flake/checks.nix index 98e49bd..1684ca1 100644 --- a/flake/checks.nix +++ b/flake/checks.nix @@ -26,6 +26,10 @@ stylua = { enable = true; }; + + typos = { + enable = true; + }; }; }; };