Pending

User tests: Successful: Unsuccessful:

avatar LadySolveig
LadySolveig
21 Nov 2024

Pull Request for Issue # .

Summary of Changes

Add commands

  • composer run phpcs
  • composer run csfixer
    to composer.json for running cs check same way as it is configured in our automated testing setup, to make it easy for contributors to run it locally.

Add excludes for cacheand logsdirectory to php-cs-fixer configuration as we have the same exlcudes for phpcs.
Improvement for our nice contributors.

Testing Instructions

Open a terminal (and step into the cloned joomla developement folder)

  • If not already done: type composer i
  • type composer run phpcs
  • type composer run csfixer

Actual result BEFORE applying this Pull Request

grafik

Expected result AFTER applying this Pull Request

grafik

Link to documentations

Please select:

  • Documentation link for docs.joomla.org:

  • No documentation changes for docs.joomla.org needed

  • Pull Request link for manual.joomla.org: joomla/Manual#337

  • No documentation changes for manual.joomla.org needed

avatar LadySolveig LadySolveig - open - 21 Nov 2024
avatar LadySolveig LadySolveig - change - 21 Nov 2024
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 21 Nov 2024
Category External Library Composer Change
avatar LadySolveig LadySolveig - change - 21 Nov 2024
The description was changed
avatar LadySolveig LadySolveig - edited - 21 Nov 2024
avatar LadySolveig LadySolveig - change - 21 Nov 2024
The description was changed
avatar LadySolveig LadySolveig - edited - 21 Nov 2024
avatar brianteeman
brianteeman - comment - 21 Nov 2024

is it expected to get this error at the end of running phpcs?

image

and this error at the end of running csfixer

image

avatar LadySolveig
LadySolveig - comment - 22 Nov 2024

No, absolutely not an expected result.
I have tried to replicate your issue but unfortunately I can't recreate it at the moment.

I have seen you run it directly on Windows.
Since I usually use Linux, I have now installed php 8.3 and composer directly on Windows.

But for me it runs without errors here too.

composer run phpcs
Screenshot 2024-11-22 084946
Screenshot 2024-11-22 084428

composer run csfixer
Screenshot 2024-11-22 084803

Is your IDE or your Git client possibly doing something with the line endings?

avatar HLeithner
HLeithner - comment - 4 Mar 2025

This pull request has been automatically rebased to 6.0-dev.

avatar HLeithner HLeithner - change - 4 Mar 2025
Title
[5.3] add composer scripts for cs check and add excludes to php-cs-fixer config
[6.0] add composer scripts for cs check and add excludes to php-cs-fixer config
avatar HLeithner HLeithner - edited - 4 Mar 2025
avatar ceford
ceford - comment - 3 Jun 2025

Before applying the patch I ran composer i and got Nothing to install, update or remove. The composer run phpcs and composer run csfixer both failed as described.

I then applied the patch and ran composer i - that gave me:

Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. It is recommended that you run composer update or composer update <package name>.

  • Required package "joomla/application" is in the lock file as "3.0.1" but that does not satisfy your constraint "^3.0.2".

and about 30 lines like the latter.

composer run phpcs gave me a lot of deprecation warnings, then the block of tesets 2% at a time and then many many report lines finishing with

Script ./libraries/vendor/bin/phpcs --extensions=php -p --standard=ruleset.xml . handling the phpcs event returned with error code 2

The composer run csfixer command retrned

./libraries/vendor/bin/php-cs-fixer fix -vvv --dry-run --diff
PHP needs to be a minimum version of PHP 7.4.0 and maximum version of PHP 8.3.*.
Current PHP version: 8.4.7.
To ignore this requirement please set PHP_CS_FIXER_IGNORE_ENV.
If you use PHP version higher than supported, you may experience code modified in a wrong way.
Please report such cases at https://github.com/PHP-CS-Fixer/PHP-CS-Fixer .
Script ./libraries/vendor/bin/php-cs-fixer fix -vvv --dry-run --diff handling the csfixer event returned with error code 1

Perhaps the testing instructions need to be more specific?

Add a Comment

Login with GitHub to post a comment