This is not about LO, but about the clang plugins used by Jenkins. In many cases the plugins end up giving error messages on a patch, which may be difficult to understand for beginner programmers - or even more experienced ones who do not follow new developments in the clang plugins area. It came up that it would be better/more educative if ALL these error messages[1] were all uniformly a bit more explanatory: - Why is some practice considered "wrong"? This may be dug out of git logs, but that's super inconvenient. - What should I change to do it correctly, possibly with an example. Adding experienced devs and TDF mentors to CC. It would be beneficial to review all the plugins and change their error messages to be very descriptive if they are currently not. [1] Just for examples from builds on top of the list: https://gerrit.libreoffice.org/c/core/+/132571 writes: clang plugin redundantcast did trigger. redundant static_cast from "SwParaPortion *" to "SwLinePortion *" - tells why is this bad, but no explanation on what to do (might be seen as trivial... but that's just an assumption of experienced devs, better to make sure ;) ) https://gerrit.libreoffice.org/c/core/+/130692 writes: clang plugin fakebool did trigger. use "true" instead of "sal_True" - no explanation why is this bad, but tells what to change https://gerrit.libreoffice.org/c/core/+/132505 writes: clang plugin stringviewparam did trigger. replace function parameter of type "const rtl::OUString &" with "std::u16string_view" - no explanation why is this bad, but tells what to change clang plugin simplifyconstruct did trigger. no need to explicitly init an instance of "::std::unique_ptr<FileChangedChecker>" with nullptr, just use default constructor - explains why is this bad and what to do instead - excellent!
Seems reasonable, setting to NEW.
Dear Gabor Kelemen (allotropia), To make sure we're focusing on the bugs that affect our users today, LibreOffice QA is asking bug reporters and confirmers to retest open, confirmed bugs which have not been touched for over a year. There have been thousands of bug fixes and commits since anyone checked on this bug report. During that time, it's possible that the bug has been fixed, or the details of the problem have changed. We'd really appreciate your help in getting confirmation that the bug is still present. If you have time, please do the following: Test to see if the bug is still present with the latest version of LibreOffice from https://www.libreoffice.org/download/ If the bug is present, please leave a comment that includes the information from Help - About LibreOffice. If the bug is NOT present, please set the bug's Status field to RESOLVED-WORKSFORME and leave a comment that includes the information from Help - About LibreOffice. Please DO NOT Update the version field Reply via email (please reply directly on the bug tracker) Set the bug's Status field to RESOLVED - FIXED (this status has a particular meaning that is not appropriate in this case) If you want to do more to help you can test to see if your issue is a REGRESSION. To do so: 1. Download and install oldest version of LibreOffice (usually 3.3 unless your bug pertains to a feature added after 3.3) from https://downloadarchive.documentfoundation.org/libreoffice/old/ 2. Test your bug 3. Leave a comment with your results. 4a. If the bug was present with 3.3 - set version to 'inherited from OOo'; 4b. If the bug was not present in 3.3 - add 'regression' to keyword Feel free to come ask questions or to say hello in our QA chat: https://web.libera.chat/?settings=#libreoffice-qa Thank you for helping us make LibreOffice even better for everyone! Warm Regards, QA Team MassPing-UntouchedBug
(In reply to Gabor Kelemen (allotropia) from comment #0) > clang plugin simplifyconstruct did trigger. no need to explicitly init an > instance of "::std::unique_ptr<FileChangedChecker>" with nullptr, just use > default constructor > - explains why is this bad and what to do instead - excellent! This is what I got when I was working on https://gerrit.libreoffice.org/c/core/+/163924/24 (tdf#132007) hence for the aDoc URL I have to follow loplugin:stringviewparam, which recommend replacing const rtl::OUString& parameters with std::u16string_view to promote non-owning views and avoid unnecessary copies at the call site. PasswordDialog::PasswordDialog(weld::Window* pParent, task::PasswordRequestMode nDialogMode, const std::locale& rResLocale, const std::u16string_view aDocURL, bool bIsSimplePasswordRequest) And this bug makes sense as at that time I thought that document URL is not going to change hence I made the change, but now Michael in the comments while reviewing raised question that the subsequent internal conversion from `std::u16string_view` back to a local `rtl::OUString`. If the `stringviewparam` message had briefly mentioned the benefits of `string_view` (e.g., "to avoid potential copies at call site and promote non-owning views for API parameters"), it would have been immediately clearer. It also made me wonder if this check is consistently applied or if its enforcement has become more stringent recently, as I noticed other recent changes to the same file (`passworddlg.cxx`) didn't seem to trigger similar discussions, though perhaps their parameters were different or didn't meet the plugin's trigger conditions? This seems like a valid enhancement and since I faced this, now feel the need of improving these messages. I would like to work on this :)
https://cgit.freedesktop.org/libreoffice/core/tree/compilerplugins/clang Goal: Enhance the diagnostic messages emitted by loplugin. Current State: As the bug notes, many messages tell you what to change (e.g., "replace const rtl::OUString & with std::u16string_view") but not why it's better or the rationale behind the rule. Some are better (like simplifyconstruct). Desired State: Messages should ideally include: - The specific issue detected (e.g., "loplugin:stringviewparam did trigger"). - A clear instruction on what code change is needed (e.g., "replace function parameter of type 'const rtl::OUString &' with 'std::u16string_view'"). - A concise explanation of why this change is recommended (e.g., "...to avoid potential copies at call site and promote non-owning views for API parameters."). - (Optional but helpful): A minimal "Before -> After" code snippet example if the change isn't trivial.