Closed
Description
Describe the bug
When using openapi-python-client generate --meta=none
, post-hooks are run in the current directory.
This is an issue if you run the command in e.g. your home directory, as hooks will then run recursively and operate on everything they can find.
The culprits appear to be here:
here:
and here:
To Reproduce
Steps to reproduce the behavior:
- Make a new directory
- Add a subdirectory, inside include some random python file with e.g. an unused import
- Go back to the parent directory
- Run
openapi-python-client generate --meta=none [--path=...|--url=...]
- Your python file in the subdirectory will have been formatted, e.g. unused import removed
Expected behavior
I'd expect post-hooks to only ever be run in the directory generated for the client.
OpenAPI Spec File
Doesn't seem like this is required but I'll include it if you want.
Desktop (please complete the following information):
- OS: EndeavourOS (6.0.7-arch1-1)
- Python Version: 3.10.8
- openapi-python-client version: 0.11.6
Additional context
Add any other context about the problem here.