supertux icon indicating copy to clipboard operation
supertux copied to clipboard

Cppcheck github action, and style and bugfixes

Open HybridDog opened this issue 3 years ago • 1 comments

I've used Cppcheck to find and fix some bugs and bad code style, and then added a github action to run the checks automatically. I haven't tested if the github action works.

The bugs:

  • AddonPreviewMenu::rebuild_menu accessed the addon description string out of bounds.
  • TextObject::wrap_text stripped all newlines, even double ones, because prev_c was not changed.
  • RainParticleSystem::set_amount used amount instead of real_amount in the minimum calculation, which was probably not intended. I don't know how this affects the rain.

Related issue: #1552 In the future when code is more clean, additional linters could be added, e.g. TscanCode and Clang-Tidy. SuperTux apparently already has a .clang-tidy configuration file but no github action workflow for it.

HybridDog avatar Sep 10 '22 20:09 HybridDog

I think the new workflow works now and the 5 failing checks are not related to this PR and fail on other PRs, too.

HybridDog avatar Sep 11 '22 18:09 HybridDog

Thank you for reviewing this. Can I merge it now?

HybridDog avatar Sep 25 '22 08:09 HybridDog

I'm not sure if I should decide about this but I think that you can

mrkubax10 avatar Sep 25 '22 19:09 mrkubax10

CONTRIBUTING.md and the wiki don't mention conditions for merging (at least I cannot see them), so I assume that I'm allowed to merge.

HybridDog avatar Sep 26 '22 15:09 HybridDog