-
Notifications
You must be signed in to change notification settings - Fork 176
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add support for yew-fmt (#398)
* feat: add support for yew-fmt Should close #314 :) * refactor: copy rustfmt to yew-fmt * fix: use correct default_edition * refactor: extract Cargo.toml parsing into utility function * refactor: yew-fmt doesn't rely directly on rustfmt definition --------- Co-authored-by: Steven Arcangeli <[email protected]>
- Loading branch information
Showing
5 changed files
with
42 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
local util = require("conform.util") | ||
|
||
---@type conform.FileFormatterConfig | ||
return { | ||
meta = { | ||
url = "https://github.com/schvv31n/yew-fmt", | ||
description = "Code formatter for the Yew framework.", | ||
}, | ||
command = "yew-fmt", | ||
options = { | ||
-- The default edition of Rust to use when no Cargo.toml file is found | ||
default_edition = "2021", | ||
}, | ||
args = function(self, ctx) | ||
local args = { "--emit=stdout" } | ||
local edition = util.parse_rust_edition(ctx.dirname) or self.options.default_edition | ||
table.insert(args, "--edition=" .. edition) | ||
|
||
return args | ||
end, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters