pre-commit / pre-commit-hooks

Some out-of-the-box hooks for pre-commit
MIT License
5.4k stars 710 forks source link

check-yaml doesn't recognise !override tag #1108

Closed roger-duthie-pivotal closed 3 weeks ago

roger-duthie-pivotal commented 3 weeks ago

Since docker compose 2.24.4, docker-compose.yml files may have !override tags.

There is a minimal example on the docker website via this link: https://docs.docker.com/reference/compose-file/merge/#replace-value

Expected Behaviour

A valid docker-compose.yml is passes formatting verification.

Actual Behaviour

check yaml...............................................................Failed
- hook id: check-yaml
- exit code: 1

could not determine a constructor for the tag '!override'
  in "docker-compose.minimal-example.yml", line 3, column 12
roger-duthie-pivotal commented 1 week ago

Did this get considered or just closed?

asottile commented 1 week ago

sorry but if you're not going to put any effort into reading the docs or searching the issue tracker I'm not going to put in any effort on your issue

there are tens of duplicates if you put in an ounce of effort to find them

roger-duthie-pivotal commented 1 week ago

I did check the issues and docs.

Searching for "override" I get 9 hits. Only one looks relevant, I didn't see it when opened the ticket. Sorry about that. Which part of the manual are do you think helps with this? Here: https://github.com/pre-commit/pre-commit-hooks?tab=readme-ov-file#check-yaml ?

Is the answer that you use --unsafe? Are these standard docker annotations to be considered "unsafe"?

Here's a reference to an issue where you addressed n adjacent issue and introduced the --unsafe argument: https://github.com/pre-commit/pre-commit-hooks/issues/273