Skip to content

Commit

Permalink
Fix incorrect returns docstring when doxygen \returns has extra trail…
Browse files Browse the repository at this point in the history
…ing spaces or uses tabs
  • Loading branch information
nyalldawson committed May 27, 2018
1 parent 0e75f6e commit 7a1a787
Show file tree
Hide file tree
Showing 24 changed files with 41 additions and 65 deletions.
Expand Up @@ -115,7 +115,7 @@ supported and is retrieved from the first 3D point amongst ``p1`` and
:param tolerance: The tolerance to use
:param acceptImproperIntersection: By default, this method returns true only if segments have proper intersection. If set true, returns also true if segments have improper intersection (end of one segment on other segment ; continuous segments).

:return: Whether the segments intersect
:return: Whether the segments intersect
* Example:
.. code-block:: python

Expand Down
4 changes: 1 addition & 3 deletions python/core/auto_generated/qgsattributeeditorelement.sip.in
Expand Up @@ -247,9 +247,7 @@ Creates a new attribute editor element which represents a field

int idx() const;
%Docstring
Returns the index of the field

:return:
Returns the index of the field.
%End

virtual QgsAttributeEditorElement *clone( QgsAttributeEditorElement *parent ) const /Factory/;
Expand Down
2 changes: 1 addition & 1 deletion python/core/auto_generated/qgscacheindex.sip.in
Expand Up @@ -61,7 +61,7 @@ it will return false.
value is true.
:param featureRequest: The feature request, for which this index is queried.

:return: True, if this index holds the information to answer the request.
:return: True, if this index holds the information to answer the request.
%End
};

Expand Down
6 changes: 3 additions & 3 deletions python/core/auto_generated/qgsfeatureiterator.sip.in
Expand Up @@ -76,7 +76,7 @@ need to implement!!

:param f: The feature to write to

:return: true if a feature was written to f
:return: true if a feature was written to f
%End

virtual bool nextFeatureFilterExpression( QgsFeature &f );
Expand All @@ -89,7 +89,7 @@ redirect this call to fetchFeature so the default check will be omitted.

:param f: The feature to write to

:return: true if a feature was written to f
:return: true if a feature was written to f
%End

virtual bool nextFeatureFilterFids( QgsFeature &f );
Expand All @@ -103,7 +103,7 @@ so the default check will be omitted.

:param f: The feature to write to

:return: true if a feature was written to f
:return: true if a feature was written to f
%End

void geometryToDestinationCrs( QgsFeature &feature, const QgsCoordinateTransform &transform ) const;
Expand Down
2 changes: 1 addition & 1 deletion python/core/auto_generated/qgsfield.sip.in
Expand Up @@ -259,7 +259,7 @@ Converts the provided variant to a compatible format

:param v: The value to convert

:return: True if the conversion was successful
:return: True if the conversion was successful
%End
%MethodCode
PyObject *sipParseErr = NULL;
Expand Down
2 changes: 1 addition & 1 deletion python/core/auto_generated/qgsfields.sip.in
Expand Up @@ -121,7 +121,7 @@ Returns if a field index is valid

:param i: Index of the field which needs to be checked

:return: True if the field exists
:return: True if the field exists
%End


Expand Down
6 changes: 1 addition & 5 deletions python/core/auto_generated/qgsmultirenderchecker.sip.in
Expand Up @@ -116,15 +116,11 @@ Test using renderer to generate the image to be compared.
QString report() const;
%Docstring
Returns a report for this test

:return: A report
%End

QString controlImagePath() const;
%Docstring
controlImagePath

:return:
Returns the path to the control images.
%End

static void drawBackground( QImage *image );
Expand Down
4 changes: 1 addition & 3 deletions python/core/auto_generated/qgsuserprofilemanager.sip.in
Expand Up @@ -106,9 +106,7 @@ Check if the root location has been set for the manager.

QStringList allProfiles() const;
%Docstring
A list of all found profile names.

:return:
Returns a list of all found profile names.
%End

