yoheimuta / protolint

A pluggable linter and fixer to enforce Protocol Buffer style and conventions.
MIT License
555 stars 51 forks source link

Create folder for reporting output file #402

Open profhenry opened 3 months ago

profhenry commented 3 months ago

When specifying -output_file for writing the reporting output to a file the directory for the output file must exist and will not be created by protolint. It would be nice if protolint could try to create the directory

Example: protolint lint -reporter plain -output_file=./protolint/report.plain . fails with open ./protolint/report.txt: no such file or directory if the ./protolint directory does not exist :-/.

Possible relevant source code might be https://github.com/yoheimuta/protolint/blob/master/internal/linter/report/reporter.go#L29