Closed stdedos closed 2 years ago
That's a flake8
"feature". https://github.com/PyCQA/flake8/issues/1491
You need to remove/empty the file yourself before running flake8.
[Although in this case, I'm not sure what you are attempting? Typically a pre-commit hook outputs to stdout so that errors can be alerted on to a real user, where as the gl-codeclimate is for a CI pipeline to read]
[Although in this case, I'm not sure what you are attempting? Typically a pre-commit hook outputs to stdout so that errors can be alerted on to a real user, where as the gl-codeclimate is for a CI pipeline to read]
You can do both with a CI-action running pre-commit
😄
It's also "a good practice": the pre-commit
is "a medium" to (a) enforce whatever checks we want, (b) in CI.
It makes an SSOT (single source of truth) of whatever we enforce, instead of "spreading that around" or "maintaining two solutions" ... hopefully the idea is obvious
More "versatile", is what pylint is doing (--output-format=pylint_gitlab.GitlabCodeClimateReporter:pylint-GitlabCodeClimateReporter.json,text
[or ,colorized
😄]) - which also makes my case "more correct/complete".
Thank you @tevansuk for digging through this 🎉
Hello there! I am using a pre-commit hook, like so:
and, from time to time, I see that
flake8-GitlabCodeClimateReporter.json
looks like:instead of, at all times:
which is a little weird for me.
Is it possible that, instead of opening the file to write, you open it to append? (... and that's something that falls within this repo?)