Skip to content

Commit

Permalink
fix(ruff_format): add explicit range format args #638
Browse files Browse the repository at this point in the history
  • Loading branch information
stevearc committed Feb 13, 2025
1 parent c309423 commit 59088eb
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions lua/conform/formatters/ruff_format.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,23 @@ return {
"$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,
cwd = require("conform.util").root_file({
"pyproject.toml",
Expand Down

0 comments on commit 59088eb

Please sign in to comment.