ZedThree / clang-tidy-review

Create a pull request review based on clang-tidy warnings
MIT License
88 stars 44 forks source link

Add option to edit LGTM message and to turn it off #48

Closed bwrsandman closed 2 years ago

bwrsandman commented 2 years ago

Implements #47

ZedThree commented 2 years ago

Thanks @bwrsandman! I take it setting it to the empty string means the comment doesn't get posted -- does it need an explicit check, or does GitHub automatically reject empty comments?

bwrsandman commented 2 years ago

There is an explicit check here: https://github.com/ZedThree/clang-tidy-review/pull/48/files#diff-32e111aa752f95e484818ff16dedaa5bf4a768785886e9fa705b2b41764be060R94

I don't know what Github would do with an empty message

I'm currently testing it it works here: https://github.com/openblack/openblack/pull/526 https://github.com/openblack/openblack/pull/527

ZedThree commented 2 years ago

Ah, I missed that, sorry! Hadn't had enough caffeine :)

Would you mind just noting in the description that setting it to the empty string turns off the comment?

If you're happy this works for your case, I'll merge it

bwrsandman commented 2 years ago

Not sure why but it posts empty quotes... https://github.com/openblack/openblack/pull/527#issuecomment-1201154446

ZedThree commented 2 years ago

Because we're passing the arguments through Github's YAML, then Docker, then bash, it's quite possible it's getting passed through as "''". I had something like that before, so there's a strip_enclosing_quotes function that makes sure all the quotes are removed. Then we should end up with an actual empty string and the not body conditional should trigger.

bwrsandman commented 2 years ago

I've tested and added the part about disabling the comment.