diff options
author | Frederik Buchlák <30214087+fbuchlak@users.noreply.github.com> | 2023-10-27 04:32:00 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-26 21:32:00 -0700 |
commit | 4653408d5c270168e31ffd0585d1cf2de27fc827 (patch) | |
tree | 7d3037d714cb66f826fb7097f57719e37ee84a03 | |
parent | 278bcd8bf2017e187e963b515017341fdd87fe2f (diff) |
feat: add pretty-php (#161)
-rw-r--r-- | README.md | 1 | ||||
-rw-r--r-- | doc/conform.txt | 1 | ||||
-rw-r--r-- | lua/conform/formatters/pretty-php.lua | 14 |
3 files changed, 16 insertions, 0 deletions
@@ -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) diff --git a/doc/conform.txt b/doc/conform.txt index 0c5398e..505261c 100644 --- a/doc/conform.txt +++ b/doc/conform.txt @@ -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. diff --git a/lua/conform/formatters/pretty-php.lua b/lua/conform/formatters/pretty-php.lua new file mode 100644 index 0000000..bf902dd --- /dev/null +++ b/lua/conform/formatters/pretty-php.lua @@ -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, +} |