local nvim_lint = require 'lint'

vim.keymap.set('n', '<Leader>l', ':lua require(\'lint\').try_lint()<CR>', { noremap = true, unique = true })

nvim_lint.linters_by_ft = {
  c          = { 'clangtidy' },
  dockerfile = { 'hadolint' },
  fish       = { 'fish' },
  go         = { 'revive' },
  haskell    = { 'hlint' },
  javascript = { 'eslint_d' },
  lua        = { 'luacheck' },
  markdown   = { 'vale' },
  sh         = { 'shellcheck' },
  typescript = { 'eslint_d' },
  yaml       = { 'yamllint' },
}

vim.api.nvim_create_autocmd({ "BufWritePost" }, {
  pattern  = "*/.github/workflows/*.y{a,}ml",
  callback = function()
    local linter = require('lint').linters.actionlint
    linter.name  = 'actionlint'
    require("lint").lint(linter)
  end,
})
