compose_format icon indicating copy to clipboard operation
compose_format copied to clipboard

Quoted values unquoating

Open malefici opened this issue 5 years ago • 0 comments

Some configuration values should be quoted. Pls, take a look at this snippet:

version: '3'
services:
    mysql:
        image: mysql:latest
        environment:
            MYSQL_DATABASE: test
            MYSQL_PASSWORD: test
            # See: https://hub.docker.com/_/mysql
            MYSQL_RANDOM_ROOT_PASSWORD: 'yes'
            MYSQL_USER: test

Linter removes quoting (MYSQL_RANDOM_ROOT_PASSWORD: yes), so using this config will trigger an error services.mysql.environment.MYSQL_RANDOM_ROOT_PASSWORD contains true, which is an invalid type, it should be a string, number, or a null. This means that it is not possible to leave value type specification after this linter usage.

Also, it breaks type specification like this !!str yes.

Sorry, I am not familiar with ruamel.yaml and can not create a proper pull request. Maybe do you know how to fix it?

malefici avatar Oct 09 '20 20:10 malefici