D15797: [kdev-clazy] : use canonical paths

René J.V. Bertin noreply at phabricator.kde.org
Thu Sep 27 14:50:38 BST 2018


rjvbb created this revision.
rjvbb added a reviewer: KDevelop.
rjvbb added a project: KDevelop.
rjvbb requested review of this revision.

REVISION SUMMARY
  The clazy plugin currently raises an error (dialog) when it cannot find the subject of an individual file check in `compile_commands.json`. Some reasons why this can go wrong even if the file in question is still in its original location:
  
  - the source dir was moved and replaced with a symlink to the new location
  - KDevelop accesses the file via a different path as cmake did when it generated `compile_commands.json` (on systems where location on disk can have more than a single unique/canonical/normalised `$PWD`). The user may have opened it via a different access path, for instance, or executed cmake outside of KDevelop.
  
  This patch converts local file paths to their canonical (normalised) version before comparison (and before storing them in the list of project files). As a result, the plugin will be able to check every file that is actually part of the current project.
  The conversion is done internally only so only the plugin's behaviour is modified.

TEST PLAN
  Tested with multiple configured projects and the 3 scenarios mentioned in the summary. Individual file analysis fails without the patch but succeeds with.

REPOSITORY
  R32 KDevelop

REVISION DETAIL
  https://phabricator.kde.org/D15797

AFFECTED FILES
  plugins/clazy/jobparameters.cpp
  plugins/clazy/utils.cpp

To: rjvbb, #kdevelop
Cc: kdevelop-devel, glebaccon, antismap, iodelay, vbspam, geetamc, Pilzschaf, akshaydeo, surgenight, arrowd
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20180927/2a796908/attachment.html>


More information about the KDevelop-devel mailing list