Filter -Wdocumentation Parser errors for KDevelop
AbandonedPublic

Authored by kfunk on Jan 4 2017, 9:07 AM.

Details

Reviewers
brauch
lesliezhai
Group Reviewers
KDevelop
Summary

Hi KDevelop developers,

KDevelop's ParseSession is too noisy: there are too many -Wdocumentation Parser errors reported to user (screenshot as https://pbs.twimg.com/media/C1UGzFCVIAAp7_a.jpg)

And I could *NOT* find the setting place via UI to filter the libclang's DiagnosticOption, so I just simply added the check:

if (ClangString(clang_getDiagnosticOption(diagnostic, nullptr)).toString().contains(QString::fromUtf8("-Wdocumentation"))) {
            continue;                                                              
        }

for filtering -Wdocumentation when createProblem in the for loop. Please give me some advice, thanks a lot!

PS: there is *NO* KDevelop in Repository!

Regards,
Leslie Zhai

Test Plan

Parsed KIO source code

Diff Detail

Lint
Lint Skipped
Unit
Unit Tests Skipped
lesliezhai updated this revision to Diff 9691.Jan 4 2017, 9:07 AM
lesliezhai retitled this revision from to Filter -Wdocumentation Parser errors for KDevelop.
lesliezhai updated this object.
lesliezhai edited the test plan for this revision. (Show Details)
lesliezhai added reviewers: KDevelop, kfunk.
kfunk requested changes to this revision.Jan 4 2017, 9:23 AM
kfunk edited edge metadata.

This is the wrong approach to fix this.

We explicitly enable this warning ourselves, see:

languages/plugins/custom-definesandincludes/compilerprovider/settingsmanager.cpp
87:        QStringLiteral("-ferror-limit=100 -fspell-checking -Wdocumentation -Wunused-parameter -Wunreachable-code -Wall -std=c99"),
88:        QStringLiteral("-ferror-limit=100 -fspell-checking -Wdocumentation -Wunused-parameter -Wunreachable-code -Wall -std=c++11"),

You can remove that warning by right-clicking on your project -> Language Support -> C/C++ Parser -> C++ Profile: Custom.

The better approach would be to have a checkbox to toggle the -Wdocumentation warning. But I'm not sure it'd be needed that often... Rather fix the issues in code ;)

This revision now requires changes to proceed.Jan 4 2017, 9:23 AM
brauch requested changes to this revision.EditedJan 4 2017, 9:51 AM
brauch added a reviewer: brauch.
brauch added a subscriber: brauch.

Yes sorry, -1 from me as well; look at your screenshot, the documentation is not proper doxygen (the : is wrong). It's a good diagnostics, the code is bad.

Hi Kevin,

Thanks for your reply!

I should read the source code (especially under the languages/ directory) carefully ;-)

Thanks again for KDevelop developers' advice!

Regards,
Leslie ZHai

kfunk commandeered this revision.Jan 5 2017, 10:14 AM
kfunk edited reviewers, added: lesliezhai; removed: kfunk.

No problem.

I'll mark this as abandoned then.

kfunk abandoned this revision.Jan 5 2017, 10:14 AM