Skip to content

Commit a0cff33

Browse files
committed
fix sonar
Signed-off-by: Martijn Govers <Martijn.Govers@Alliander.com>
1 parent cf8c096 commit a0cff33

File tree

4 files changed

+10
-8
lines changed

4 files changed

+10
-8
lines changed

power_grid_model_c/power_grid_model/include/power_grid_model/common/common.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,9 @@ template <class T, class... Ts>
9292
concept is_in_list_c = (std::same_as<std::remove_const_t<T>, Ts> || ...);
9393

9494
namespace capturing {
95-
// NOLINTNEXTLINE(cppcoreguidelines-missing-std-forward) // perfect forward into void
96-
template <class... T> constexpr void into_the_void(T&&... /*ignored*/) {
95+
// perfect forward into void
96+
template <class... T>
97+
constexpr void into_the_void(T&&... /*ignored*/) { // NOLINT(cppcoreguidelines-missing-std-forward)
9798
// do nothing; the constexpr allows all compilers to optimize this away
9899
}
99100
} // namespace capturing

power_grid_model_c/power_grid_model/include/power_grid_model/main_model_impl.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -522,9 +522,9 @@ class MainModelImpl<ExtraRetrievableTypes<ExtraRetrievableType...>, ComponentLis
522522
*meta_data_,
523523
},
524524
ignore_output);
525-
} catch (const SparseMatrixError&) { // NOLINT(bugprone-empty-catch)
525+
} catch (const SparseMatrixError&) { // NOLINT(bugprone-empty-catch) // NOSONAR
526526
// missing entries are provided in the update data
527-
} catch (const NotObservableError&) { // NOLINT(bugprone-empty-catch)
527+
} catch (const NotObservableError&) { // NOLINT(bugprone-empty-catch) // NOSONAR
528528
// missing entries are provided in the update data
529529
}
530530

tests/cpp_unit_tests/test_common.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ static_assert(std::invocable<IncludeAll, Idx>);
1818
static_assert(std::invocable<IncludeAll, Idx, Idx>);
1919
static_assert(include_all());
2020
static_assert(include_all(1));
21-
static_assert(include_all(Idx{2},
22-
std::move(Idx{3}))); // NOLINT(performance-move-const-arg) // to test that rvalues work
21+
static_assert(include_all(
22+
Idx{2}, std::move(Idx{3}))); // NOLINT(performance-move-const-arg) // NOSONAR // to test that rvalues work
2323
} // namespace
2424
} // namespace power_grid_model

tests/cpp_unit_tests/test_math_solver_common.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,8 @@ template <symmetry_tag sym_type> struct SteadyStateSolverTestGrid {
112112
static constexpr double v1 = 0.97;
113113
static constexpr double v2 = 0.90;
114114
static constexpr double deg = deg_30 / 30.0;
115-
// NOLINTBEGIN(cppcoreguidelines-avoid-const-or-ref-data-members) // should be constexpr but cant due to std::exp
115+
// NOLINTBEGIN(cppcoreguidelines-avoid-const-or-ref-data-members) // NOSONAR // should be constexpr but cant due to
116+
// std::exp
116117
DoubleComplex const u0 = v0 * std::exp(-1.0i * deg);
117118
DoubleComplex const u1 = v1 * std::exp(-4.0i * deg);
118119
DoubleComplex const u2 = v2 * std::exp(-37.0i * deg);
@@ -137,7 +138,7 @@ template <symmetry_tag sym_type> struct SteadyStateSolverTestGrid {
137138
// injection of shunt0 at bus2
138139
DoubleComplex const i2_shunt_inj = branch1_i_t;
139140
DoubleComplex const ys = -i2_shunt_inj / u2; // output
140-
// NOLINTEND(cppcoreguidelines-avoid-const-or-ref-data-members)
141+
// NOLINTEND(cppcoreguidelines-avoid-const-or-ref-data-members) // NOSONAR
141142

142143
SolverOutput<sym> output_ref() const {
143144
if constexpr (is_symmetric_v<sym>) {

0 commit comments

Comments
 (0)