bool profileExists( const QString &name ) const;
Expand Down
2 changes: 1 addition & 1 deletion python/core/auto_generated/qgsvectordataprovider.sip.in
Expand Up @@ -357,7 +357,7 @@ Changes geometries of existing features
that will have their geometries changed.
The second map parameter being the new geometries themselves

:return: True in case of success and false in case of failure
:return: True in case of success and false in case of failure
%End

virtual bool createSpatialIndex();
Expand Down
2 changes: 1 addition & 1 deletion python/core/auto_generated/qgsvectorlayercache.sip.in
Expand Up @@ -254,7 +254,7 @@ Please note, that this does not check, if the requested features are cached.

:param featureRequest: The QgsFeatureRequest to be answered

:return: True if the information is being cached, false if not
:return: True if the information is being cached, false if not
%End


Expand Down
15 changes: 5 additions & 10 deletions python/core/auto_generated/qgsvectorlayereditutils.sip.in
Expand Up @@ -92,8 +92,7 @@ Adds a ring to polygon/multipolygon features
%Docstring
Adds a new part polygon to a multipart feature

:return:
- QgsGeometry.Success
:return: - QgsGeometry.Success
- QgsGeometry.AddPartSelectedGeometryNotFound
- QgsGeometry.AddPartNotMultiGeometry
- QgsGeometry.InvalidBaseGeometry
Expand All @@ -104,8 +103,7 @@ Adds a new part polygon to a multipart feature
%Docstring
Adds a new part polygon to a multipart feature

:return:
- QgsGeometry.Success
:return: - QgsGeometry.Success
- QgsGeometry.AddPartSelectedGeometryNotFound
- QgsGeometry.AddPartNotMultiGeometry
- QgsGeometry.InvalidBaseGeometry
Expand All @@ -120,8 +118,7 @@ Adds a new part polygon to a multipart feature
%Docstring
Adds a new part polygon to a multipart feature

:return:
- QgsGeometry.Success
:return: - QgsGeometry.Success
- QgsGeometry.AddPartSelectedGeometryNotFound
- QgsGeometry.AddPartNotMultiGeometry
- QgsGeometry.InvalidBaseGeometry
Expand Down Expand Up @@ -150,8 +147,7 @@ Splits parts cut by the given line
:param splitLine: line that splits the layer feature parts
:param topologicalEditing: true if topological editing is enabled

:return:
- QgsGeometry.InvalidBaseGeometry
:return: - QgsGeometry.InvalidBaseGeometry
- QgsGeometry.Success
- QgsGeometry.InvalidInput
- QgsGeometry.NothingHappened if a selection is present but no feature has been split
Expand All @@ -167,8 +163,7 @@ Splits features cut by the given line
:param splitLine: line that splits the layer features
:param topologicalEditing: true if topological editing is enabled

:return:
0 in case of success,
:return: 0 in case of success,
4 if there is a selection but no feature split
%End

Expand Down
8 changes: 4 additions & 4 deletions python/core/auto_generated/qgsvectorlayertools.sip.in
Expand Up @@ -36,7 +36,7 @@ This method should/will be called, whenever a new feature will be added to the l
:param defaultGeometry: A default geometry to add to the feature
:param feature: Updated feature after adding will be written back to this

:return: True in case of success, False if the operation failed/was aborted
:return: True in case of success, False if the operation failed/was aborted

TODO QGIS 3: remove const qualifier
%End
Expand All @@ -49,7 +49,7 @@ If successful layer->startEditing() will be called and true returned.

:param layer: The layer on which to start an edit session

:return: True, if the editing session was started
:return: True, if the editing session was started

TODO QGIS 3: remove const qualifier
%End
Expand All @@ -62,7 +62,7 @@ Appropriate dialogs should be shown like
:param layer: The layer to commit
:param allowCancel: True if a cancel button should be offered

:return: True if successful
:return: True if successful

