[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [clazy] checks: improve the markdown in the README's
From:       Allen Winter <allen.winter () kdab ! com>
Date:       2016-06-16 20:52:31
Message-ID: E1bDeH9-0004mw-II () scm ! kde ! org
[Download RAW message or body]

Git commit 61e54f3a221251d0d950066f0f894af50b1c05a6 by Allen Winter.
Committed on 16/06/2016 at 20:52.
Pushed by winterz into branch 'master'.

improve the markdown in the README's

M  +17   -18   checks/level0/README-container-anti-pattern.md
M  +17   -18   checks/level0/README-qstring-arg.md
M  +1    -1    checks/level0/README-qstring-insensitive-allocation.md
M  +6    -6    checks/level0/README-qstring-ref.md
M  +14   -14   checks/level0/README-temporary-iterator.md
M  +8    -9    checks/level0/README-wrong-qglobalstatic.md
M  +8    -8    checks/level1/README-auto-unexpected-qstringbuilder.md
M  +1    -2    checks/level1/README-qdeleteall.md
M  +16   -17   checks/level2/README-container-inside-loop.md
M  +3    -3    checks/level2/README-function-args-by-ref.md
M  +3    -3    checks/level2/README-function-args-by-value.md
M  +8    -11   checks/level2/README-implicit-casts.md
M  +1    -1    checks/level2/README-old-style-connect.md
M  +22   -19   checks/level2/README-qstring-allocations.md
M  +5    -7    checks/level2/README-reserve-candidates.md
M  +1    -1    checks/level2/README-rule-of-three.md
M  +2    -2    checks/level3/README-bogus-dynamic-cast.md
M  +1    -1    checks/level3/README-copyable-polymorphic.md
M  +5    -6    checks/level3/README-detaching-member.md

http://commits.kde.org/clazy/61e54f3a221251d0d950066f0f894af50b1c05a6

diff --git a/checks/level0/README-container-anti-pattern.md \
b/checks/level0/README-container-anti-pattern.md index c31a39e..7588e57 100644
--- a/checks/level0/README-container-anti-pattern.md
+++ b/checks/level0/README-container-anti-pattern.md
@@ -4,22 +4,21 @@ Finds when temporary containers are being created needlessly.
 These cases are usually easy to fix by using iterators, avoiding memory allocations.
 
 Matches code like:
-```
-{QMap, QHash, QSet}.values().*
-{QMap, QHash}.keys().*
-{QVector, QSet}.toList().*
-QList::toVector().*
-QSet::intersect(other).isEmpty()
-for (auto i : {QHash, QMap}.values()) {}
-foreach (auto i, {QHash, QMap}.values()) {}
-```
+
+    {QMap, QHash, QSet}.values().*
+    {QMap, QHash}.keys().*
+    {QVector, QSet}.toList().*
+    QList::toVector().*
+    QSet::intersect(other).isEmpty()
+    for (auto i : {QHash, QMap}.values()) {}
+    foreach (auto i, {QHash, QMap}.values()) {}
+
 #### Example
-```
-set.toList()[0]; // use set.constFirst() instead
-hash.values().size(); // Use hash.size() instead
-hash.keys().contains(); // Use hash.contains() instead
-hash.values().contains(); // Use hash.find instead
-map.values(k).foo ; // Use QMap::equal_range(k) instead
-for (auto i : hash.values()) {} // Iterate the hash directly instead: for (auto i : \
                hash) {}
-QSet::intersect(other).isEmpty() // Use QSet::intersects() instead, avoiding memory \
                allocations and iterations, since Qt 5.6
-```
+
+    set.toList()[0]; // use set.constFirst() instead
+    hash.values().size(); // Use hash.size() instead
+    hash.keys().contains(); // Use hash.contains() instead
+    hash.values().contains(); // Use hash.find instead
+    map.values(k).foo ; // Use QMap::equal_range(k) instead
+    for (auto i : hash.values()) {} // Iterate the hash directly instead: for (auto \
i : hash) {} +    QSet::intersect(other).isEmpty() // Use QSet::intersects() instead, \
                avoiding memory allocations and iterations, since Qt 5.6
diff --git a/checks/level0/README-qstring-arg.md \
b/checks/level0/README-qstring-arg.md index dca61c6..819a97c 100644
--- a/checks/level0/README-qstring-arg.md
+++ b/checks/level0/README-qstring-arg.md
@@ -2,13 +2,13 @@
 
 Implements two warnings:
 
