fixed ruff formatter

This commit is contained in:
Belal Elsabbagh
2025-05-14 15:21:33 +03:00
parent f7e10dcac9
commit 4a30f4e705

View File

@@ -44,6 +44,33 @@ return {
stdin = true, stdin = true,
args = { 'format', '--stdin-file-path', '$FILENAME' }, args = { 'format', '--stdin-file-path', '$FILENAME' },
}, },
---@type conform.FileFormatterConfig
ruff = {
meta = {
url = 'https://docs.astral.sh/ruff/',
description = 'An extremely fast Python linter, written in Rust. Formatter subcommand.',
},
command = 'ruff',
args = {
'format',
'--force-exclude',
'--stdin-filename',
'$FILENAME',
'-',
},
range_args = function(self, ctx)
return {
'format',
'--force-exclude',
'--range',
string.format('%d:%d-%d:%d', ctx.range.start[1], ctx.range.start[2] + 1, ctx.range['end'][1], ctx.range['end'][2] + 1),
'--stdin-filename',
'$FILENAME',
'-',
}
end,
stdin = true,
},
intelephense = { intelephense = {
command = 'intelephense', command = 'intelephense',
args = {}, args = {},