Compose: Feature request: docker-compose.yml linter for syntax and coding style

Created on 1 Jul 2018  路  2Comments  路  Source: docker/compose

I post this issue here but this linter can be an independent project.

I would like a linter for:

  • check docker-compose.yml syntax
  • check docker-compose.yml coding style, example:

use this syntax:

    environment:
      LISTEN: =0.0.0.0:8081
      CLIENT_URL: http://foobar:8080

instead this syntax:

    environment:
      - LISTEN=0.0.0.0:8081
      - CLIENT_URL=http://foobar:8080

Best regards,
St茅phane

kinquestion

All 2 comments

Hi Stephane,

Thank you for the suggestion! Unfortunately, this is out of scope for the Compose project in general and this repo in particular. The docker-compose config provides some of this, but that's as far as we're looking to go for that specific feature.

That said, if you feel strongly about this, generic tooling exists that may be of interest to you, like yamllint, which you can use in your workflow.

Also hadolint, for Dockerfile files - highly recommended, we run it as a part of CI

Was this page helpful?
0 / 5 - 0 ratings