Skip to content

Commit a1336ad

Browse files
committed
fix: remove ambiguous noSentenceCase config
1 parent 0ce6735 commit a1336ad

File tree

3 files changed

+1
-10
lines changed

3 files changed

+1
-10
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,6 @@ require("tinygit").setup {
146146
insert = { confirm = "<C-CR>" },
147147
},
148148
subject = {
149-
noSentenceCase = false,
150149
enforceType = false,
151150
-- stylua: ignore
152151
types = {

lua/tinygit/commands/commit/msg-input.lua

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,6 @@ local function setupKeymaps(confirmationCallback)
5151
-- TITLE
5252
local commitTitle = vim.trim(vim.api.nvim_buf_get_lines(bufnr, 0, 1, false)[1])
5353
:gsub("%.$", "") -- no trailing dot https://commitlint.js.org/reference/rules.html#body-full-stop
54-
if conf.subject.noSentenceCase and conf.subject.enforceType then
55-
commitTitle = commitTitle
56-
:gsub("^(%w+: )(.)", function(c1, c2) return c1 .. c2:lower() end) -- no scope
57-
:gsub("^(%w+%b(): )(.)", function(c1, c2) return c1 .. c2:lower() end) -- with scope
58-
elseif conf.subject.noSentenceCase and not conf.subject.enforceType then
59-
commitTitle = commitTitle:gsub("^%w", string.lower)
60-
end
6154
if #commitTitle > MAX_TITLE_LEN then
6255
warn("Title is too long.")
6356
return

lua/tinygit/config.lua

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@ local defaultConfig = {
3434
insert = { confirm = "<C-CR>" },
3535
},
3636
subject = {
37-
noSentenceCase = false,
38-
enforceType = false,
37+
enforceType = false, -- disallow commits that do not use an allowed type
3938
-- stylua: ignore
4039
types = {
4140
"fix", "feat", "chore", "docs", "refactor", "build", "test",

0 commit comments

Comments
 (0)