- Issue created by @jonathan1055
- 🇬🇧United Kingdom jonathan1055
The phpcs job has:
rules: - *skip-phpcs-rule - if: $_PHPCS_ALLOW_FAILURE == "1" || ($_ALL_VALIDATE_ALLOW_FAILURE == "1" && $_PHPCS_ALLOW_FAILURE != "0") allow_failure: true - if: $_PHPCS_ALLOW_FAILURE == "0" || $_ALL_VALIDATE_ALLOW_FAILURE == "0" allow_failure: false - when: on_success
There is no checking at all for what file types exist, so that is why the GTD main branch runs the jobs but checks zero files.
The default assets/phpcs.xml checks file extensions of
php,inc,module,install,info,test,profile,theme
We currently have a rule .php-files-exist which checks for:
exists: - '*.{$DRUPAL_PHP_FILE_TYPES}' - '**/*.{$DRUPAL_PHP_FILE_TYPES}'
where
$DRUPAL_PHP_FILE_TYPES
is defined asphp,module,install,inc,profile,theme,engine
These are nearly the same set. phpcs.xml has
.info
and.test
which are not in$DRUPAL_PHP_FILE_TYPES
. I think these are exclusively Drupal 7 filetype extensions, not used in Drupal 8+ ?However
$DRUPAL_PHP_FILE_TYPES
has.engine
which is not in the phpcs.xml list.We could use .php-files-exist in the phpcs job definition for the main pipeline, and if we wanted to backport to main-d7 we could also add .info and .test but that's not a problem.
- 🇪🇸Spain fjgarlin
Yeah, that sounds like a good way forward. We can/should unify the extentions being checked for D8+ and add the extra ones for D7.
- 🇬🇧United Kingdom jonathan1055
I used
_PHPCS_EXTRA: -v
and verified that the Coding Standards phpcs job is checking 0 files, just like our GTD branchWe can/should unify the extentions being checked
So is there any harm in adding 'info' and 'test' into
$DRUPAL_PHP_FILE_TYPES
and also adding 'engine' into the assets/phpcs.xml file? Then$DRUPAL_PHP_FILE_TYPES
will work in D8+ and also in the D7 job. Or should the Drupal7 specifc extensions be added via hardcoding an extra line in the d7 phpcs job rule? If D8+ does not have any files ending .info or .test then I can't see any problem adding them into the list.Maybe I will just start the work and see how it looks, the you can make a judgement when you can see the chnages :-)
- 🇪🇸Spain fjgarlin
Yeah, agree. We can have them all under the same variable.