Consistency of YAML indentation #6

Closed
opened 2025-11-06 14:15:47 -06:00 by GiteaMirror · 0 comments
Owner

Originally created by @mikesir87 on GitHub (Mar 20, 2020).

I know it doesn't affect the functionality of the compose files, but it does affect scan-ability and might raise questions if folks see inconsistencies. One example...

    image: postgres
    restart: always
    secrets:
    - db-password
    volumes:
    - db-data:/var/lib/postgresql/data
    networks:
      - spring-postges

The networks config is indented while the secrets and volumes aren't. Personally, I like indenting all lists as it makes easier to scan the keys. But, I'm fine with not indenting as long as it's consistent. I'd gladly update them and submit a PR if someone tells me which way to go.

Originally created by @mikesir87 on GitHub (Mar 20, 2020). I know it doesn't affect the functionality of the compose files, but it does affect scan-ability and might raise questions if folks see inconsistencies. One example... ```yaml image: postgres restart: always secrets: - db-password volumes: - db-data:/var/lib/postgresql/data networks: - spring-postges ``` The networks config is indented while the secrets and volumes aren't. Personally, I like indenting all lists as it makes easier to scan the keys. But, I'm fine with not indenting as long as it's consistent. I'd gladly update them and submit a PR if someone tells me which way to go.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/awesome-compose#6