-
-
Notifications
You must be signed in to change notification settings - Fork 84
Description
🐞 Describe the Bug
Calling mago fmt on any PHP files just returns " INFO All files are already formatted." without formatting anything. The files do not meet the formatting configuration I've specified.
The most obvious tell is that my config calls for tab indentation, and at the moment, the PHP files are indented with spaces. Formatting should be replacing spaces with tabs, among other things, but doesn't do anything at all.
🔄 Steps to Reproduce
- Spin up WSL instance kitted out with PHP, Composer, etc.
- Get the Mago binary on PATH.
- Get some PHP project on disk. In my case, I used
composer create-project tempest/app - Call
mago fmton any PHP file, especially one with some obvious tells. mago fmtdoes not format the file, tells me it's formatted already.
⚙️ Configuration (mago.toml)
php-version = "8.4.15"
[source]
paths = ["app", "tests"]
includes = ["vendor"]
excludes = [
"./vendor/symfony/cache/Traits/ValueWrapper.php",
"./vendor/composer",
]
[formatter]
print-width = 180
tab-width = 4
use-tabs = true
null-type-hint = "question"
space-before-arrow-function-parameter-list-parenthesis = true
space-after-logical-not-unary-prefix-operator = true
always-break-named-arguments-list = false
preserve-breaking-member-access-chain = true
preserve-breaking-argument-list = true
preserve-breaking-array-like = true
preserve-breaking-parameter-list = true
preserve-breaking-attribute-list = true
preserve-breaking-conditional-expression = true
function-brace-style = "SameLine"
method-brace-style = "SameLine"
classlike-brace-style = "SameLine"📜 Command Output
$ mago fmt app/HomeController.php
INFO Formatted 1 file(s) successfully.📂 PHP Code Sample (If Applicable)
<?php
namespace App;
use Tempest\Router\Get;
use Tempest\View\View;
use function Tempest\view;
final readonly class HomeController {
#[Get('/')]
public function __invoke(): View {
return view('./home.view.php');
}
}🖥️ Operating System
Linux
📦 How did you install Mago?
Installation Script (curl | bash)
📝 Additional Context
I'm on Windows 10 using WSL2 Ubuntu 24.04 LTS and Mago v1.0.0-rc6. I've installed Mago using the bash install script per the readme; this seems to install the Linux GNU build. As part of my troubleshooting, I manually installed the Linux MUSL build and tried that - no change. Mago was also included in the project template I'm tinkering with (Tempest framework), and I tried that binary as well because why not - again, no change.
As part of troubleshooting, I tried changing ownership of Mago's binaries in /usr/local/bin/ to my user - again, no change.
FWIW, I've used Mago on the Windows side (Windows binary and project stored in Windows filesystem) with the same config and project, and that worked just fine.
Happy to provide any additional details.