pre-commit-hook-yamlfmt icon indicating copy to clipboard operation
pre-commit-hook-yamlfmt copied to clipboard

Is it possible to ignore a line ?

Open nitrogene opened this issue 3 years ago • 1 comments

Hello,

I am working on a docker compose including mongo (among other services), and I have an issue with yamlfmt. Let's look at the following example:

  mongo:
    image: $MONGO_IMAGE:$MONGO_VERSION
    container_name: mongo
    hostname: mongo
    volumes:
      # Persistent docker volume
      - mongo-storage:/data/db:rw
    networks:
      - logging_network
    restart: 'no'

Yamlfmt turns it into:

  mongo:
    image: $MONGO_IMAGE:$MONGO_VERSION
    container_name: mongo
    hostname: mongo
    volumes:
      # Persistent docker volume
      - mongo-storage:/data/db:rw
    networks:
      - logging_network
    restart: no

Please notice that the single quotes around no are removed. But they are required. Is it possible to make yamlfmt ignore this line ?

nitrogene avatar Dec 13 '22 09:12 nitrogene

I also want to know this, I have a script to insert a licence and its removing it from the top of the file before '----'

Corfucinas avatar Aug 02 '23 23:08 Corfucinas