nedbat / cog

Small bits of Python computation for static files
MIT License
340 stars 26 forks source link

Check flag #14

Closed williamjamir closed 2 years ago

williamjamir commented 3 years ago

Is it possible to run cog to check if a file will be changed? If not, would it be possible to add a --check flag that returns a non-zero status code for CI and pre-commit purposes?

hynek commented 2 years ago

I would be interested in this too. That said, pre-commit also fails whenever a hook changes a file so it might be possible to achieve with an appropriate .pre-commit-hooks.yaml and no code changes.

simonw commented 2 years ago

I'd love this too - I came up with a workaround but it would be great if this was an available feature: https://til.simonwillison.net/python/cog-to-update-help-in-readme

nedbat commented 2 years ago

This is implemented in commit a69b014, available as cog 3.3.0.