TODO QGIS 3: remove const qualifier
%End
Expand All @@ -73,7 +73,7 @@ Should be called, when the features should be committed but the editing session

:param layer: The layer to commit

:return: True if successful
:return: True if successful

TODO QGIS 3: remove const qualifier
%End
Expand Down
Expand Up @@ -137,7 +137,7 @@ Check if a given feature shall be rendered by this rule
:param f: The feature to test
:param context: The context in which the rendering happens

:return: True if the feature shall be rendered
:return: True if the feature shall be rendered
%End

bool isScaleOK( double scale ) const;
Expand Down Expand Up @@ -303,7 +303,7 @@ Render a given feature, will recursively call subclasses and only render if the
:param context: The rendering context
:param renderQueue: The rendering queue to which the feature should be added

:return: The result of the rendering. In explicit if the feature is added to the queue or
:return: The result of the rendering. In explicit if the feature is added to the queue or
the reason for not rendering the feature.
%End

Expand Down
Expand Up @@ -380,8 +380,6 @@ Creates a OGC Expression element based on the provided function expression
:param doc: The document owning the element
:param element: The element parent
:param function: The expression to be encoded

:return:
%End
static bool createFunctionElement( QDomDocument &doc, QDomElement &element, const QString &function );
static bool functionFromSldElement( QDomElement &element, QString &function );
Expand Down
Expand Up @@ -46,7 +46,7 @@ instead of calling this method directly.
:param editor: An editor widget if already existent. If NULL is provided, a new widget will be created.
:param parent: The parent for the wrapper class and any created widget.

:return: A new widget wrapper
:return: A new widget wrapper
%End

virtual QgsSearchWidgetWrapper *createSearchWidget( QgsVectorLayer *vl, int fieldIdx, QWidget *parent ) const /Factory/;
Expand All @@ -67,7 +67,7 @@ Create a new configuration widget for this widget type.
:param fieldIdx: The field index for which the widget will be created
:param parent: The parent widget of the created config widget

:return: A configuration widget
:return: A configuration widget
%End

bool supportsField( const QgsVectorLayer *vl, int fieldIdx );
Expand All @@ -77,7 +77,7 @@ Check if this editor widget type supports a certain field.
:param vl: The layer
:param fieldIdx: The field index

:return: True if the type is supported for this field
:return: True if the type is supported for this field

.. seealso:: :py:func:`fieldScore`
%End
Expand Down
Expand Up @@ -173,7 +173,7 @@ Filter key events to e.g. toggle construction mode or adapt constraints

:param e: A mouse event (may be modified)

:return: If the event is hidden (construction mode hides events from the maptool)
:return: If the event is hidden (construction mode hides events from the maptool)
%End

bool applyConstraints( QgsMapMouseEvent *e );
Expand Down
4 changes: 2 additions & 2 deletions python/gui/auto_generated/qgsattributeform.sip.in
Expand Up @@ -61,7 +61,7 @@ Takes ownership
%Docstring
Returns the layer for which this form is shown

:return: Layer
:return: Layer
%End

bool editable();
Expand Down Expand Up @@ -106,7 +106,7 @@ Intercepts keypress on custom form (escape should not close it)
:param object: The object for which the event has been sent
:param event: The event which is being filtered

:return: true if the event has been handled (key was ESC)
:return: true if the event has been handled (key was ESC)
%End

void setMultiEditFeatureIds( const QgsFeatureIds &fids );
Expand Down
2 changes: 1 addition & 1 deletion python/server/auto_generated/qgsserverrequest.sip.in
Expand Up @@ -59,7 +59,7 @@ Constructor
QUrl url() const;
%Docstring

:return: the request url
:return: the request url
%End

QgsServerRequest::Method method() const;
Expand Down
4 changes: 3 additions & 1 deletion scripts/sipify.pl
Expand Up @@ -184,7 +184,9 @@ sub processDoxygenLine {
}
# replace \returns with :return:
if ( $line =~ m/\\return(s)?/ ){
$line =~ s/\s*\\return(s)?/\n:return:/;
$line =~ s/\s*\\return(s)?\s*/\n:return: /;
# remove any trailing spaces, will be present now for empty 'returns' tags
$line =~ s/\s*$//g;
$INDENT = ' 'x( index($line,':',4) + 1);
}

