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
- The indentation of sub-keys with 4 spaces in generated YAML files is inconsistent with Drupal's coding standards.
- This special case was a constant confusion for novices working on config conversion patches.
Goal
- Consistently indent with 2 spaces.
Proposed solution
- Commit #1713564: Make Config\FileStorage instantiate Yaml\Dumper and Yaml\Parser only once
- Leverage @sun's enhancement to Symfony's Yaml component to set the indentation level to 2 in
Config\FileStorage
. (HEAD contains this change already) - Update all existing .yml files for the new indentation.
Comment | File | Size | Author |
---|---|---|---|
#6 | drupal8.config-indentation.6.patch | 10.16 KB | dagmar |
#2 | drupal8.config-indentation.2.patch | 9.73 KB | dagmar |
#1 | drupal8.config-indentation.1.patch | 628 bytes | sun |
Comments
Comment #1
sunRemaining task is 3: Update all existing .yml files from 4 spaces to 2 spaces for nested keys.
Comment #2
dagmarHere is the patch with the spaces converted. I didn't changed the .yml files inside core/vendor/* should I change those files too?
Comment #3
sunExcellent, thanks @dagmar! :)
Comment #4
sun#2: drupal8.config-indentation.2.patch queued for re-testing.
Comment #5
webchickI just committed #1705748: Convert simpletest settings to configuration system so I think this will need a small re-roll. Otherwise, looks good.
Comment #6
dagmarRe-rolled including the simpletest config file.
Comment #7
sunThanks for the quick re-roll, @dagmar!
Comment #8
webchickOk, awesome, thanks!
Committed and pushed to 8.x. Nice and refreshing to have that done! :)