yannoff / yamltools Goto Github PK
View Code? Open in Web Editor NEWCommand-line utility to juggle easily between JSON and YAML
License: MIT License
Command-line utility to juggle easily between JSON and YAML
License: MIT License
Source JSON
:
{
"stability-flags": []
}
Expected YAML
:
stability-flags: []
Actual YAML
:
stability-flags: { }
This is mainly because PHP does not make any difference between sequences and mappings, considering them all as array
(@see symfony/symfony#9870 and symfony/symfony#15781)
Given the following source & destination files:
source.yaml
name: yannoff/yamltools
description: 'A command-line Swiss-Knife for YAML files'
homepage: 'https://github.com/yannoff/yamltools'
type: console-script
require:
php: '>=5.6.40'
# Should work even without, since the JSON ext is now a built-in php module
ext-json: '*'
symfony/yaml: ^3.4
dest.yaml
name: yannoff/yamltools
description: 'A command-line Swiss-Knife for YAML files'
homepage: 'https://github.com/yannoff/yamltools'
type: console-script
require:
php: '>=5.6.40'
ext-json: '*'
symfony/yaml: ^3.4
The following merge command attempt hangs and never terminate:
$ yamltools yaml:comments:merge source.yaml dest.yaml
The YPath
calculated by the Contents::getParentYPath()
method of the yannoff/y-a-m-l
library is wrong, since the comment is mistakenly interpreted as the parent level line, whereas it should not
$ ./test-all.sh
-----------------------------------------------------------------
PHP Version: 5.6.40
Run command: bin/application.php convert:json:yaml composer.json
Fatal error: Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 7.1.0". You are running 5.6.40. in /var/www/html/vendor/composer/platform_check.php on line 25
-----------------------------------------------------------------
PHP Version: 7.0.33
Run command: bin/application.php convert:json:yaml composer.json
Fatal error: Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 7.1.0". You are running 7.0.33. in /var/www/html/vendor/composer/platform_check.php on line 24
Introduced by #10
Indeed, while this should never happen, a minor version of the symfony/polyfill-ctype
package introduced a breaking change:
Kudos to the symfony team, again ๐ฟ
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.