Skip to content

Commit

Permalink
Ensure that class \brief comes before \since (#7081)
Browse files Browse the repository at this point in the history
Otherwise it breaks the Python docstrings, which require
the brief to come first
  • Loading branch information
nyalldawson authored and 3nids committed May 28, 2018
1 parent facf7a2 commit 4c3a9ef
Show file tree
Hide file tree
Showing 17 changed files with 30 additions and 22 deletions.
2 changes: 1 addition & 1 deletion python/analysis/auto_generated/network/qgsgraph.sip.in
Expand Up @@ -14,9 +14,9 @@
class QgsGraphEdge
{
%Docstring
This class implements a graph edge

.. versionadded:: 3.0
This class implements a graph edge
%End

%TypeHeaderCode
Expand Down
Expand Up @@ -11,10 +11,10 @@
class QgsNetworkDistanceStrategy : QgsNetworkStrategy
{
%Docstring

.. versionadded:: 3.0
Strategy for calculating edge cost based on its length. Should be
used for finding shortest path between two points.

.. versionadded:: 3.0
%End

%TypeHeaderCode
Expand Down
Expand Up @@ -18,12 +18,12 @@
class QgsNetworkStrategy
{
%Docstring

.. versionadded:: 3.0
QgsNetworkStrategy defines strategy used for calculation of the edge cost. For example it can
take into account travel distance, amount of time or money. Currently there are two strategies
implemented in the analysis library: QgsNetworkDistanceStrategy and QgsNetworkSpeedStrategy.
QgsNetworkStrategy implemented using "strategy" design pattern.

.. versionadded:: 3.0
%End

%TypeHeaderCode
Expand Down
Expand Up @@ -13,9 +13,9 @@
class QgsVectorLayerDirector : QgsGraphDirector
{
%Docstring
Determine making the graph from vector line layer

.. versionadded:: 3.0
Determine making the graph from vector line layer
%End

%TypeHeaderCode
Expand Down
Expand Up @@ -12,9 +12,9 @@
class QgsNativeAlgorithms: QgsProcessingProvider
{
%Docstring
Native c++ processing algorithm provider.

.. versionadded:: 3.0
Native c++ processing algorithm provider.
%End

%TypeHeaderCode
Expand Down
4 changes: 2 additions & 2 deletions python/core/auto_generated/annotations/qgsannotation.sip.in
Expand Up @@ -14,8 +14,6 @@ class QgsAnnotation : QObject
{
%Docstring

.. versionadded:: 3.0

Abstract base class for annotation items which are drawn over a map.

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

Derived classes should implement their custom painting routines within
a renderAnnotation() override.

.. versionadded:: 3.0
%End

%TypeHeaderCode
Expand Down
Expand Up @@ -14,8 +14,6 @@ class QgsAnnotationManager : QObject
{
%Docstring

.. versionadded:: 3.0

Manages storage of a set of QgsAnnotation annotation objects.

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

QgsAnnotationManager retains ownership of all the annotations contained
in the manager.

.. versionadded:: 3.0
%End

%TypeHeaderCode
Expand Down
4 changes: 2 additions & 2 deletions python/core/auto_generated/layout/qgslayoutmanager.sip.in
Expand Up @@ -14,8 +14,6 @@ class QgsLayoutManager : QObject
{
%Docstring

.. versionadded:: 3.0

Manages storage of a set of layouts.

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

QgsLayoutManager retains ownership of all the layouts contained
in the manager.

.. versionadded:: 3.0
%End

%TypeHeaderCode
Expand Down
8 changes: 7 additions & 1 deletion scripts/sipify.pl
Expand Up @@ -64,6 +64,7 @@
my $RETURN_TYPE = '';
my $IS_OVERRIDE = 0;
my $IF_FEATURE_CONDITION = '';
my $FOUND_SINCE = 0;
my %QFLAG_HASH;

my $LINE_COUNT = @INPUT_LINES;
Expand Down Expand Up @@ -208,7 +209,10 @@ sub processDoxygenLine {

if ( $line =~ m/^\s*[\\@]brief/){
$line =~ s/[\\@]brief\s*//;
$INDENT = '';
if ( $FOUND_SINCE eq 1 ) {
exit_with_error("$headerfile\:\:$LINE_IDX Since annotation must come after brief")
}
$FOUND_SINCE = 0;
if ( $line =~ m/^\s*$/ ){
return "";
}
Expand All @@ -220,6 +224,7 @@ sub processDoxygenLine {
}
if ( $line =~ m/\\since .*?([\d\.]+)/i ) {
$INDENT = '';
$FOUND_SINCE = 1;
return "\n.. versionadded:: $1\n";
}
if ( $line =~ m/\\deprecated (.*)/i ) {
Expand Down Expand Up @@ -424,6 +429,7 @@ sub detect_comment_block{
$INDENT = '';
$COMMENT_CODE_SNIPPET = 0;
$COMMENT_LAST_LINE_NOTE_WARNING = 0;
$FOUND_SINCE = 0;
if ( $LINE =~ m/^\s*\/\*/ || $args{strict_mode} == UNSTRICT && $LINE =~ m/\/\*/ ){
dbg_info("found comment block");
do {no warnings 'uninitialized';
Expand Down
2 changes: 1 addition & 1 deletion src/analysis/network/qgsgraph.h
Expand Up @@ -37,8 +37,8 @@ class QgsGraphVertex;
/**
* \ingroup analysis
* \class QgsGraphEdge
* \since QGIS 3.0
* \brief This class implements a graph edge
* \since QGIS 3.0
*/
class ANALYSIS_EXPORT QgsGraphEdge
{
Expand Down
2 changes: 1 addition & 1 deletion src/analysis/network/qgsnetworkdistancestrategy.h
Expand Up @@ -22,9 +22,9 @@
/**
* \ingroup analysis
* \class QgsNetworkDistanceStrategy
* \since QGIS 3.0
* \brief Strategy for calculating edge cost based on its length. Should be
* used for finding shortest path between two points.
* \since QGIS 3.0
*/
class ANALYSIS_EXPORT QgsNetworkDistanceStrategy : public QgsNetworkStrategy
{
Expand Down
2 changes: 1 addition & 1 deletion src/analysis/network/qgsnetworkstrategy.h
Expand Up @@ -32,11 +32,11 @@
/**
* \ingroup analysis
* \class QgsNetworkStrategy
* \since QGIS 3.0
* \brief QgsNetworkStrategy defines strategy used for calculation of the edge cost. For example it can
* take into account travel distance, amount of time or money. Currently there are two strategies
* implemented in the analysis library: QgsNetworkDistanceStrategy and QgsNetworkSpeedStrategy.
* QgsNetworkStrategy implemented using "strategy" design pattern.
* \since QGIS 3.0
*/

class ANALYSIS_EXPORT QgsNetworkStrategy
Expand Down
2 changes: 1 addition & 1 deletion src/analysis/network/qgsvectorlayerdirector.h
Expand Up @@ -27,8 +27,8 @@ class QgsFeatureSource;
/**
* \ingroup analysis
* \class QgsVectorLayerDirector
* \since QGIS 3.0
* \brief Determine making the graph from vector line layer
* \since QGIS 3.0
*/
class ANALYSIS_EXPORT QgsVectorLayerDirector : public QgsGraphDirector
{
Expand Down
2 changes: 1 addition & 1 deletion src/analysis/processing/qgsnativealgorithms.h
Expand Up @@ -25,8 +25,8 @@
/**
* \ingroup analysis
* \class QgsNativeAlgorithms
* \since QGIS 3.0
* \brief Native c++ processing algorithm provider.
* \since QGIS 3.0
*/
class ANALYSIS_EXPORT QgsNativeAlgorithms: public QgsProcessingProvider
{
Expand Down
3 changes: 2 additions & 1 deletion src/core/annotations/qgsannotation.h
Expand Up @@ -30,7 +30,6 @@
/**
* \ingroup core
* \class QgsAnnotation
* \since QGIS 3.0
*
* \brief Abstract base class for annotation items which are drawn over a map.
*
Expand All @@ -42,6 +41,8 @@
*
* Derived classes should implement their custom painting routines within
* a renderAnnotation() override.
*
* \since QGIS 3.0
*/

class CORE_EXPORT QgsAnnotation : public QObject
Expand Down
3 changes: 2 additions & 1 deletion src/core/annotations/qgsannotationmanager.h
Expand Up @@ -29,7 +29,6 @@ class QgsAnnotation;
/**
* \ingroup core
* \class QgsAnnotationManager
* \since QGIS 3.0
*
* \brief Manages storage of a set of QgsAnnotation annotation objects.
*
Expand All @@ -39,6 +38,8 @@ class QgsAnnotation;
*
* QgsAnnotationManager retains ownership of all the annotations contained
* in the manager.
*
* \since QGIS 3.0
*/
class CORE_EXPORT QgsAnnotationManager : public QObject
{
Expand Down
2 changes: 1 addition & 1 deletion src/core/layout/qgslayoutmanager.h
Expand Up @@ -27,7 +27,6 @@ class QgsPrintLayout;
/**
* \ingroup core
* \class QgsLayoutManager
* \since QGIS 3.0
*
* \brief Manages storage of a set of layouts.
*
Expand All @@ -37,6 +36,7 @@ class QgsPrintLayout;
*
* QgsLayoutManager retains ownership of all the layouts contained
* in the manager.
* \since QGIS 3.0
*/

class CORE_EXPORT QgsLayoutManager : public QObject
Expand Down

0 comments on commit 4c3a9ef

Please sign in to comment.