74930[TASK] Add PSR-4 namespace integrity check for code files
Commit message
Review
-
Code review CR +2 Done
- Stefan Bürk +2
- Christian Kuhn +1
- Simon Schaufelberger +1
-
Verified V +2 Done
- Stefan Bürk +2
- Christian Kuhn +1
- Simon Schaufelberger +1
- core-ci +1 CI
Issues 1
Files 5
Review log 2131
Show 46 earlier messages
-
Stefan Bürk uploaded patch set 1 06/18/22, 15:23
-
Oliver Klee commented on patch set 1 06/18/22, 15:28
Would it make sense to leverage existing tools for this, e.g., the PSR-4 rule for PHP_CodeSniffer? https://github.com/suin/phpcs-psr4-sniff -
Stefan Bürk uploaded patch set 2 06/18/22, 15:28
-
core-ci voted on patch set 1 V -1 06/18/22, 15:30 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/28177
-
core-ci voted on patch set 2 V -1 06/18/22, 15:35 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/28178
-
Stefan Bürk commented on patch set 2 06/18/22, 15:37
Reply
Not sure. Quick reading, it leverage one composer.json definition to do that. But we have here some specialities: - using typo3/sysext/<ext>/composer.json autolod=>psr-4 for corresponding ext class files - using ./composer.json autoload-dev=>psr-4 for "test files" currently leaving out test fixture extensions. (which will be streamlined regarding namespace + autoload-dev=>psr-4 registration instead of classmap registration) in a dedicated patch. root json does not "require" the core system extension, thus monorepo composer autoload do not have them in the map. You may try it, and you can provider a proper configuration we can skip the custom implementation. But from my point of view, it would not work and thus not putting time into testing it. Custom solution works and will handle our core specialities in the way we need. Using a tool may be need to maintain some kind of complex configuration for that, as this is a "working" solution without configuration needs and thus not have to be kept up with "3rd part tooling evolution and configuration changes".
-
Stefan Bürk uploaded patch set 3 06/18/22, 15:43
-
core-ci voted on patch set 3 V -1 06/18/22, 15:50 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/28179
-
Stefan Bürk uploaded patch set 4 06/18/22, 15:54
-
core-ci voted on patch set 4 V -1 06/18/22, 16:01 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/28180
-
Stefan Bürk uploaded patch set 5 06/18/22, 16:02
-
core-ci voted on patch set 5 V -1 06/18/22, 16:09 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/28181
-
Stefan Bürk uploaded patch set 6 06/18/22, 16:14
-
core-ci voted on patch set 6 V -1 06/18/22, 16:22 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/28183
-
Stefan Bürk commented on patch set 6 06/18/22, 16:31
Note: ci failing is not because of failure in th the new integrity check. Failing is because the new integrity check finds real namespace integrity failures. These have to be fixed (as pre-patches). -
Oliver Klee voted on patch set 6 V +1 06/18/22, 16:46
-
Stefan Bürk uploaded patch set 7 06/18/22, 18:01
-
core-ci voted on patch set 7 V -1 06/18/22, 18:08 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/28184
-
Stefan Bürk uploaded patch set 8 06/18/22, 18:36
-
core-ci voted on patch set 8 V -1 06/18/22, 18:43 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/28185
-
Simon Schaufelberger commented on patch set 8 06/18/22, 20:32
I know this is specifically for the the core but could it be generalized that it could also be used for extensions without too much adjustments? -
Stefan Bürk commented on patch set 8 06/18/22, 20:38
Reply
Mhh .. maybe we can add this later to typo3/styleguide as example for "copy&paste" .. with an adjusted version. For a extension we do not need quite some hacks, as only the root composer json and one classes / test folder should be enough to check. There we may provide configuration over composer.json -> extra configuration. Otherwise, maybe the mentioned phpcs sniffer psr4 is easier for a a extension to use. Tried it for core, but gave up with the special needs for mono repo. -
Stefan Bürk commented on patch set 8 06/18/22, 22:14
Reply
I think we will use / define this as core internal testing. Extension may be up to copy and adjust ist. For now, we do not want to make "everything" as "maintained infrastructure code for extensions developers". As Oliver Klee already mentioned, there are alternatives out there which may be fine to use for extensions, because they do not have to deal with the special cases like the core. Maybe in the future, but not planed/on the list for now. In the end - you know it's open source, so you are up to create eventually a utility package to provide this as a development package for extensions developers on your own. -
Stefan Bürk rebased onto patch set 9 06/18/22, 22:57
-
core-ci voted on patch set 9 V +1 06/18/22, 23:09 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/28196
-
Christian Kuhn updated the commit message in patch set 10 06/18/22, 23:23
-
Christian Kuhn voted on patch set 10 V +1 CR +1 06/18/22, 23:24
-
core-ci voted on patch set 10 V +1 06/18/22, 23:32 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/28197
-
Simon Schaufelberger voted on patch set 10 V +1 CR +1 06/18/22, 23:48
-
Stefan Bürk voted on patch set 10 V +2 CR +2 06/18/22, 23:57
-
Stefan Bürk merged patch set 11 06/18/22, 23:57