? Pending

User tests: Successful: Unsuccessful:

avatar richard67
richard67
28 Jun 2022

Pull Request for Issue # .

Summary of Changes

Converts the PHP files in the build folder to PSR-12 and but does not include them into the cs check yet.

The files in subfolder "psr12" are already PSR-12, but this PR fixes a few smaller code style errors in these files, too.

This PR here makes sure that people who use the right .editorconfig for PSR-12 can edit the files in the build folder without getting mad.

Testing Instructions

On a clean, current 4.2-dev run composer install if not done before.

Then run ./libraries/vendor/bin/phpcs --extensions=php -p --standard=ruleset.xml ./build

Actual result BEFORE applying this Pull Request

Lots of code style errors and warnings.

Expected result AFTER applying this Pull Request

Only the following warning is remaining for some files:

FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------------------------------------
 1 | WARNING | A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic
   |         | with side effects, but should not do both. The first symbol is defined on line 25 and the first side effect is on line 26.
------------------------------------------------------------------------------------------------------------------------------------------------------

Documentation Changes Required

None.

avatar richard67 richard67 - open - 28 Jun 2022
avatar richard67 richard67 - change - 28 Jun 2022
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 28 Jun 2022
Category Repository
avatar richard67 richard67 - change - 28 Jun 2022
The description was changed
avatar richard67 richard67 - edited - 28 Jun 2022
avatar richard67 richard67 - change - 28 Jun 2022
The description was changed
avatar richard67 richard67 - edited - 28 Jun 2022
avatar HLeithner HLeithner - change - 28 Jun 2022
Status Pending Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2022-06-28 11:32:58
Closed_By HLeithner
Labels Added: ?
avatar HLeithner HLeithner - close - 28 Jun 2022
avatar HLeithner HLeithner - merge - 28 Jun 2022
avatar HLeithner
HLeithner - comment - 28 Jun 2022

thanks

avatar laoneo
laoneo - comment - 28 Jun 2022
avatar laoneo
laoneo - comment - 28 Jun 2022

I would also add it to the CS check as this should be for all files.

avatar richard67
richard67 - comment - 28 Jun 2022

@laoneo Ok, I will make a follow up PR. Thanks for the hint.

avatar HLeithner
HLeithner - comment - 28 Jun 2022

When we do exceptions I think we should describe the reason for the code style exception, especially for then PSR1.Files.SideEffects which has security implications.

avatar richard67
richard67 - comment - 28 Jun 2022

When we do exceptions I think we should describe the reason for the code style exception, especially for then PSR1.Files.SideEffects which has security implications.

@HLeithner For the scripts in the build folder we can add a comment that they are not shipped and so not relevant.

avatar laoneo
laoneo - comment - 28 Jun 2022

Same for tests

avatar richard67
richard67 - comment - 28 Jun 2022

I think we should not do that in particular files but have exclusion sets for that rule in the ruleset.xml for the build and the tests folder.

avatar laoneo
laoneo - comment - 28 Jun 2022

I would not do that for a particular folder, more for the individual files. For the build and tests folder should also go under the same standard as the rest of the code base.

avatar richard67
richard67 - comment - 28 Jun 2022

I would not do that for a particular folder, more for the individual files. For the build and tests folder should also go under the same standard as the rest of the code base.

@laoneo Then why have you added an exception for a folder here with PR #38161 ? https://github.com/joomla/joomla-cms/blob/4.2-dev/ruleset.xml#L247

avatar HLeithner
HLeithner - comment - 28 Jun 2022

In the end we should have "no" exceptions, of course that's not possible but I'm pretty sure we now have a punch of cs ignore rules in our codebase which could be removed after the move to the psr-12 standard.

avatar HLeithner
HLeithner - comment - 28 Jun 2022

When someone has time we have to reduce the char count to about 150 but that wasn't possible with our current code base so I set the longest line I found.

avatar richard67
richard67 - comment - 28 Jun 2022

I think we should do that for particular rules in the ruleset.xml because there are already comments for particular sections, like <!-- expected, may move exception to file or refactor implementation -->. I will make my PR like that.

avatar HLeithner
HLeithner - comment - 28 Jun 2022

what pr would you like to create?!

avatar richard67
richard67 - comment - 28 Jun 2022

The one to include the build folder into the regular tests, i.e. remove it from the exception in ruleset.xml

avatar richard67
richard67 - comment - 28 Jun 2022
avatar richard67
richard67 - comment - 28 Jun 2022

My PR #38168 worked locally on Linux and failed in Drone (also on Linux), and I have no idea why, so I gave it up.

Add a Comment

Login with GitHub to post a comment