Skip to content

ref!: major refactor #150

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 56 commits into from
Jul 21, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
4d39989
chore(doc): auto generate docs
github-actions[bot] Jun 6, 2024
40a5d00
chore: shuffle all autocmd functions into the event module
xiaoshihou514 Jun 6, 2024
f19c4fd
chore: remove deprecated methods
xiaoshihou514 Jun 6, 2024
7399998
doc: add example of how to write custom formatting logic
xiaoshihou514 Jun 6, 2024
c9b9488
doc: promote advanced.md in README
xiaoshihou514 Jun 6, 2024
1b0d339
fix: typo
xiaoshihou514 Jun 6, 2024
8ad2cd4
chore: less verbose alias
xiaoshihou514 Jun 7, 2024
e0b7039
wip: basic outlinen of do_fmt
xiaoshihou514 Jun 7, 2024
d373d6d
wip: formatting module
xiaoshihou514 Jun 8, 2024
3cf35c1
fix: "async" execution using coroutines
xiaoshihou514 Jun 10, 2024
547149c
chore: remove version checks
xiaoshihou514 Jun 10, 2024
c35b0e1
feat: formatting module working correctly
xiaoshihou514 Jun 11, 2024
5be58dd
fix: autocmd test
xiaoshihou514 Jun 11, 2024
df79ed6
wip: mess with changedtick
xiaoshihou514 Jun 11, 2024
c96d016
fix: incorrect changedtick
xiaoshihou514 Jun 11, 2024
651d53b
chore: more rigorous error handling
xiaoshihou514 Jun 11, 2024
0a8e6b2
wip: lsp formatting
xiaoshihou514 Jun 12, 2024
ab5b673
fix: potential race condition
xiaoshihou514 Jun 12, 2024
4ec630e
fix: lint module
xiaoshihou514 Jun 12, 2024
248e533
feat: enhancements for linter module
xiaoshihou514 Jun 13, 2024
7950c42
doc: add nice looking demos :)
xiaoshihou514 Jun 13, 2024
434dc80
doc: formatting
xiaoshihou514 Jun 13, 2024
341b579
fix: save view
xiaoshihou514 Jun 13, 2024
b149d11
fix: remove deepcopies
xiaoshihou514 Jun 13, 2024
639ef8e
fix: tbl_filter and exepath
xiaoshihou514 Jun 13, 2024
527696e
chore: use custom table copy
xiaoshihou514 Jun 16, 2024
19a96d7
fix: existing tests
xiaoshihou514 Jun 17, 2024
3c1caff
test: toolcopy
xiaoshihou514 Jun 17, 2024
59c4527
chore: apply changes
xiaoshihou514 Jun 17, 2024
b3e42b0
doc: advanced linter customization
xiaoshihou514 Jun 17, 2024
6f6fe0f
Merge branch 'ref-api' of github.com:xiaoshihou514/guard.nvim into re…
xiaoshihou514 Jun 17, 2024
79bd3fa
fix: link
xiaoshihou514 Jun 17, 2024
8b496bf
fix: emoji
xiaoshihou514 Jun 17, 2024
e41c0e2
doc: fix missing line
xiaoshihou514 Jun 18, 2024
59c3977
chore: add types
xiaoshihou514 Jun 19, 2024
d425c0a
fix: types
xiaoshihou514 Jun 19, 2024
4e8f7d6
fix: use fnamemodify
xiaoshihou514 Jun 19, 2024
b3fa4c7
chore: refine code
xiaoshihou514 Jun 26, 2024
fb98efd
fix: lsp warning
xiaoshihou514 Jul 1, 2024
2fde1a6
chore: add executable check for linters
xiaoshihou514 Jul 2, 2024
7e2b579
chore: check executable in setup instead
xiaoshihou514 Jul 2, 2024
3bb6227
chore: remove redundant bufid check
xiaoshihou514 Jul 2, 2024
5f01630
fix: typo
xiaoshihou514 Jul 3, 2024
b322cfc
feat: more elegant checking and corresponding tests
xiaoshihou514 Jul 3, 2024
b2b900d
chore: rename due to namespace conflict
xiaoshihou514 Jul 3, 2024
eec417e
chore: ensure non nil
xiaoshihou514 Jul 3, 2024
475d970
chore: consistent executable checks
xiaoshihou514 Jul 3, 2024
3b79f3a
fix: incorrect copy and paste
xiaoshihou514 Jul 3, 2024
da9d6e2
chore: use vim.iter more
xiaoshihou514 Jul 3, 2024
9ae2f34
test: test for multiple formatters
xiaoshihou514 Jul 3, 2024
1835101
chore: ignore patterns should support single string
xiaoshihou514 Jul 3, 2024
939f6f4
feat: exepath patch for windows
xiaoshihou514 Jul 7, 2024
b051387
fix: exe check warning msg
xiaoshihou514 Jul 7, 2024
e377b9a
fix: update plugin/guard.lua
xiaoshihou514 Jul 10, 2024
787dac2
feat: tests for commands
xiaoshihou514 Jul 12, 2024
d31e457
fix: lsp attach autocmd
xiaoshihou514 Jul 15, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: incorrect copy and paste
  • Loading branch information
xiaoshihou514 committed Jul 3, 2024
commit 3b79f3aa59567f5f8c8b7ebbf4027a05af524699
2 changes: 1 addition & 1 deletion lua/guard/events.lua
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ end

local debounce_timer = nil
function M.register_lint(ft, events)
iter(require('guard.filetype')[ft].formatter):any(function(config)
iter(require('guard.filetype')[ft].linter):any(function(config)
if config.cmd and vim.fn.executable(config.cmd) ~= 1 then
error(config.cmd .. ' not executable', 1)
end
Expand Down
2 changes: 1 addition & 1 deletion lua/guard/format.lua
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ local function do_fmt(buf)
end, fmt_configs)

-- check if all cmds executable again, since user can call format manually
iter(require('guard.filetype')[filetype].formatter):any(function(config)
iter(fmt_configs):any(function(config)
if config.cmd and vim.fn.executable(config.cmd) ~= 1 then
error(config.cmd .. ' not executable', 1)
end
Expand Down
11 changes: 9 additions & 2 deletions test/filetype_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,15 @@ describe('filetype module', function()
same({ '-l', '-L', '1' }, ft.c.linter[1].args)
end)

it('can detect non executable cmd', function()
it('can detect non executable formatters', function()
local c = ft('c')
assert(not pcall(c.fmt, { cmd = 'hjkl' }))
c:fmt({ cmd = 'hjkl' })
assert(not pcall(require('guard').setup))
end)

it('can detect non executable linters', function()
local c = ft('c')
c:lint({ cmd = 'hjkl' })
assert(not pcall(require('guard').setup))
end)
end)