aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrederik Buchlák <30214087+fbuchlak@users.noreply.github.com>2023-11-12 03:20:03 +0100
committerGitHub <noreply@github.com>2023-11-11 18:20:03 -0800
commit5235405cc6d4ac98dc9008ffa850038e3325bbce (patch)
tree3b09827242176ac57a7886a72933946c16944f10
parentcb633918c84054eebac7e3301de4c741ab760110 (diff)
feat: add phpinsights (#170)
* feat: add phpinsights * doc: remove redundant mention of formatting in description --------- Co-authored-by: Steven Arcangeli <506791+stevearc@users.noreply.github.com>
-rw-r--r--README.md1
-rw-r--r--doc/conform.txt2
-rw-r--r--lua/conform/formatters/phpinsights.lua17
3 files changed, 20 insertions, 0 deletions
diff --git a/README.md b/README.md
index b07358d..183d66f 100644
--- a/README.md
+++ b/README.md
@@ -237,6 +237,7 @@ You can view this list in vim with `:help conform-formatters`
- [pg_format](https://github.com/darold/pgFormatter) - PostgreSQL SQL syntax beautifier.
- [php_cs_fixer](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer) - The PHP Coding Standards Fixer.
- [phpcbf](https://phpqa.io/projects/phpcbf.html) - PHP Code Beautifier and Fixer fixes violations of a defined coding standard.
+- [phpinsights](https://github.com/nunomaduro/phpinsights) - The perfect starting point to analyze the code quality of your PHP projects with support for auto-formatting.
- [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.
diff --git a/doc/conform.txt b/doc/conform.txt
index c12fb96..e3470d8 100644
--- a/doc/conform.txt
+++ b/doc/conform.txt
@@ -259,6 +259,8 @@ FORMATTERS *conform-formatter
`php_cs_fixer` - The PHP Coding Standards Fixer.
`phpcbf` - PHP Code Beautifier and Fixer fixes violations of a defined coding
standard.
+`phpinsights` - The perfect starting point to analyze the code quality of your
+ PHP projects with support for auto-formatting.
`pint` - Laravel Pint is an opinionated PHP code style fixer for minimalists.
`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
diff --git a/lua/conform/formatters/phpinsights.lua b/lua/conform/formatters/phpinsights.lua
new file mode 100644
index 0000000..c2575d1
--- /dev/null
+++ b/lua/conform/formatters/phpinsights.lua
@@ -0,0 +1,17 @@
+local util = require("conform.util")
+
+---@type conform.FileFormatterConfig
+return {
+ meta = {
+ url = "https://github.com/nunomaduro/phpinsights",
+ description = "The perfect starting point to analyze the code quality of your PHP projects.",
+ },
+ command = util.find_executable({
+ "vendor/bin/phpinsights",
+ }, "phpinsights"),
+ args = { "fix", "$FILENAME", "--no-interaction", "--quiet" },
+ cwd = util.root_file({
+ "phpinsights.php",
+ }),
+ stdin = false,
+}