econchick / interrogate

Explain yourself! Interrogate a codebase for docstring coverage.
https://interrogate.readthedocs.io
MIT License
574 stars 44 forks source link

-o, --output flag doesn't create output directory for log file if it doesn't exist already #106

Open GlenNicholls opened 2 years ago

GlenNicholls commented 2 years ago

Environment

Description of the bug

When using the -o, --output flag, interrogate doesn't create the parent(s) of the file if they don't already exist:

$interrogate -vv -o build/coverage/docstring_coverage.log dir/
<traceback>
FileNotFoundError: [Errno 2] No such file or directory: 'build/coverage/docstring_coverage.log'

What you expected to happen

I would expect that interrogate would create the parent directories that do not exist (e.g. in this case build/coverage/.