Change in osmo-ci[master]: lint: checkpatch.pl: allow spaces below DEFUN

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.org
Mon Jul 12 14:35:44 UTC 2021


osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ci/+/24918 )


Change subject: lint: checkpatch.pl: allow spaces below DEFUN
......................................................................

lint: checkpatch.pl: allow spaces below DEFUN

Do not complain if indenting with exactly 6 spaces below DEFUN(, as it's
often done in VTY-related code in Osmocom. This patch assumes that if
the line starts with 6 spaces and " or a word, it's probably below
DEFUN(. I've considered implementing a more accurate check, but that
would be too much effort (e.g. when macros are involved).

Related: OS#5087
Change-Id: I0934b63a62500e7a3e09c753cc63aa331e580cc6
---
M lint/checkpatch/checkpatch.pl
1 file changed, 3 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/18/24918/1

diff --git a/lint/checkpatch/checkpatch.pl b/lint/checkpatch/checkpatch.pl
index ad99e0c..834b435 100755
--- a/lint/checkpatch/checkpatch.pl
+++ b/lint/checkpatch/checkpatch.pl
@@ -3973,7 +3973,9 @@
 #  1) within comments
 #  2) indented preprocessor commands
 #  3) hanging labels
-		if ($rawline =~ /^\+ / && $line !~ /^\+ *(?:$;|#|$Ident:)/)  {
+		if ($rawline =~ /^\+ / && $line !~ /^\+ *(?:$;|#|$Ident:)/ &&
+		    # Osmocom specific, below 'DEFUN('
+		    $line !~ /^\+ {6}["\w].*$/)  {
 			my $herevet = "$here\n" . cat_vet($rawline) . "\n";
 			if (WARN("LEADING_SPACE",
 				 "please, no spaces at the start of a line\n" . $herevet) &&

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ci/+/24918
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Change-Id: I0934b63a62500e7a3e09c753cc63aa331e580cc6
Gerrit-Change-Number: 24918
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/20210712/3d541193/attachment.htm>


More information about the gerrit-log mailing list