User tests: Successful: Unsuccessful:
Preparation Pull Request for Motion PROD2021/004: Update the code style to PSR12 as early as possible but latest for 5.0
This pull requests prepares the cms repository for that automated transformation PR #37686.
Motion:
Status | New | ⇒ | Pending |
Category | ⇒ | Administration com_finder com_users Libraries Front End Plugins |
Labels |
Added:
?
|
The motion is really reduced to "Switch from custom codestyle to PSR-12" I added the motion description to the description.
Category | Administration com_finder com_users Libraries Front End Plugins | ⇒ | Administration com_config com_finder com_users Libraries Front End Plugins |
Category | Administration com_finder com_users Libraries Front End Plugins com_config | ⇒ | Administration com_config com_finder com_users Repository Libraries Front End Plugins |
@brianteeman I hopefully added all your fixes into the last commit. I added by hand to not make the pr too complex. All thanks go to you
so with this pr you can recreate the 37686 pr yourself
This PR is all about having consistent code style. It would be good if you could also be consistent with how you write psr12.
Sometimes you write PSR-12 and other times PSR12
This PR is all about having consistent code style. It would be good if you could also be consistent with how you write psr12.
Sometimes you write PSR-12 and other times PSR12
I will use psr12 for files/folders and in code und PSR-12 in Text, will do a second update with cleaning this up
Can you confirm the syntax for specifiying a folder
I have tried relative and absolute but both give the same error
C:\htdocs\joomla-cms>php build\psr12\psr12_converter.php --task=CS modules/
Joomla! PSR12 Converter
=======================
Tasks will be executed: CS
Files and Folders:
modules/
PHP Notice: Undefined variable: dir in C:\htdocs\joomla-cms\build\psr12\psr12_converter.php on line 177
PHP Notice: Trying to get property 'path' of non-object in C:\htdocs\joomla-cms\build\psr12\psr12_converter.php on line 177
PHP Notice: Undefined variable: entry in C:\htdocs\joomla-cms\build\psr12\psr12_converter.php on line 177
Check /
<?xml version="1.0" encoding="UTF-8"?>
<phpcs version="3.6.2">
</phpcs>
And if I dont pass a path it is only checking the last folder #37686 (comment)
maybe its a windows thing but $entry is always empty
maybe its a windows thing but $entry is always empty
no that's not the problem, it's an error from refactoring.
And if I dont pass a path it is only checking the last folder #37686 (comment)
which doesn't makes a sense because I convert the complete cms with the same script also on windows...
i give up - still doesnt work
i give up - still doesnt work
you mean more then one folder?
found the problem i think
when looking at the list of files and folder from task=cs it doesnt traverse the path fully so doesnt find files.
edited output below to show what I mean
C:\htdocs\joomla-cms>php build\psr12\psr12_converter.php --task=CS
Joomla! PSR-12 Converter
=======================
Tasks will be executed: CS
Files and Folders:
index.php
administrator/index.php
administrator/components/com_actionlogs
administrator/components/com_admin
administrator/components/com_ajax
administrator/components/com_associations
....
administrator/components/com_workflow
administrator/components/com_wrapper
administrator/includes/app.php
administrator/includes/defines.php
administrator/includes/framework.php
administrator/language/en-GB
administrator/language/overrides
administrator/modules/mod_custom
administrator/modules/mod_feed
administrator/modules/mod_frontend
administrator/modules/mod_latest
administrator/modules/mod_latestactions
It doens't need to find files, that's done by phpcs it self... what happens if you execute psr12_converter.php --task=cs modules,plugins
?
C:\htdocs\joomla-cms>php build\psr12\psr12_converter.php --task=CS modules,plugins
Joomla! PSR-12 Converter
=======================
Tasks will be executed: CS
Files and Folders:
modules
plugins
Check modules
<?xml version="1.0" encoding="UTF-8"?>
<phpcs version="3.6.2">
</phpcs>
Check plugins
<?xml version="1.0" encoding="UTF-8"?>
<phpcs version="3.6.2">
</phpcs>
That looks good and without you only get one entry?! that's really strange.
ok so maybe I am misunderstanding what CS will do. I am expecting that running CS will generate a report in build/t,mp/psr but there is nothing there. and running CBF returns No fixable errors were found
ok so maybe I am misunderstanding what CS will do. I am expecting that running CS will generate a report in build/t,mp/psr but there is nothing there. and running CBF returns No fixable errors were found
the report only exists if it finds errors, so usually after the first CS run you should have a file called build/tmp/psr12/result.html
this should also exists (but outdated) after running task CMS
ok so maybe I am misunderstanding what CS will do. I am expecting that running CS will generate a report in build/t,mp/psr but there is nothing there. and running CBF returns No fixable errors were found
the report only exists if it finds errors, so usually after the first CS run you should have a file called
build/tmp/psr12/result.html
this should also exists (but outdated) after running task CMS
and there is nothing as I already stated so something is wrong with the code (tested on another server with the same results)
<!--
If no files or directories are specified on the command line
your custom standard can specify what files should be checked
instead.
Note that file and directory paths specified in a ruleset are
relative to the ruleset's location, and that specifying any file or
directory path on the command line will ignore all file tags.
-->
<file>./path/to/directory</file>
<file>./path/to/file.php</file>
<!--
You can hard-code ignore patterns directly into your
custom standard so you don't have to specify the
patterns on the command line.
The following two tags are equivalent to the command line argument:
--ignore=*/tests/*,*/data/*
-->
<exclude-pattern>*/tests/*</exclude-pattern>
<exclude-pattern>*/data/*</exclude-pattern>
@brianteeman can you try <exclude-pattern type="relative">cache/*</exclude-pattern>
instead?
that appears to work as well
Retested and appears to be working as intended
Category | Administration com_finder com_users Libraries Front End Plugins com_config Repository | ⇒ | Administration com_config com_finder com_users Repository Layout Libraries Front End Plugins |
So latest additions are the layouts,templates and tmpl folder. This is the final call on this PR. It is planned to be merged before the next alpha.
@brianteeman I added the PR converter script, it's not really testable for you but maybe you can check my english?
@brianteeman I added the PR converter script, it's not really testable for you but maybe you can check my english?
first pass done
I updated all Text changes btw. I also changed the "dir=auto" in the phpcs template from your comment in the commit.
thanks
thanks updated.
I plan to do the PSR-12 conversation today starting at 16:00 UTC as long as nothing comes in between.
Status | Pending | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2022-06-27 18:06:38 |
Closed_By | ⇒ | HLeithner |
could you please include the text of
Motion PROD2021/004.
so that this pr contains an explanation of the chaanges