Skip to content

Commit

Permalink
fix: checks and add bamg to precommit cmd
Browse files Browse the repository at this point in the history
  • Loading branch information
mike325 committed Nov 6, 2024
1 parent 94528f9 commit 0a8c8af
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lua/configs/commands.lua
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ end, { nargs = '?', complete = 'messages', desc = 'Populate quickfix with the :m
if executable 'pre-commit' then
nvim.command.set('PreCommit', function(opts)
RELOAD('mappings').precommit(opts)
end, { nargs = '*' })
end, { bang = true, nargs = '*' })
end

-- TODO: Add support to change between local and osc/remote open
Expand Down
6 changes: 5 additions & 1 deletion lua/mappings/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -448,8 +448,12 @@ end

function M.precommit(opts)
local args = opts.fargs
local cmd = 'pre-commit'
if opts.bang and #args == 0 then
args = { 'run', '--all' }
end
local precommit = RELOAD('jobs'):new {
cmd = 'pre-commit',
cmd = cmd,
args = args,
-- progress = true,
qf = {
Expand Down
1 change: 1 addition & 0 deletions lua/utils/marks.lua
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ function M.marks_to_quickfix(opts)
items = items,
title = 'Marks',
open = true,
win = opts.win,
}
end
end
Expand Down
2 changes: 1 addition & 1 deletion lua/utils/qf.lua
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ function M.dump_files(buffers, opts, win)

local items = {}
for _, buf in ipairs(buffers) do
local item = {}
local item
if type(buf) == type {} then
item = buf
item.lnum = item.lnum or 1
Expand Down

0 comments on commit 0a8c8af

Please sign in to comment.