-1) Detects when you're using chained `QString::arg()` calls and should instead use \
                the multi-arg overload to save memory allocations
-```
-    QString("%1 %2").arg(a).arg(b);
-    QString("%1 %2").arg(a, b); // one less temporary heap allocation
-```
-2) Detects when you're using misleading `QString::arg()` overloads
-```
+1. Detects when you're using chained `QString::arg()` calls and should instead use \
the multi-arg overload to save memory allocations +
+        QString("%1 %2").arg(a).arg(b);
+        QString("%1 %2").arg(a, b); // one less temporary heap allocation
+
+2. Detects when you're using misleading `QString::arg()` overloads
+
         QString arg(qlonglong a, int fieldwidth = 0, int base = 10, QChar fillChar = \
                QLatin1Char(' ')) const
         QString arg(qulonglong a, int fieldwidth = 0, int base = 10, QChar fillChar \
                = QLatin1Char(' ')) const
         QString arg(long a, int fieldwidth = 0, int base=10, QChar fillChar = \
QLatin1Char(' ')) const @@ -21,20 +21,19 @@ Implements two warnings:
         QString arg(char a, int fieldWidth = 0, QChar fillChar = QLatin1Char(' ')) \
                const
         QString arg(QChar a, int fieldWidth = 0, QChar fillChar = QLatin1Char(' ')) \
                const
         QString arg(const QString &a, int fieldWidth = 0, QChar fillChar = \
                QLatin1Char(' ')) const
-```
+
 because they are commonly misused, for example:
-```
+
         int hours = ...;
         int minutes = ...;
         // This won't do what you think it would at first glance.
         QString s("The time is %1:%2").arg(hours, minutes);
-```
+
 To reduce false positives, some cases won't be warned about:
-```
-str.arg(hours, 2); // User explicitly used a integer literal, it's probably fine
-str.arg(foo); // We're only after cases where the second argument (or further) is \
                specified, so this is safe
-`str.arg(foo, width);` // Second argument is named width, or contains the name \
                "width", it's safe. Same for third argument and "base".
-```
-
-Using these misleading overloads is perfectly valid, so only warning 1) is enabled \
                by default.
-To enable warning 2: `export CLAZY_EXTRA_OPTIONS="qstring-arg-fillChar-overloads"`
+
+        str.arg(hours, 2); // User explicitly used a integer literal, it's probably \
fine +        str.arg(foo); // We're only after cases where the second argument (or \
further) is specified, so this is safe +        str.arg(foo, width); // Second \
argument is named width, or contains the name "width", it's safe. Same for third \
argument and "base". +
+Using these misleading overloads is perfectly valid, so only warning (1) is enabled \
by default. +To enable warning (2), `export \
                CLAZY_EXTRA_OPTIONS="qstring-arg-fillChar-overloads"`
diff --git a/checks/level0/README-qstring-insensitive-allocation.md \
b/checks/level0/README-qstring-insensitive-allocation.md index 7e12245..d3b2a7e \
                100644
--- a/checks/level0/README-qstring-insensitive-allocation.md
+++ b/checks/level0/README-qstring-insensitive-allocation.md
@@ -9,4 +9,4 @@ Matches any of the following cases:
 
 #### Pitfalls
 `Qt::CaseInsensitive` is different from `QString::toLower()` comparison for a few \
                code points, but it
-should be very rare: \
http://lists.qt-project.org/pipermail/development/2016-February/024776.html +should \
be very rare: <http://lists.qt-project.org/pipermail/development/2016-February/024776.html>
                
diff --git a/checks/level0/README-qstring-ref.md \
b/checks/level0/README-qstring-ref.md index 9529777..7dcf05e 100644
--- a/checks/level0/README-qstring-ref.md
+++ b/checks/level0/README-qstring-ref.md
@@ -3,15 +3,15 @@
 Finds places where `QString::fooRef()` should be used instead of `QString::foo()`, \
to avoid temporary heap allocations.  
 #### Example
-```
-str.mid(5).toInt(ok) // BAD
-```
-```
-str.midRef(5).toInt(ok) // GOOD
-```
+
+    str.mid(5).toInt(ok) // BAD
+
+    str.midRef(5).toInt(ok) // GOOD
+
 Where `mid` can be any of: `mid`, `left`, `right`.
 And `toInt()` can be any of: `compare`, `contains`, `count`, `startsWith`, \
