Closed shadowwa closed 11 months ago
How does phpmd behave in older versions if supplied with these arguments? If it works just as well for versions that go back a few years, we can make this change.
If this changes breaks older versions, we can support both versions by chaining the command with a version check. Have a search for ale#semver
in the codebase. Note that AssertLinter
can accept a List
for the expected output to check every command in a chain that is run to test version commands.
I've tried with the earliest versions available on packagist.org:
Cheers! :beers:
phpmd, until version 2.13.0 was taking the file to test as first argument (%s) and ignored the last argument (%t) since version 2.14.0 if a last argument is given, phpmd exits with this message:
Moreover, phpmd is checking the filename hence show diagnostic for saved buffer only.
With this modification, phpmd 2.14.0 is able to run correctly and the diagnostic is done on the temp file provided by Ale and is refreshed even if the buffer is not yet saved.