drush-ops / drush

Drush is a command-line shell and scripting interface for Drupal, a veritable Swiss Army knife designed to make life easier for those who spend their working hours hacking away at the command prompt.
https://www.drush.org
2.34k stars 1.08k forks source link

Exported boolean yaml strings are not quoted consistently #2673

Open marcvangend opened 7 years ago

marcvangend commented 7 years ago

(Excuse me if this is not the right place to ask, I'm not sure if this is a Drush problem.)

When my colleague exports config with drush cex, some strings are quoted. I think I was able to trace this back to \Symfony\Component\Yaml\Escaper::requiresSingleQuoting(), and the behavior seems to make sense because those strings ('null', '~', 'true', 'false', 'y', 'n', 'yes', 'no', 'on', 'off') could otherwise be interpreted as booleans.

Unfortunately the behavior is not consistent across our team. Sometimes the strings are quoted, sometimes they aren't, so we keep polluting the git history with changed config. We have verified that we use the same Drush version (8.1.10) and Composer version (1.3.2). Since we commit our composer.lock file to git, we also use the same packages. We are not on the exact same PHP7 versions, but looking at the code I think that the PHP version should not matter in this case.

What could be the cause of this? What can I do, or what other information could be relevant to figure out why this is happening? Thank you.

weitzman commented 7 years ago

I am under the vague impression that this can happen when some team members have pecl yaml extension and some don't.

marcvangend commented 7 years ago

Thanks for the tip. I tried to verify on my own machine if this is indeed the problem. It seems that pecl yaml is not the cause; at least it is not with the combination of software versions I tested.

Initial situation:

What I tried

Results so far