Skip to content

Ability to configure declaratively with table values #11

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

Closed
mrjones2014 opened this issue Jul 17, 2023 · 4 comments · Fixed by #163
Closed

Ability to configure declaratively with table values #11

mrjones2014 opened this issue Jul 17, 2023 · 4 comments · Fixed by #163

Comments

@mrjones2014
Copy link

Would you be open to the ability to configure all the formatters and linters via setup()? It could be done like this:

require('guard').setup({
  ft = {
    go = {
      fmt = {
        { cmd = 'gofmt', stdin = true },
      },
    },
    py = {
      lint = { 'pylint' }
    },
  },
})

This would allow for a declarative configuration using lazy.nvim's opts = {} option.

@glepnir
Copy link
Member

glepnir commented Jul 17, 2023

This is the way I used it initially. but when you write multiple languages this way very ugly compare with chain call...

@mrjones2014
Copy link
Author

The chain call DSL is an imperative configuration though, I like to try to keep everything as much as possible declarative.

Would you be open to supporting both mechanisms of configuration?

@glepnir
Copy link
Member

glepnir commented Jul 17, 2023

Just write a parser. convert the data in the ft table to filetype module . not difficult . would you like to open a pr for this or wait me in weekend.

@mrjones2014
Copy link
Author

I can open a PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants