Skip to content

Commit b506257

Browse files
authored
Merge pull request #10767 from AcKoucher/odb-no-lint-generator
odb: add lint exception to prevent clang-tidy failure on generated code
2 parents d1f7a8d + f1df9a8 commit b506257

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

src/odb/src/codeGenerator/templates/impl.cpp.jinja

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ namespace odb {
3333

3434
bool _{{klass.name}}::operator<(const _{{klass.name}}& rhs) const
3535
{
36+
{% if klass.less_fields | length == 1 %}
37+
// NOLINTBEGIN(readability-simplify-boolean-expr)
38+
{% endif %}
3639
{% for less in klass.less_fields %}
3740
if ({{less.left}} >= {{less.right}}) {
3841
return false;
@@ -42,6 +45,9 @@ namespace odb {
4245
//User Code Begin <
4346
//User Code End <
4447
return true;
48+
{% if klass.less_fields | length == 1 %}
49+
// NOLINTEND(readability-simplify-boolean-expr)
50+
{% endif %}
4551
}
4652

4753
_{{klass.name}}::_{{klass.name}}(_dbDatabase* db)

src/odb/src/db/dbChip.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,11 +144,13 @@ bool _dbChip::operator==(const _dbChip& rhs) const
144144

145145
bool _dbChip::operator<(const _dbChip& rhs) const
146146
{
147+
// NOLINTBEGIN(readability-simplify-boolean-expr)
147148
if (top_ >= rhs.top_) {
148149
return false;
149150
}
150151

151152
return true;
153+
// NOLINTEND(readability-simplify-boolean-expr)
152154
}
153155

154156
_dbChip::_dbChip(_dbDatabase* db)

0 commit comments

Comments
 (0)