`endsWith`, `indexOf`, `isEmpty`, `isNull`, `lastIndexOf`, `length`, `size`, `to*`, \
`trimmed`  
 #### FixIts
+
 Fixing the above cases can be automated with:
 `export CLAZY_FIXIT="fix-missing-qstringref"`
diff --git a/checks/level0/README-temporary-iterator.md \
b/checks/level0/README-temporary-iterator.md index 2719d49..c9dcd77 100644
--- a/checks/level0/README-temporary-iterator.md
+++ b/checks/level0/README-temporary-iterator.md
@@ -3,20 +3,20 @@
 Detects when you're using using functions returning iterators (eg. `begin()` or \
`end()`) on a temporary container.  
 #### Example
-```
-// temporary list returned by function
-QList<type> getList()
-{
-  QList<type> list;
-  ... add some items to list ...
-  return list;
-}
 
-// Will cause a crash if iterated using:
+    // temporary list returned by function
+    QList<type> getList()
+    {
+        QList<type> list;
+        ... add some items to list ...
+        return list;
+    }
+
+    // Will cause a crash if iterated using:
+
+    for (QList<type>::iterator it = getList().begin(); it != getList().end(); ++it)
+    {
+      ...
+    }
 
-for (QList<type>::iterator it = getList().begin(); it != getList().end(); ++it)
-{
-  ...
-}
-```
 because the end iterator was returned from a different container object than the \
                begin iterator.
diff --git a/checks/level0/README-wrong-qglobalstatic.md \
b/checks/level0/README-wrong-qglobalstatic.md index d1950cc..1a6590a 100644
--- a/checks/level0/README-wrong-qglobalstatic.md
+++ b/checks/level0/README-wrong-qglobalstatic.md
@@ -4,12 +4,11 @@ Finds `Q_GLOBAL_STATIC`s being used with trivial types.
 This is unnecessary and creates more code bloat.
 
 #### Example:
-```
-struct Trivial
-{
-    int v;
-};
-
-Q_GLOBAL_STATIC(Trivial, t); // Wrong
-static Trivial t; // Correct
-```
+
+    struct Trivial
+    {
+        int v;
+    };
+
+    Q_GLOBAL_STATIC(Trivial, t); // Wrong
+    static Trivial t; // Correct
diff --git a/checks/level1/README-auto-unexpected-qstringbuilder.md \
b/checks/level1/README-auto-unexpected-qstringbuilder.md index 819c0f9..7170661 \
                100644
--- a/checks/level1/README-auto-unexpected-qstringbuilder.md
+++ b/checks/level1/README-auto-unexpected-qstringbuilder.md
@@ -3,13 +3,13 @@
 Finds places where auto is deduced to be `QStringBuilder` instead of `QString`, \
which introduces crashes.  
 #### Example
-```
-#define QT_USE_QSTRINGBUILDER
-#include <QtCore/QString>
-(...)
-const auto path = "hello " +  QString::fromLatin1("world");
-qDebug() << path; // CRASH
-```
+
+    #define QT_USE_QSTRINGBUILDER
+    #include <QtCore/QString>
+    (...)
+    const auto path = "hello " +  QString::fromLatin1("world");
+    qDebug() << path; // CRASH
 
 #### Fixits
-`export CLAZY_FIXIT="fix-auto-unexpected-qstringbuilder"`
+
+    export CLAZY_FIXIT="fix-auto-unexpected-qstringbuilder"
diff --git a/checks/level1/README-qdeleteall.md b/checks/level1/README-qdeleteall.md
index 0ebc389..3baea85 100644
--- a/checks/level1/README-qdeleteall.md
+++ b/checks/level1/README-qdeleteall.md
@@ -3,7 +3,7 @@ Finds places where a call to `qDeleteAll()` has a redundant \
`values()` or `keys(  Those calls create a temporary `QList<int>` and allocate \
memory.  
 #### Example
-```
+
     QSet<Cookies> set;
 
     // BAD: Unneeded container iteration and memory allocation to construct list of \
values @@ -11,7 +11,6 @@ Those calls create a temporary `QList<int>` and allocate \
memory.  
     // GOOD: Unneeded container iteration and memory allocation to construct list of \
