From f1df9a88ce207f6f9475b7721f094deb57150461 Mon Sep 17 00:00:00 2001 From: Arthur Koucher Date: Sat, 27 Jun 2026 15:31:38 -0300 Subject: [PATCH] odb: add lint exception to prevent clang-tidy failure on generated code Signed-off-by: Arthur Koucher --- src/odb/src/codeGenerator/templates/impl.cpp.jinja | 6 ++++++ src/odb/src/db/dbChip.cpp | 2 ++ 2 files changed, 8 insertions(+) diff --git a/src/odb/src/codeGenerator/templates/impl.cpp.jinja b/src/odb/src/codeGenerator/templates/impl.cpp.jinja index f7dce66c2ad..c34f01fddb4 100755 --- a/src/odb/src/codeGenerator/templates/impl.cpp.jinja +++ b/src/odb/src/codeGenerator/templates/impl.cpp.jinja @@ -33,6 +33,9 @@ namespace odb { bool _{{klass.name}}::operator<(const _{{klass.name}}& rhs) const { + {% if klass.less_fields | length == 1 %} + // NOLINTBEGIN(readability-simplify-boolean-expr) + {% endif %} {% for less in klass.less_fields %} if ({{less.left}} >= {{less.right}}) { return false; @@ -42,6 +45,9 @@ namespace odb { //User Code Begin < //User Code End < return true; + {% if klass.less_fields | length == 1 %} + // NOLINTEND(readability-simplify-boolean-expr) + {% endif %} } _{{klass.name}}::_{{klass.name}}(_dbDatabase* db) diff --git a/src/odb/src/db/dbChip.cpp b/src/odb/src/db/dbChip.cpp index 704f2423c8d..12835fc55a2 100644 --- a/src/odb/src/db/dbChip.cpp +++ b/src/odb/src/db/dbChip.cpp @@ -144,11 +144,13 @@ bool _dbChip::operator==(const _dbChip& rhs) const bool _dbChip::operator<(const _dbChip& rhs) const { + // NOLINTBEGIN(readability-simplify-boolean-expr) if (top_ >= rhs.top_) { return false; } return true; + // NOLINTEND(readability-simplify-boolean-expr) } _dbChip::_dbChip(_dbDatabase* db)