Skip to content

Commit 4c3a9ef

Browse files
nyalldawson3nids
authored andcommittedMay 28, 2018
Ensure that class \brief comes before \since (#7081)
Otherwise it breaks the Python docstrings, which require the brief to come first
1 parent facf7a2 commit 4c3a9ef

17 files changed

+30
-22
lines changed
 

‎python/analysis/auto_generated/network/qgsgraph.sip.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
class QgsGraphEdge
1515
{
1616
%Docstring
17+
This class implements a graph edge
1718

1819
.. versionadded:: 3.0
19-
This class implements a graph edge
2020
%End
2121

2222
%TypeHeaderCode

‎python/analysis/auto_generated/network/qgsnetworkdistancestrategy.sip.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
class QgsNetworkDistanceStrategy : QgsNetworkStrategy
1212
{
1313
%Docstring
14-
15-
.. versionadded:: 3.0
1614
Strategy for calculating edge cost based on its length. Should be
1715
used for finding shortest path between two points.
16+
17+
.. versionadded:: 3.0
1818
%End
1919

2020
%TypeHeaderCode

‎python/analysis/auto_generated/network/qgsnetworkstrategy.sip.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@
1818
class QgsNetworkStrategy
1919
{
2020
%Docstring
21-
22-
.. versionadded:: 3.0
2321
QgsNetworkStrategy defines strategy used for calculation of the edge cost. For example it can
2422
take into account travel distance, amount of time or money. Currently there are two strategies
2523
implemented in the analysis library: QgsNetworkDistanceStrategy and QgsNetworkSpeedStrategy.
2624
QgsNetworkStrategy implemented using "strategy" design pattern.
25+
26+
.. versionadded:: 3.0
2727
%End
2828

2929
%TypeHeaderCode

‎python/analysis/auto_generated/network/qgsvectorlayerdirector.sip.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
class QgsVectorLayerDirector : QgsGraphDirector
1414
{
1515
%Docstring
16+
Determine making the graph from vector line layer
1617

1718
.. versionadded:: 3.0
18-
Determine making the graph from vector line layer
1919
%End
2020

2121
%TypeHeaderCode

‎python/analysis/auto_generated/processing/qgsnativealgorithms.sip.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
class QgsNativeAlgorithms: QgsProcessingProvider
1313
{
1414
%Docstring
15+
Native c++ processing algorithm provider.
1516

1617
.. versionadded:: 3.0
17-
Native c++ processing algorithm provider.
1818
%End
1919

2020
%TypeHeaderCode

‎python/core/auto_generated/annotations/qgsannotation.sip.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ class QgsAnnotation : QObject
1414
{
1515
%Docstring
1616

17-
.. versionadded:: 3.0
18-
1917
Abstract base class for annotation items which are drawn over a map.
2018

2119
QgsAnnotation is an abstract base class for map annotation items. These annotations can be
@@ -26,6 +24,8 @@ QgsCoordinateReferenceSystem, which can be determined by calling mapPositionCrs(
2624

2725
Derived classes should implement their custom painting routines within
2826
a renderAnnotation() override.
27+
28+
.. versionadded:: 3.0
2929
%End
3030

3131
%TypeHeaderCode

‎python/core/auto_generated/annotations/qgsannotationmanager.sip.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ class QgsAnnotationManager : QObject
1414
{
1515
%Docstring
1616

17-
.. versionadded:: 3.0
18-
1917
Manages storage of a set of QgsAnnotation annotation objects.
2018

2119
QgsAnnotationManager handles the storage, serializing and deserializing
@@ -24,6 +22,8 @@ rather accessed through a QgsProject via :py:func:`QgsProject.annotationManager(
2422

2523
QgsAnnotationManager retains ownership of all the annotations contained
2624
in the manager.
25+
26+
.. versionadded:: 3.0
2727
%End
2828

2929
%TypeHeaderCode

‎python/core/auto_generated/layout/qgslayoutmanager.sip.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ class QgsLayoutManager : QObject
1414
{
1515
%Docstring
1616

17-
.. versionadded:: 3.0
18-
1917
Manages storage of a set of layouts.
2018

2119
QgsLayoutManager handles the storage, serializing and deserializing
@@ -24,6 +22,8 @@ rather accessed through a QgsProject via :py:func:`QgsProject.layoutManager()`
2422

2523
QgsLayoutManager retains ownership of all the layouts contained
2624
in the manager.
25+
26+
.. versionadded:: 3.0
2727
%End
2828

2929
%TypeHeaderCode

‎scripts/sipify.pl

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
my $RETURN_TYPE = '';
6565
my $IS_OVERRIDE = 0;
6666
my $IF_FEATURE_CONDITION = '';
67+
my $FOUND_SINCE = 0;
6768
my %QFLAG_HASH;
6869

6970
my $LINE_COUNT = @INPUT_LINES;
@@ -208,7 +209,10 @@ sub processDoxygenLine {
208209

209210
if ( $line =~ m/^\s*[\\@]brief/){
210211
$line =~ s/[\\@]brief\s*//;
211-
$INDENT = '';
212+
if ( $FOUND_SINCE eq 1 ) {
213+
exit_with_error("$headerfile\:\:$LINE_IDX Since annotation must come after brief")
214+
}
215+
$FOUND_SINCE = 0;
212216
if ( $line =~ m/^\s*$/ ){
213217
return "";
214218
}
@@ -220,6 +224,7 @@ sub processDoxygenLine {
220224
}
221225
if ( $line =~ m/\\since .*?([\d\.]+)/i ) {
222226
$INDENT = '';
227+
$FOUND_SINCE = 1;
223228
return "\n.. versionadded:: $1\n";
224229
}
225230
if ( $line =~ m/\\deprecated (.*)/i ) {
@@ -424,6 +429,7 @@ sub detect_comment_block{
424429
$INDENT = '';
425430
$COMMENT_CODE_SNIPPET = 0;
426431
$COMMENT_LAST_LINE_NOTE_WARNING = 0;
432+
$FOUND_SINCE = 0;
427433
if ( $LINE =~ m/^\s*\/\*/ || $args{strict_mode} == UNSTRICT && $LINE =~ m/\/\*/ ){
428434
dbg_info("found comment block");
429435
do {no warnings 'uninitialized';

‎src/analysis/network/qgsgraph.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ class QgsGraphVertex;
3737
/**
3838
* \ingroup analysis
3939
* \class QgsGraphEdge
40-
* \since QGIS 3.0
4140
* \brief This class implements a graph edge
41+
* \since QGIS 3.0
4242
*/
4343
class ANALYSIS_EXPORT QgsGraphEdge
4444
{

‎src/analysis/network/qgsnetworkdistancestrategy.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@
2222
/**
2323
* \ingroup analysis
2424
* \class QgsNetworkDistanceStrategy
25-
* \since QGIS 3.0
2625
* \brief Strategy for calculating edge cost based on its length. Should be
2726
* used for finding shortest path between two points.
27+
* \since QGIS 3.0
2828
*/
2929
class ANALYSIS_EXPORT QgsNetworkDistanceStrategy : public QgsNetworkStrategy
3030
{

‎src/analysis/network/qgsnetworkstrategy.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@
3232
/**
3333
* \ingroup analysis
3434
* \class QgsNetworkStrategy
35-
* \since QGIS 3.0
3635
* \brief QgsNetworkStrategy defines strategy used for calculation of the edge cost. For example it can
3736
* take into account travel distance, amount of time or money. Currently there are two strategies
3837
* implemented in the analysis library: QgsNetworkDistanceStrategy and QgsNetworkSpeedStrategy.
3938
* QgsNetworkStrategy implemented using "strategy" design pattern.
39+
* \since QGIS 3.0
4040
*/
4141

4242
class ANALYSIS_EXPORT QgsNetworkStrategy

‎src/analysis/network/qgsvectorlayerdirector.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ class QgsFeatureSource;
2727
/**
2828
* \ingroup analysis
2929
* \class QgsVectorLayerDirector
30-
* \since QGIS 3.0
3130
* \brief Determine making the graph from vector line layer
31+
* \since QGIS 3.0
3232
*/
3333
class ANALYSIS_EXPORT QgsVectorLayerDirector : public QgsGraphDirector
3434
{

‎src/analysis/processing/qgsnativealgorithms.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
/**
2626
* \ingroup analysis
2727
* \class QgsNativeAlgorithms
28-
* \since QGIS 3.0
2928
* \brief Native c++ processing algorithm provider.
29+
* \since QGIS 3.0
3030
*/
3131
class ANALYSIS_EXPORT QgsNativeAlgorithms: public QgsProcessingProvider
3232
{

‎src/core/annotations/qgsannotation.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
/**
3131
* \ingroup core
3232
* \class QgsAnnotation
33-
* \since QGIS 3.0
3433
*
3534
* \brief Abstract base class for annotation items which are drawn over a map.
3635
*
@@ -42,6 +41,8 @@
4241
*
4342
* Derived classes should implement their custom painting routines within
4443
* a renderAnnotation() override.
44+
*
45+
* \since QGIS 3.0
4546
*/
4647

4748
class CORE_EXPORT QgsAnnotation : public QObject

‎src/core/annotations/qgsannotationmanager.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ class QgsAnnotation;
2929
/**
3030
* \ingroup core
3131
* \class QgsAnnotationManager
32-
* \since QGIS 3.0
3332
*
3433
* \brief Manages storage of a set of QgsAnnotation annotation objects.
3534
*
@@ -39,6 +38,8 @@ class QgsAnnotation;
3938
*
4039
* QgsAnnotationManager retains ownership of all the annotations contained
4140
* in the manager.
41+
*
42+
* \since QGIS 3.0
4243
*/
4344
class CORE_EXPORT QgsAnnotationManager : public QObject
4445
{

‎src/core/layout/qgslayoutmanager.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ class QgsPrintLayout;
2727
/**
2828
* \ingroup core
2929
* \class QgsLayoutManager
30-
* \since QGIS 3.0
3130
*
3231
* \brief Manages storage of a set of layouts.
3332
*
@@ -37,6 +36,7 @@ class QgsPrintLayout;
3736
*
3837
* QgsLayoutManager retains ownership of all the layouts contained
3938
* in the manager.
39+
* \since QGIS 3.0
4040
*/
4141

4242
class CORE_EXPORT QgsLayoutManager : public QObject

0 commit comments

Comments
 (0)
Please sign in to comment.