Expand Down
3 changes: 1 addition & 2 deletions src/core/qgsattributeeditorelement.h
Expand Up @@ -295,8 +295,7 @@ class CORE_EXPORT QgsAttributeEditorField : public QgsAttributeEditorElement
{}

/**
* Returns the index of the field
* \returns
* Returns the index of the field.
*/
int idx() const { return mIdx; }

Expand Down
5 changes: 1 addition & 4 deletions src/core/qgsmultirenderchecker.h
Expand Up @@ -119,14 +119,11 @@ class CORE_EXPORT QgsMultiRenderChecker

/**
* Returns a report for this test
*
* \returns A report
*/
QString report() const { return mReport; }

/**
* \brief controlImagePath
* \returns
* Returns the path to the control images.
*/
QString controlImagePath() const;

Expand Down
3 changes: 1 addition & 2 deletions src/core/qgsuserprofilemanager.h
Expand Up @@ -110,8 +110,7 @@ class CORE_EXPORT QgsUserProfileManager : public QObject
bool rootLocationIsSet() const;

/**
* A list of all found profile names.
* \return
* Returns a list of all found profile names.
*/
QStringList allProfiles() const;

Expand Down
15 changes: 5 additions & 10 deletions src/core/qgsvectorlayereditutils.h
Expand Up @@ -93,8 +93,7 @@ class CORE_EXPORT QgsVectorLayerEditUtils

/**
* Adds a new part polygon to a multipart feature
* \return
* - QgsGeometry::Success
* \returns - QgsGeometry::Success
* - QgsGeometry::AddPartSelectedGeometryNotFound
* - QgsGeometry::AddPartNotMultiGeometry
* - QgsGeometry::InvalidBaseGeometry
Expand All @@ -105,8 +104,7 @@ class CORE_EXPORT QgsVectorLayerEditUtils
/**
* Adds a new part polygon to a multipart feature
*
* \return
* - QgsGeometry::Success
* \returns - QgsGeometry::Success
* - QgsGeometry::AddPartSelectedGeometryNotFound
* - QgsGeometry::AddPartNotMultiGeometry
* - QgsGeometry::InvalidBaseGeometry
Expand All @@ -118,8 +116,7 @@ class CORE_EXPORT QgsVectorLayerEditUtils
/**
* Adds a new part polygon to a multipart feature
*
* \return
* - QgsGeometry::Success
* \returns - QgsGeometry::Success
* - QgsGeometry::AddPartSelectedGeometryNotFound
* - QgsGeometry::AddPartNotMultiGeometry
* - QgsGeometry::InvalidBaseGeometry
Expand All @@ -142,8 +139,7 @@ class CORE_EXPORT QgsVectorLayerEditUtils
* Splits parts cut by the given line
* \param splitLine line that splits the layer feature parts
* \param topologicalEditing true if topological editing is enabled
* \return
* - QgsGeometry::InvalidBaseGeometry
* \returns - QgsGeometry::InvalidBaseGeometry
* - QgsGeometry::Success
* - QgsGeometry::InvalidInput
* - QgsGeometry::NothingHappened if a selection is present but no feature has been split
Expand All @@ -157,8 +153,7 @@ class CORE_EXPORT QgsVectorLayerEditUtils
* Splits features cut by the given line
* \param splitLine line that splits the layer features
* \param topologicalEditing true if topological editing is enabled
* \return
* 0 in case of success,
* \returns 0 in case of success,
* 4 if there is a selection but no feature split
*/
QgsGeometry::OperationResult splitFeatures( const QVector<QgsPointXY> &splitLine, bool topologicalEditing = false );
Expand Down

0 comments on commit 7a1a787

Please sign in to comment.