Skip to content

Commit

Permalink
Alternative method of silencing clang warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Nov 28, 2022
1 parent 26f5683 commit 14bf89c
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/core/actions/qgsaction.cpp
Expand Up @@ -40,7 +40,8 @@

bool QgsAction::runable() const
{
#ifndef __clang_analyzer__
// clang analyzer is not happy because of the multiple duplicate return branches, but this is ok :)
// NOLINTBEGIN(bugprone-branch-clone)
switch ( mType )
{
case Qgis::AttributeActionType::Generic:
Expand Down Expand Up @@ -71,7 +72,7 @@ bool QgsAction::runable() const
#endif
}
return false;
#endif
// NOLINTEND(bugprone-branch-clone)
}

void QgsAction::run( QgsVectorLayer *layer, const QgsFeature &feature, const QgsExpressionContext &expressionContext ) const
Expand Down Expand Up @@ -309,9 +310,7 @@ void QgsAction::run( const QgsExpressionContext &expressionContext ) const
{
// The QgsRunProcess instance created by this static function
// deletes itself when no longer needed.
#ifndef __clang_analyzer__
QgsRunProcess::create( expandedAction, mCaptureOutput );
#endif
QgsRunProcess::create( expandedAction, mCaptureOutput ); // NOLINT
}
}

Expand Down

0 comments on commit 14bf89c

Please sign in to comment.