values  qDeleteAll(set);
-```
 
 #### Pitfalls
 
diff --git a/checks/level2/README-container-inside-loop.md \
b/checks/level2/README-container-inside-loop.md index 2d9e53a..875851a 100644
--- a/checks/level2/README-container-inside-loop.md
+++ b/checks/level2/README-container-inside-loop.md
@@ -4,24 +4,23 @@ Finds places defining containers inside loops.
 Defining them outside the loop and using `resize(0)` will save memory allocations.
 
 #### Example
-```
-// This will allocate memory at least N times:
-for (int i = 0; i < N; ++i) {
-    QVector<int> v;
-    (...)
-    v.append(bar);
-    (...)
-}
 
-// This will reuse previously allocated memory:
-QVector<int> v;
-for (int i = 0; i < N; ++i) {
-    v.resize(0); // resize(0) preserves capacity, unlike QVector::clear()
-    (...)
-    v.append(bar);
-    (...)
-}
-```
+    // This will allocate memory at least N times:
+    for (int i = 0; i < N; ++i) {
+        QVector<int> v;
+        (...)
+        v.append(bar);
+        (...)
+    }
+
+    // This will reuse previously allocated memory:
+    QVector<int> v;
+    for (int i = 0; i < N; ++i) {
+        v.resize(0); // resize(0) preserves capacity, unlike QVector::clear()
+        (...)
+        v.append(bar);
+        (...)
+    }
 
 #### Supported containers
 
diff --git a/checks/level2/README-function-args-by-ref.md \
b/checks/level2/README-function-args-by-ref.md index 762b1f6..bbbd0b1 100644
--- a/checks/level2/README-function-args-by-ref.md
+++ b/checks/level2/README-function-args-by-ref.md
@@ -8,6 +8,6 @@ This check will ignore shared pointers, you're on your own. Most of \
the times pa  Note that in some cases there might be false-positives: There's a \
pattern where you pass a movable type  by value and then move from it in the ctor \
initialization list. This check does not honour that and warns.  
-[1] http://www.macieira.org/blog/2012/02/the-value-of-passing-by-value/
-[2] http://en.cppreference.com/w/cpp/concept/TriviallyCopyable
-[3] http://www.cplusplus.com/reference/type_traits/is_trivially_destructible/
+- [1] <http://www.macieira.org/blog/2012/02/the-value-of-passing-by-value/>
+- [2] <http://en.cppreference.com/w/cpp/concept/TriviallyCopyable>
+- [3] <http://www.cplusplus.com/reference/type_traits/is_trivially_destructible/>
diff --git a/checks/level2/README-function-args-by-value.md \
b/checks/level2/README-function-args-by-value.md index 8587e0d..1e96e4a 100644
--- a/checks/level2/README-function-args-by-value.md
+++ b/checks/level2/README-function-args-by-value.md
@@ -5,6 +5,6 @@ Types with sizeof <= 16 bytes [1] which are trivially-copyable [2] \
and trivially  
 Only fix these warnings if you're sure that the value would be passed in a CPU \
register instead on the stack.  
-[1] http://www.macieira.org/blog/2012/02/the-value-of-passing-by-value/
-[2] http://en.cppreference.com/w/cpp/concept/TriviallyCopyable
-[3] http://www.cplusplus.com/reference/type_traits/is_trivially_destructible/
+- [1] <http://www.macieira.org/blog/2012/02/the-value-of-passing-by-value/>
+- [2] <http://en.cppreference.com/w/cpp/concept/TriviallyCopyable>
+- [3] <http://www.cplusplus.com/reference/type_traits/is_trivially_destructible/>
diff --git a/checks/level2/README-implicit-casts.md \
b/checks/level2/README-implicit-casts.md index 633a1c9..e4a94cc 100644
--- a/checks/level2/README-implicit-casts.md
+++ b/checks/level2/README-implicit-casts.md
@@ -4,18 +4,15 @@ Finds places with unwanted implicit casts in function calls.
 
 #### Supported cases
 
-1. pointer->bool cast in functions accepting bool and pointers, example:
-```
-   MyWidget(bool b, QObject *parent = nullptr) {}
-   ...
-   MyWidget(parent);
-```
+* pointer->bool cast in functions accepting bool and pointers, example:
 
-2. bool->int
-```
-void func(int duration);
-func(someBool);
-```
+        MyWidget(bool b, QObject *parent = nullptr) {}
+        MyWidget(parent);
+
+* bool->int
+
+        void func(int duration);
+        func(someBool);
 
 This case is disabled due to false positives when calling C code.
 You can uncomment it and recompile clazy as it usually finds bugs.
diff --git a/checks/level2/README-old-style-connect.md \
b/checks/level2/README-old-style-connect.md index c63ad54..bd643e4 100644
--- a/checks/level2/README-old-style-connect.md
+++ b/checks/level2/README-old-style-connect.md
@@ -6,7 +6,7 @@ Old style syntax (`SIGNAL`/`SLOT`) is much slower than using pointer \
to member s  Here's a non-exhaustive list of caveats of PMF connects:
 - You can't disconnect with new-syntax if the connect was made with old-syntax (and \
                vice-versa)
 - You can't disconnect from a static slot with new-syntax (although connecting \
                works!)
-- Difference in behaviour when calling slots of partially destroyed objects \
(https://codereview.qt-project.org/#/c/83800) +- Difference in behaviour when calling \
slots of partially destroyed objects (<https://codereview.qt-project.org/#/c/83800>)  \
  #### Fixits
 
diff --git a/checks/level2/README-qstring-allocations.md \
b/checks/level2/README-qstring-allocations.md index 9402417..fda4278 100644
--- a/checks/level2/README-qstring-allocations.md
+++ b/checks/level2/README-qstring-allocations.md
@@ -3,31 +3,33 @@
 Finds places with unneeded memory allocations due to temporary `QString`s.
 
 Here's a summary of usages that allocate:
-```
-    1. QString s = "foo"; // Allocates, use QStringLiteral("foo") instead
 
