osmith has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-ci/+/36487?usp=email )


Change subject: checkpatch: recognize json_array_for_each etc.
......................................................................

checkpatch: recognize json_array_for_each etc.

Treat json_array_foreach, json_object_foreach, json_object_foreach_safe
etc. the same as if, while, for, switch, and require exactly one space
after using it:

        json_array_foreach (nftables, i, item) {
                …
        }

Related: osmo-hnbgw Id4e7fa017c31945388a010d8581715d71482116b
Change-Id: I0b58c6d70a961c7d0ba93a2f0d6a5a4afa321fa9
---
M lint/checkpatch/checkpatch.pl
1 file changed, 20 insertions(+), 1 deletion(-)



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

diff --git a/lint/checkpatch/checkpatch.pl b/lint/checkpatch/checkpatch.pl
index eada2a9..ff6eea1 100755
--- a/lint/checkpatch/checkpatch.pl
+++ b/lint/checkpatch/checkpatch.pl
@@ -4888,6 +4888,7 @@
                        # Ignore those directives where spaces _are_ permitted.
                        if ($name =~ /^(?:
                                if|for|while|switch|return|case|
+                               [a-z_]*for[_]?each[a-z_]*|
                                volatile|__volatile__|
                                __attribute__|format|__extension__|
                                asm|__asm__)$/x)
@@ -5513,7 +5514,7 @@
                }

 # Need a space before open parenthesis after if, while etc
-               if ($line =~ /\b(if|while|for|switch)\(/) {
+               if ($line =~ 
/\b(if|while|for|switch|[a-z_]*for[_]?each[a-z_]*)\(/) {
                        if (ERROR("SPACING",
                                  "space required before the open parenthesis 
'('\n" . $herecurr) &&
                            $fix) {

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

Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Change-Id: I0b58c6d70a961c7d0ba93a2f0d6a5a4afa321fa9
Gerrit-Change-Number: 36487
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <[email protected]>
Gerrit-MessageType: newchange

Reply via email to