This is merely a historical archive of years 2008-2021, before the migration to mailman3.
A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.
osmith gerrit-no-reply at lists.osmocom.orgosmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ci/+/26465 )
Change subject: lint: checkpatch_osmo: ignore BRACES_NOT_NECESSARY
......................................................................
lint: checkpatch_osmo: ignore BRACES_NOT_NECESSARY
Don't complain about using braces when they could be omitted, for
example:
if (condition) {
single_statement();
}
Another example:
if (condition) {
single_statement();
} else {
another_single_statement();
}
This is not something we would care about in code review either from
what I've seen and so it's probably just annoying for patch authors to
fix up.
Related: OS#5087
Change-Id: Ice08d5b88c683a59bacff999a1d6c07754663d39
---
M lint/checkpatch/checkpatch.pl
M lint/checkpatch/checkpatch_osmo.sh
2 files changed, 4 insertions(+), 2 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/65/26465/1
diff --git a/lint/checkpatch/checkpatch.pl b/lint/checkpatch/checkpatch.pl
index e31a61f..a4d229c 100755
--- a/lint/checkpatch/checkpatch.pl
+++ b/lint/checkpatch/checkpatch.pl
@@ -6008,7 +6008,7 @@
$sum_allowed += $_;
}
if ($sum_allowed == 0) {
- WARN("BRACES",
+ WARN("BRACES_NOT_NECESSARY", # Osmocom specific: renamed from BRACES
"braces {} are not necessary for any arm of this statement\n" . $herectx);
} elsif ($sum_allowed != $allow &&
$seen != $allow) {
@@ -6064,7 +6064,7 @@
my $cnt = statement_rawlines($block);
my $herectx = get_stat_here($linenr, $cnt, $here);
- WARN("BRACES",
+ WARN("BRACES_NOT_NECESSARY", # Osmocom specific: renamed from BRACES
"braces {} are not necessary for single statement blocks\n" . $herectx);
}
}
diff --git a/lint/checkpatch/checkpatch_osmo.sh b/lint/checkpatch/checkpatch_osmo.sh
index ae66e71..d1ce63a 100755
--- a/lint/checkpatch/checkpatch_osmo.sh
+++ b/lint/checkpatch/checkpatch_osmo.sh
@@ -49,6 +49,7 @@
# * ASSIGN_IN_IF: not followed (e.g. 'if ((u8 = gsup_msg->cause))')
# * AVOID_EXTERNS: we do use externs
# * BLOCK_COMMENT_STYLE: we don't use a trailing */ on a separate line
+# * BRACES_NOT_NECESSARY: not followed
# * COMPLEX_MACRO: we don't use parentheses when building macros of strings across multiple lines
# * CONSTANT_COMPARISON: not followed: "Comparisons should place the constant on the right side"
# * DEEP_INDENTATION: warns about many leading tabs, not useful if changing existing code without refactoring
@@ -84,6 +85,7 @@
--ignore ASSIGN_IN_IF \
--ignore AVOID_EXTERNS \
--ignore BLOCK_COMMENT_STYLE \
+ --ignore BRACES_NOT_NECESSARY \
--ignore COMPLEX_MACRO \
--ignore CONSTANT_COMPARISON \
--ignore DEEP_INDENTATION \
--
To view, visit https://gerrit.osmocom.org/c/osmo-ci/+/26465
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Change-Id: Ice08d5b88c683a59bacff999a1d6c07754663d39
Gerrit-Change-Number: 26465
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20211208/4e524867/attachment.htm>