Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
Currently we don't apply coding standards checks to files in core/scripts. We have a few instances where PHP code is hiding in files with a .sh extension. This has actually resulted in a bug because the new array syntax has been applied to \Drupal\Core\Locale\CountryManager::getStandardList() but the large array in this file is generated by core/scripts/update-countries.sh
Proposed resolution
Add files to core/phpcs.xml.dist so they are scanned.
Remaining tasks
None
User interface changes
None
API changes
None
Data model changes
None
Comment | File | Size | Author |
---|---|---|---|
#2 | 2935215-2.patch | 16.23 KB | alexpott |
Comments
Comment #2
alexpottComment #3
dawehnerI'd no idea that this is file is a thing.
I'm wondering whether we should create a followup to have some sort of test for this script.
Comment #6
alexpottRandom test fail due to jenkins database errors.
Comment #7
larowlanIs there a way we can make sure that we don't miss any new files added here? Or can we say that its unlikely we'll use a .sh extension for new php files added to /scripts?
Comment #8
alexpott@larowlan I don't think there is a way. You can't use wildcards in the file tag - if you do you get
ERROR: The file "scripts/*.sh" does not exist.
. I think you're right to think that we're unlikely to add anymore PHP hiding in .sh files because we depend on symfony/console and are using it in things like core/scripts/dump-database-d8-mysql.php and core/scripts/generate-proxy-class.php.Comment #11
larowlanCommitted as 7a72d35 and pushed to 8.6.x
Cherry-picked as f25a62f and pushed to 8.5.x
Comment #12
larowlan