Skip to content

Commit

Permalink
feat: add support for pyproject-fmt (#629)
Browse files Browse the repository at this point in the history
  • Loading branch information
mehalter authored Jan 24, 2025
1 parent f8d743c commit a7c7e8f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,7 @@ You can view this list in vim with `:help conform-formatters`
- [puppet-lint](https://github.com/puppetlabs/puppet-lint) - Check that your Puppet manifests conform to the style guide.
- [purs-tidy](https://github.com/natefaubion/purescript-tidy) - A syntax tidy-upper for PureScript.
- [pyink](https://github.com/google/pyink) - A Python formatter, forked from Black with a few different formatting behaviors.
- [pyproject-fmt](https://github.com/tox-dev/toml-fmt/tree/main/pyproject-fmt) - Apply a consistent format to your pyproject.toml file with comment support.
- [python-ly](https://github.com/frescobaldi/python-ly) - A Python package and commandline tool to manipulate LilyPond files.
- [reorder-python-imports](https://github.com/asottile/reorder-python-imports) - Rewrites source to reorder python imports
- [rescript-format](https://rescript-lang.org/) - The built-in ReScript formatter.
Expand Down
16 changes: 16 additions & 0 deletions lua/conform/formatters/pyproject-fmt.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
local util = require("conform.util")
---@type conform.FileFormatterConfig
return {
meta = {
url = "https://github.com/tox-dev/toml-fmt/tree/main/pyproject-fmt",
description = "Apply a consistent format to your pyproject.toml file with comment support.",
},
command = "pyproject-fmt",
args = {
"-",
},
cwd = util.root_file({
"pyproject.toml",
}),
exit_codes = { 0, 1 }, -- 1 error code used when formatting is successful and if there are errors
}

0 comments on commit a7c7e8f

Please sign in to comment.