-    2. QString s = QLatin1String("foo"); // Allocates, use QStringLiteral("foo") \
                instead
-    2.1) QString s = QLatin1String(""); // No allocation. QString is optimized for \
this case, so it's safe for empty literals +1. `QString s = "foo"; // Allocates, use \
QStringLiteral("foo") instead`  
-    3. QString s = QStringLiteral("foo"); // No allocation
+2. `QString s = QLatin1String("foo"); // Allocates, use QStringLiteral("foo") \
instead`  
-    4. QString s = QString::fromLatin1("foo"); // Allocates, use QStringLiteral
+    2.1 `QString s = QLatin1String(""); // No allocation. QString is optimized for \
this case, so it's safe for empty literals`  
-    5. QString s = QString::fromUtf8("foo"); // Allocates, use QStringLiteral
+3. `QString s = QStringLiteral("foo"); // No allocation`
 
-    6. s == "foo" // Allocates, use QLatin1String
+4. `QString s = QString::fromLatin1("foo"); // Allocates, use QStringLiteral`
 
-    7. s == QLatin1String("foo) // No allocation
+5. `QString s = QString::fromUtf8("foo"); // Allocates, use QStringLiteral`
 
-    8. s == QStringLiteral("foo") // No allocation
+6. `s == "foo" // Allocates, use QLatin1String`
 
-    9. QString {"append", "compare", "endsWith", "startsWith", "indexOf", "insert",
-                "lastIndexOf", "prepend", "replace", "contains" } // They all have \
QLatin1String overloads, so passing a QLatin1String is ok. +7. `s == \
QLatin1String("foo) // No allocation` +
+8. `s == QStringLiteral("foo") // No allocation`
+
+9. `QString {"append", "compare", "endsWith", "startsWith", "indexOf", "insert",`
+   `         "lastIndexOf", "prepend", "replace", "contains" } // They all have \
QLatin1String overloads, so passing a QLatin1String is ok.` +
+10. `QString::fromLatin1("foo %1").arg(bar) // Allocates twice, replacing with \
QStringLiteral makes it allocate only once.`  
-    10. QString::fromLatin1("foo %1").arg(bar) // Allocates twice, replacing with \
                QStringLiteral makes it allocate only onece.
-```
 
 #### Fixits
+
     fix-qlatin1string-allocations        // To replace QLatin1String with \
                QStringLiteral only where it was allocating before
     fix-fromLatin1_fromUtf8-allocations  // To replace fromLatin1() and fromUtf8() \
                so it doesn't allocate
     fix-fromCharPtrAllocations           // To replace raw string literals so it \
doesn't allocate @@ -37,10 +39,11 @@ Here's a summary of usages that allocate:
 
 #### Pitfalls
 
-1. `QStringLiteral` might make your app crash at exit if plugins are involved.
+- `QStringLiteral` might make your app crash at exit if plugins are involved.
 See:
-https://blogs.kde.org/2015/11/05/qregexp-qstringliteral-crash-exit and
-http://lists.qt-project.org/pipermail/development/2015-November/023681.html
+<https://blogs.kde.org/2015/11/05/qregexp-qstringliteral-crash-exit> and
+<http://lists.qt-project.org/pipermail/development/2015-November/023681.html>
+
+- Also note that MSVC crashes when `QStringLiteral` is used inside initializer \
lists. For that reason no warning or fixit is emitted for this case unless you set an \
env variable:  
-2. Also note that MSVC crashes when `QStringLiteral` is used inside initializer \
lists. For that reason no warning or fixit is emitted for this case unless you set an \
                env variable:
-        `export CLAZY_EXTRA_OPTIONS="qstring-allocations-no-msvc-compat"`
+        export CLAZY_EXTRA_OPTIONS="qstring-allocations-no-msvc-compat"
diff --git a/checks/level2/README-reserve-candidates.md \
b/checks/level2/README-reserve-candidates.md index 8ad3c9d..6a2c687 100644
--- a/checks/level2/README-reserve-candidates.md
+++ b/checks/level2/README-reserve-candidates.md
@@ -6,14 +6,14 @@ Whenever you know how many elements a container will hold you \
should reserve  space in order to avoid repeated memory allocations.
 
 #### Trivial example missing reserve()
-```
+
     QList<int> ages;
     // list.reserve(people.size());
     for (auto person : people)
         list << person.age();
-```
+
 Example where reserve shouldn't be used:
-```
+
     QLost<int> list;
     for (int i = 0; i < 1000; ++i) {
         // reserve() will be called 1000 times, meaning 1000 allocations
@@ -23,13 +23,11 @@ Example where reserve shouldn't be used:
             list << m;
         }
     }
