Bug 394237 - IDE-friendly URLs to documentation pages of checks
Summary: IDE-friendly URLs to documentation pages of checks
Status: RESOLVED FIXED
Alias: None
Product: clazy
Classification: Developer tools
Component: general (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Sergio Martins
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-05-14 08:39 UTC by Nikolai Kosjar
Modified: 2018-05-16 06:23 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nikolai Kosjar 2018-05-14 08:39:07 UTC
Having some clazy check like "connect-by-name" it's not easily possible to link to the documentation page of that check because the level is included in the url.

Consider:

https://github.com/KDE/clazy/blob/master/src/checks/level0/README-connect-by-name.md

https://github.com/KDE/clazy/blob/master/src/checks/level1/README-connect-3arg-lambda.md

The first one has "level0" and the second one "level1" in the URL. Having only the check name, we do not know the level and thus can't provide a link to such a page.

Suggestion: Make the documentation pages accessible without any level in the URL, ideally with some version:

  <clazy base url>/docs/<version>/checks/<check-name>.md

Having that, we could easily link from e.g. Qt Creator to a documentation page of a check.
Comment 1 Sergio Martins 2018-05-14 10:25:28 UTC
Hi Nikolai,

For IDEs I recommend using checks.json (it's in the repo).

Should have all the information you need and much more. If anything is missing we can add.

In fact large parts of the README.md is generated with a script, reading from checks.json.
Comment 2 Nikolai Kosjar 2018-05-15 09:23:05 UTC
Hi Sergio!

The checks.json looks indeed useful and could be used to construct the URL.

However, this seems to be a bit overkill for such a simple use case. We would need to ship it (and update it later) with Qt Creator one way or the other and then read/parse the JSON just to find out the level of a check, and that only to construct the correct URL.

Note that currently the documentation URL can be easily constructed for clang tidy checks, e.g:

http://releases.llvm.org/6.0.0/tools/clang/tools/extra/docs/clang-tidy/checks/modernize-make-unique.html

The version is also included in the URL which is also very nice to avoid links to inconsistent documentation.

For clazy, maybe some redirecting pages could be used to keep the current hierarchy, and to also have level-free URLS for the checks? For example, could <url part>/checks/README-connect-by-name.MD could redirect to <url part>/checks/level1/README-connect-by-name.MD? I'm not to familiar with github, but there seems to be some documentation into that directon: https://help.github.com/articles/redirects-on-github-pages
Comment 3 Sergio Martins 2018-05-15 21:11:08 UTC
I'll just move the READMEs into a docs folder.
make install will still put them in level0, 1, 2 folders, so it's fine
Comment 4 Sergio Martins 2018-05-15 21:54:12 UTC
Git commit dcac97b866c83d6645e3bc4af1f42b255f81d9a3 by Sergio Martins.
Committed on 15/05/2018 at 21:52.
Pushed by smartins into branch 'master'.

Make it easier to link to READMEs by removing the level name.

After make install they will still be installed to a level0, 1, 2 sub-folder,
as the cmake instructions are generated by generate.py

M  +3    -5    CMakeLists.txt
M  +75   -75   README.md
M  +42   -4    dev-scripts/generate.py
R  +0    -0    docs/checks/README-assert-with-side-effects.md [from: src/checks/level3/README-assert-with-side-effects.md - 100% similarity]
R  +0    -0    docs/checks/README-auto-unexpected-qstringbuilder.md [from: src/checks/level1/README-auto-unexpected-qstringbuilder.md - 100% similarity]
R  +0    -0    docs/checks/README-base-class-event.md [from: src/checks/level2/README-base-class-event.md - 100% similarity]
R  +0    -0    docs/checks/README-child-event-qobject-cast.md [from: src/checks/level1/README-child-event-qobject-cast.md - 100% similarity]
R  +0    -0    docs/checks/README-connect-3arg-lambda.md [from: src/checks/level1/README-connect-3arg-lambda.md - 100% similarity]
R  +0    -0    docs/checks/README-connect-by-name.md [from: src/checks/level0/README-connect-by-name.md - 100% similarity]
R  +0    -0    docs/checks/README-connect-non-signal.md [from: src/checks/level0/README-connect-non-signal.md - 100% similarity]
R  +0    -0    docs/checks/README-connect-not-normalized.md [from: src/checks/level0/README-connect-not-normalized.md - 100% similarity]
R  +0    -0    docs/checks/README-const-signal-or-slot.md [from: src/checks/level1/README-const-signal-or-slot.md - 100% similarity]
R  +0    -0    docs/checks/README-container-anti-pattern.md [from: src/checks/level0/README-container-anti-pattern.md - 100% similarity]
R  +0    -0    docs/checks/README-container-inside-loop.md [from: src/checks/manuallevel/README-container-inside-loop.md - 100% similarity]
R  +0    -0    docs/checks/README-copyable-polymorphic.md [from: src/checks/level2/README-copyable-polymorphic.md - 100% similarity]
R  +0    -0    docs/checks/README-ctor-missing-parent-argument.md [from: src/checks/level2/README-ctor-missing-parent-argument.md - 100% similarity]
R  +0    -0    docs/checks/README-detaching-member.md [from: src/checks/level3/README-detaching-member.md - 100% similarity]
R  +0    -0    docs/checks/README-detaching-temporary.md [from: src/checks/level1/README-detaching-temporary.md - 100% similarity]
R  +0    -0    docs/checks/README-foreach.md [from: src/checks/level1/README-foreach.md - 100% similarity]
R  +0    -0    docs/checks/README-fully-qualified-moc-types.md [from: src/checks/level0/README-fully-qualified-moc-types.md - 100% similarity]
R  +0    -0    docs/checks/README-function-args-by-ref.md [from: src/checks/level2/README-function-args-by-ref.md - 100% similarity]
R  +0    -0    docs/checks/README-function-args-by-value.md [from: src/checks/level2/README-function-args-by-value.md - 100% similarity]
R  +0    -0    docs/checks/README-global-const-char-pointer.md [from: src/checks/level2/README-global-const-char-pointer.md - 100% similarity]
R  +0    -0    docs/checks/README-implicit-casts.md [from: src/checks/level2/README-implicit-casts.md - 100% similarity]
R  +0    -0    docs/checks/README-incorrect-emit.md [from: src/checks/level1/README-incorrect-emit.md - 100% similarity]
R  +0    -0    docs/checks/README-inefficient-qlist-soft.md [from: src/checks/level1/README-inefficient-qlist-soft.md - 100% similarity]
R  +0    -0    docs/checks/README-inefficient-qlist.md [from: src/checks/manuallevel/README-inefficient-qlist.md - 100% similarity]
R  +0    -0    docs/checks/README-install-event-filter.md [from: src/checks/level1/README-install-event-filter.md - 100% similarity]
R  +0    -0    docs/checks/README-isempty-vs-count.md [from: src/checks/manuallevel/README-isempty-vs-count.md - 100% similarity]
R  +0    -0    docs/checks/README-lambda-in-connect.md [from: src/checks/level0/README-lambda-in-connect.md - 100% similarity]
R  +0    -0    docs/checks/README-lambda-unique-connection.md [from: src/checks/level0/README-lambda-unique-connection.md - 100% similarity]
R  +0    -0    docs/checks/README-missing-qobject-macro.md [from: src/checks/level2/README-missing-qobject-macro.md - 100% similarity]
R  +0    -0    docs/checks/README-missing-typeinfo.md [from: src/checks/level2/README-missing-typeinfo.md - 100% similarity]
R  +0    -0    docs/checks/README-mutable-container-key.md [from: src/checks/level0/README-mutable-container-key.md - 100% similarity]
R  +0    -0    docs/checks/README-non-pod-global-static.md [from: src/checks/level1/README-non-pod-global-static.md - 100% similarity]
R  +0    -0    docs/checks/README-old-style-connect.md [from: src/checks/level2/README-old-style-connect.md - 100% similarity]
R  +0    -0    docs/checks/README-overridden-signal.md [from: src/checks/level1/README-overridden-signal.md - 100% similarity]
R  +0    -0    docs/checks/README-post-event.md [from: src/checks/level1/README-post-event.md - 100% similarity]
R  +0    -0    docs/checks/README-qcolor-from-literal.md [from: src/checks/level0/README-qcolor-from-literal.md - 100% similarity]
R  +0    -0    docs/checks/README-qdatetime-utc.md [from: src/checks/level0/README-qdatetime-utc.md - 100% similarity]
R  +0    -0    docs/checks/README-qdeleteall.md [from: src/checks/level1/README-qdeleteall.md - 100% similarity]
R  +0    -0    docs/checks/README-qenums.md [from: src/checks/level0/README-qenums.md - 100% similarity]
R  +0    -0    docs/checks/README-qfileinfo-exists.md [from: src/checks/level0/README-qfileinfo-exists.md - 100% similarity]
R  +0    -0    docs/checks/README-qgetenv.md [from: src/checks/level0/README-qgetenv.md - 100% similarity]
R  +0    -0    docs/checks/README-qhash-namespace.md [from: src/checks/level1/README-qhash-namespace.md - 100% similarity]
R  +0    -0    docs/checks/README-qhash-with-char-pointer-key.md [from: src/checks/manuallevel/README-qhash-with-char-pointer-key.md - 100% similarity]
R  +0    -0    docs/checks/README-qlatin1string-non-ascii.md [from: src/checks/level1/README-qlatin1string-non-ascii.md - 100% similarity]
R  +0    -0    docs/checks/README-qmap-with-pointer-key.md [from: src/checks/level0/README-qmap-with-pointer-key.md - 100% similarity]
R  +0    -0    docs/checks/README-qproperty-without-notify.md [from: src/checks/level1/README-qproperty-without-notify.md - 100% similarity]
R  +0    -0    docs/checks/README-qstring-allocations.md [from: src/checks/level2/README-qstring-allocations.md - 100% similarity]
R  +0    -0    docs/checks/README-qstring-arg.md [from: src/checks/level0/README-qstring-arg.md - 100% similarity]
R  +0    -0    docs/checks/README-qstring-insensitive-allocation.md [from: src/checks/level0/README-qstring-insensitive-allocation.md - 100% similarity]
R  +0    -0    docs/checks/README-qstring-left.md [from: src/checks/level1/README-qstring-left.md - 100% similarity]
R  +0    -0    docs/checks/README-qstring-ref.md [from: src/checks/level0/README-qstring-ref.md - 100% similarity]
R  +0    -0    docs/checks/README-qstring-varargs.md [from: src/checks/manuallevel/README-qstring-varargs.md - 100% similarity]
R  +0    -0    docs/checks/README-qt-keywords.md [from: src/checks/manuallevel/README-qt-keywords.md - 100% similarity]
R  +0    -0    docs/checks/README-qt-macros.md [from: src/checks/level0/README-qt-macros.md - 100% similarity]
R  +0    -0    docs/checks/README-qt4-qstring-from-array.md [from: src/checks/manuallevel/README-qt4-qstring-from-array.md - 100% similarity]
R  +0    -0    docs/checks/README-qvariant-template-instantiation.md [from: src/checks/level0/README-qvariant-template-instantiation.md - 100% similarity]
R  +0    -0    docs/checks/README-range-loop.md [from: src/checks/level1/README-range-loop.md - 100% similarity]
R  +0    -0    docs/checks/README-reserve-candidates.md [from: src/checks/level3/README-reserve-candidates.md - 100% similarity]
R  +0    -0    docs/checks/README-returning-data-from-temporary.md [from: src/checks/level1/README-returning-data-from-temporary.md - 100% similarity]
R  +0    -0    docs/checks/README-returning-void-expression.md [from: src/checks/level2/README-returning-void-expression.md - 100% similarity]
R  +0    -0    docs/checks/README-rule-of-three.md [from: src/checks/level2/README-rule-of-three.md - 100% similarity]
R  +0    -0    docs/checks/README-rule-of-two-soft.md [from: src/checks/level1/README-rule-of-two-soft.md - 100% similarity]
R  +0    -0    docs/checks/README-skipped-base-method.md [from: src/checks/level1/README-skipped-base-method.md - 100% similarity]
R  +0    -0    docs/checks/README-static-pmf.md [from: src/checks/level2/README-static-pmf.md - 100% similarity]
R  +0    -0    docs/checks/README-strict-iterators.md [from: src/checks/level0/README-strict-iterators.md - 100% similarity]
R  +0    -0    docs/checks/README-temporary-iterator.md [from: src/checks/level0/README-temporary-iterator.md - 100% similarity]
R  +0    -0    docs/checks/README-thread-with-slots.md [from: src/checks/level3/README-thread-with-slots.md - 100% similarity]
R  +0    -0    docs/checks/README-tr-non-literal.md [from: src/checks/manuallevel/README-tr-non-literal.md - 100% similarity]
R  +0    -0    docs/checks/README-unneeded-cast.md [from: src/checks/manuallevel/README-unneeded-cast.md - 100% similarity]
R  +0    -0    docs/checks/README-unused-non-trivial-variable.md [from: src/checks/level0/README-unused-non-trivial-variable.md - 100% similarity]
R  +0    -0    docs/checks/README-virtual-call-ctor.md [from: src/checks/level2/README-virtual-call-ctor.md - 100% similarity]
R  +0    -0    docs/checks/README-virtual-signal.md [from: src/checks/level1/README-virtual-signal.md - 100% similarity]
R  +0    -0    docs/checks/README-writing-to-temporary.md [from: src/checks/level0/README-writing-to-temporary.md - 100% similarity]
R  +0    -0    docs/checks/README-wrong-qevent-cast.md [from: src/checks/level0/README-wrong-qevent-cast.md - 100% similarity]
R  +0    -0    docs/checks/README-wrong-qglobalstatic.md [from: src/checks/level0/README-wrong-qglobalstatic.md - 100% similarity]
A  +90   -0    readmes.cmake

https://commits.kde.org/clazy/dcac97b866c83d6645e3bc4af1f42b255f81d9a3
Comment 5 Nikolai Kosjar 2018-05-16 06:23:02 UTC
Thanks Sergio!