mason-bridge
automatically registers linters and formatters installed using
mason.nvim
in conform.nvim
and nvim-lint
.
- Automatically generates the
formatters_by_ft
andlinters_by_ft
tables to be used in their respective plugins - Provides and override in case the tool name and linter name mismatch e.g. snyk and
snyk_iac
- neovim
>= 0.7.0
mason.nvim
conform.nvim
nvim-lint
use {
"williamboman/mason.nvim",
"frostplexx/mason-bridge.nvim",
"stevearc/conform.nvim",
"mfussenegger/nvim-lint"
}
{
"williamboman/mason.nvim",
"frostplexx/mason-bridge.nvim",
"stevearc/conform.nvim",
"mfussenegger/nvim-lint"
}
It's important that you set up the plugins in the following order:
mason.nvim
mason-bridge
conform.nvim
and/ornvim-lint
(this order doesnt matter)
Pay extra attention to this if you lazy-load plugins, or somehow "chain" the loading of plugins via your plugin manager.
require("mason").setup()
require("mason-bridge").setup()
-- After setting up mason-bridge you may set up conform.nvim and nvim-lint
require("conform").setup({
formatters_by_ft = require("mason-bridge").get_formatters(),
})
require("lint").linters_by_ft = require("mason-bridge").get_linters()
-- ...
Refer to the Configuration section for information about which settings are available.
You may optionally configure certain behavior of mason-bridge.nvim
when calling the .setup()
function. Refer to
the default configuration for a list of all available settings.
Example:
require("mason-bridge").setup({
overrides = {
linters = {
javascript = { "snyk_iac" },
docker = { "snyk_iac" }
},
formatters = {
my_language = {"formatter_1", "formatter_2"}
}
}
})
local DEFAULT_SETTINGS = {
-- A table of filetypes with the respective tool (or tools) to be used
overrides = {
formatters = {},
linters = {}
}
}
- Add a handler system similar to
mason-lspconfig.nvim
andmason-nvim-dap.nvim
- Testing if the all filetypes are detected correctly is required
- Add vim help file