-```
+
 #### Supported containers
 `QVector`, `std::vector`, `QList`, `QSet` and `QVarLengthArray`
 
-Pitfalls
---------
-
+#### Pitfalls
 Rate of false-positives is around 15%. Don't go blindly calling `reserve()` without \
proper analysis.  In doubt don't use it, all containers have a growth curve and \
usually only do log(N) allocations  when you append N items.
diff --git a/checks/level2/README-rule-of-three.md \
b/checks/level2/README-rule-of-three.md index bc97ac1..9e9f64e 100644
--- a/checks/level2/README-rule-of-three.md
+++ b/checks/level2/README-rule-of-three.md
@@ -1,7 +1,7 @@
 # rule-of-three
 
 Implements the rule of three:
-https://en.wikipedia.org/wiki/Rule_of_three_%28C%2B%2B_programming%29
+<https://en.wikipedia.org/wiki/Rule_of_three_%28C%2B%2B_programming%29>
 
 #### Exceptions
 To reduce the amount of warnings, these cases won't emit warnings:
diff --git a/checks/level3/README-bogus-dynamic-cast.md \
b/checks/level3/README-bogus-dynamic-cast.md index 3cc0e7d..086b23b 100644
--- a/checks/level3/README-bogus-dynamic-cast.md
+++ b/checks/level3/README-bogus-dynamic-cast.md
@@ -3,8 +3,8 @@
 Finds places where a dynamic cast is redundant.
 
 #### Example
-```
+
     Foo *a = ...;
     Foo *b = dynamic_cast<Foo*>(a);
-```
+
 or when dynamic casting to base class, which is uneeded.
diff --git a/checks/level3/README-copyable-polymorphic.md \
b/checks/level3/README-copyable-polymorphic.md index 18d3521..f8a9e04 100644
--- a/checks/level3/README-copyable-polymorphic.md
+++ b/checks/level3/README-copyable-polymorphic.md
@@ -3,4 +3,4 @@
 Finds polymorphic classes without `Q_DISABLE_COPY`.
 These classes are usually vulnerable to slicing [1].
 
-[1] https://en.wikipedia.org/wiki/Object_slicing
+[1] <https://en.wikipedia.org/wiki/Object_slicing>
diff --git a/checks/level3/README-detaching-member.md \
b/checks/level3/README-detaching-member.md index d252bba..d5ba9c8 100644
--- a/checks/level3/README-detaching-member.md
+++ b/checks/level3/README-detaching-member.md
@@ -3,12 +3,11 @@
 Finds places where member containers are potentially detached.
 
 #### Example
-```
-QString MyClass::myMethod()
-{
-    return m_container.first(); // Should be constFirst()
-}
-```
+
+    QString MyClass::myMethod()
+    {
+        return m_container.first(); // Should be constFirst()
+    }
 
 #### Pitfalls
 This check is disabled by default as it reports too many false positives for now.


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic