potiuk edited a comment on issue #19967: URL: https://github.com/apache/airflow/issues/19967#issuecomment-987865031
Yeah. Just add a pre-commiit to generate the files and save them somewhere in `./dev/breeze/autocomplete/` for example. There is no need to check if a file changes. Assuming that precommit generates the same script when you run it twice, pre-commit checks on it's own if the re-generated file changed or not. So it's ok to regenerate the file again and again only to find out that nothing changed (but in pre-commit definition you should specify that pre-commit should run only when the `./airflow_breeze.py` changes (because that's where the defintions of click commands are). This can be done by adding `pass_filenames` to false: https://pre-commit.com/#hooks-pass_filenames and adding dev/breeze/airflow_breeze.py proper regexp to `files` parameter of pre-commit https://pre-commit.com/#hooks-files. Again `pre-commit` does it automatically - if the change that you are commiting contains the `airflow_breeze.py`, then the pre-commit hook will run - otherwise it will be skipped. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
