Add mago formatter recipe (#1811)

* feat: add mago formatter default configuration

* fix: remove patch version from version specifier

* fix: Remove unsupported options for contrib recipes

* fix: typo in post-install.txt

* Added a comment about format config and enable linter symfony and phpunit plugins

* Update to mago pre release

* Update the docs link and add a note about the analyzer in the
`post-install.txt`
This commit is contained in:
Zuruh
2025-09-24 08:20:54 +02:00
committed by GitHub
parent c961a3509c
commit 8b46758086
3 changed files with 47 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
php-version = "8.2"
[source]
paths = [
"src",
# "tests/",
# "importmap.php",
# "migrations/",
]
includes = ["vendor"]
excludes = []
[formatter]
print-width = 120
tab-width = 4
use-tabs = false
[linter]
integrations = ["phpunit", "symfony"]
[linter.rules]
ambiguous-function-call = { enabled = false }
literal-named-argument = { enabled = false }
halstead = { effort-threshold = 7000 }
[analyzer]
find-unused-definitions = true
find-unused-expressions = false
analyze-dead-code = false
check-throws = true
allow-possibly-undefined-array-keys = true
perform-heuristic-checks = true

View File

@@ -0,0 +1,5 @@
{
"copy-from-recipe": {
"mago.toml": "mago.toml"
}
}

View File

@@ -0,0 +1,10 @@
<bg=blue;fg=white> </>
<bg=blue;fg=white> What's next? </>
<bg=blue;fg=white> </>
* <fg=blue>Review</> your <comment>mago.toml</> file:
1. Set your exact <comment>php_version</>
2. Update your <comment>source.paths</> as needed;
3. (Optional) Enable the <comment>linter</> and <comment>analyzer</> as well.
* <fg=blue>Read</> the full the documentation at <comment>https://mago.carthage.software/guide/getting-started</>