Skip to content

Commit

Permalink
feat: add pretty-php (#161)
Browse files Browse the repository at this point in the history
  • Loading branch information
fbuchlak authored Oct 27, 2023
1 parent 278bcd8 commit 4653408
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ You can view this list in vim with `:help conform-formatters`
- [pint](https://github.com/laravel/pint) - Laravel Pint is an opinionated PHP code style fixer for minimalists.
- [prettier](https://github.com/prettier/prettier) - Prettier is an opinionated code formatter. It enforces a consistent style by parsing your code and re-printing it with its own rules that take the maximum line length into account, wrapping code when necessary.
- [prettierd](https://github.com/fsouza/prettierd) - prettier, as a daemon, for ludicrous formatting speed.
- [pretty-php](https://github.com/lkrms/pretty-php) - The opinionated PHP code formatter
- [puppet-lint](https://github.com/puppetlabs/puppet-lint) - Check that your Puppet manifests conform to the style guide.
- [rubocop](https://github.com/rubocop/rubocop) - Ruby static code analyzer and formatter, based on the community Ruby style guide.
- [rubyfmt](https://github.com/fables-tales/rubyfmt) - Ruby Autoformatter! (Written in Rust)
Expand Down
1 change: 1 addition & 0 deletions doc/conform.txt
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ FORMATTERS *conform-formatter
take the maximum line length into account, wrapping code when
necessary.
`prettierd` - prettier, as a daemon, for ludicrous formatting speed.
`pretty-php` - The opinionated PHP code formatter
`puppet-lint` - Check that your Puppet manifests conform to the style guide.
`rubocop` - Ruby static code analyzer and formatter, based on the community Ruby
style guide.
Expand Down
14 changes: 14 additions & 0 deletions lua/conform/formatters/pretty-php.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
local util = require("conform.util")

---@type conform.FileFormatterConfig
return {
meta = {
url = "https://github.com/lkrms/pretty-php",
description = "The opinionated PHP code formatter",
},
command = util.find_executable({
"vendor/bin/pretty-php",
}, "pretty-php"),
args = { "$FILENAME" },
stdin = false,
}

0 comments on commit 4653408

Please sign in to comment.