<p>osmith has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/osmo-ci/+/25724">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">lint: support project-specific exclude paths<br><br>While at it, put in the exact path to spelling.txt in osmo-ci.git.<br><br>Related: OS#5087<br>Change-Id: Ib23f9c65da1916ebf4654c5e641eaffe6c75315c<br>---<br>M lint/checkpatch/checkpatch_osmo.sh<br>1 file changed, 23 insertions(+), 11 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/24/25724/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/lint/checkpatch/checkpatch_osmo.sh b/lint/checkpatch/checkpatch_osmo.sh</span><br><span>index 4710b7b..fd0e10a 100755</span><br><span>--- a/lint/checkpatch/checkpatch_osmo.sh</span><br><span>+++ b/lint/checkpatch/checkpatch_osmo.sh</span><br><span>@@ -1,12 +1,27 @@</span><br><span> #!/bin/sh -e</span><br><span> SCRIPT_DIR="$(dirname "$(realpath "$0")")"</span><br><span style="color: hsl(120, 100%, 40%);">+PROJECT="$(basename "$(git rev-parse --show-toplevel)")"</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-# Excluded paths:</span><br><span style="color: hsl(0, 100%, 40%);">-# * \.(ok|err)$: stdout and stderr of regression tests</span><br><span style="color: hsl(0, 100%, 40%);">-# * ^debian/changelog$: generated from commit log, which may contain spelling errors (OS#5232)</span><br><span style="color: hsl(0, 100%, 40%);">-# * ^lint/checkpatch/: so it does not warn about spelling errors in spelling.txt :)</span><br><span style="color: hsl(0, 100%, 40%);">-# * ^src/gsm/kdf/: libosmocore: imported code</span><br><span style="color: hsl(0, 100%, 40%);">-# * ^src/gsm/milenage/: libosmocore: imported code</span><br><span style="color: hsl(120, 100%, 40%);">+exclude_paths_common() {</span><br><span style="color: hsl(120, 100%, 40%);">+    # Stdout and stderr of regression tests</span><br><span style="color: hsl(120, 100%, 40%);">+       echo '--exclude \.(ok|err)$'</span><br><span style="color: hsl(120, 100%, 40%);">+  # Generated from commit log, which may contain spelling errors (OS#5232)</span><br><span style="color: hsl(120, 100%, 40%);">+      echo '--exclude ^debian/changelog$'</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+exclude_paths_project() {</span><br><span style="color: hsl(120, 100%, 40%);">+   case "$PROJECT" in</span><br><span style="color: hsl(120, 100%, 40%);">+  libosmocore)</span><br><span style="color: hsl(120, 100%, 40%);">+          # Imported code</span><br><span style="color: hsl(120, 100%, 40%);">+               echo '--exclude ^src/gsm/kdf/'</span><br><span style="color: hsl(120, 100%, 40%);">+                echo '--exclude ^src/gsm/milenage/'</span><br><span style="color: hsl(120, 100%, 40%);">+           ;;</span><br><span style="color: hsl(120, 100%, 40%);">+    osmo-ci)</span><br><span style="color: hsl(120, 100%, 40%);">+              # Do not warn about spelling errors in spelling.txt :)</span><br><span style="color: hsl(120, 100%, 40%);">+                echo '--exclude ^lint/checkpatch/spelling.txt$'</span><br><span style="color: hsl(120, 100%, 40%);">+               ;;</span><br><span style="color: hsl(120, 100%, 40%);">+    esac</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span> </span><br><span> # Ignored checks:</span><br><span> # * ASSIGN_IN_IF: not followed (e.g. 'if ((u8 = gsup_msg->cause))')</span><br><span>@@ -36,11 +51,8 @@</span><br><span> # * UNSPECIFIED_INT: not followed (doesn't seem useful for us)</span><br><span> </span><br><span> $SCRIPT_DIR/checkpatch.pl \</span><br><span style="color: hsl(0, 100%, 40%);">-        --exclude '\.(ok|err)$' \</span><br><span style="color: hsl(0, 100%, 40%);">-       --exclude '^debian/changelog$' \</span><br><span style="color: hsl(0, 100%, 40%);">-        --exclude '^lint/checkpatch/' \</span><br><span style="color: hsl(0, 100%, 40%);">- --exclude '^src/gsm/kdf/' \</span><br><span style="color: hsl(0, 100%, 40%);">-     --exclude '^src/gsm/milenage/' \</span><br><span style="color: hsl(120, 100%, 40%);">+      $(exclude_paths_common) \</span><br><span style="color: hsl(120, 100%, 40%);">+     $(exclude_paths_project) \</span><br><span>   --ignore ASSIGN_IN_IF \</span><br><span>      --ignore AVOID_EXTERNS \</span><br><span>     --ignore BLOCK_COMMENT_STYLE \</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-ci/+/25724">change 25724</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/c/osmo-ci/+/25724"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-ci </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: Ib23f9c65da1916ebf4654c5e641eaffe6c75315c </div>
<div style="display:none"> Gerrit-Change-Number: 25724 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: osmith <osmith@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>