<p>osmith <strong>submitted</strong> this change.</p><p><a href="https://gerrit.osmocom.org/c/osmo-ci/+/25963">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  fixeria: Looks good to me, approved
  pespin: Looks good to me, but someone else must approve
  Jenkins Builder: Verified

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">lint: checkpatch_osmo.sh: exclude asn1c generated<br><br>Does not make a noticable speed difference on a typical patch with few<br>changed files, but makes linting on big patches with ~1000 files and<br>lots of asn1c generated files in the repository significantly slower.<br>The next patch will optimize that case.<br><br>Change-Id: I7437d888b433fec8a444e4d7c285fff47d16c0c7<br>---<br>M lint/checkpatch/checkpatch_osmo.sh<br>1 file changed, 20 insertions(+), 1 deletion(-)<br><br></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 91e9abe..f9cc74f 100755</span><br><span>--- a/lint/checkpatch/checkpatch_osmo.sh</span><br><span>+++ b/lint/checkpatch/checkpatch_osmo.sh</span><br><span>@@ -1,6 +1,7 @@</span><br><span> #!/bin/sh -e</span><br><span> SCRIPT_DIR="$(dirname "$(realpath "$0")")"</span><br><span style="color: hsl(0, 100%, 40%);">-PROJECT="$(basename "$(git rev-parse --show-toplevel)")"</span><br><span style="color: hsl(120, 100%, 40%);">+PROJECT_DIR="$(git rev-parse --show-toplevel)"</span><br><span style="color: hsl(120, 100%, 40%);">+PROJECT="$(basename "$PROJECT_DIR")"</span><br><span> </span><br><span> exclude_paths_common() {</span><br><span>    # Stdout and stderr of regression tests</span><br><span>@@ -9,6 +10,21 @@</span><br><span>  echo '--exclude ^debian/changelog$'</span><br><span> }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+exclude_paths_common_asn1c() {</span><br><span style="color: hsl(120, 100%, 40%);">+  local pattern="^ \* Generated by asn1c-"</span><br><span style="color: hsl(120, 100%, 40%);">+    local files="$(find -name '*.c' -o -name '*.h' | cut -d / -f 2-)"</span><br><span style="color: hsl(120, 100%, 40%);">+   local i</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+     if [ -z "$files" ]; then</span><br><span style="color: hsl(120, 100%, 40%);">+            return</span><br><span style="color: hsl(120, 100%, 40%);">+        fi</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+  for i in $(grep -l "$pattern" $files); do</span><br><span style="color: hsl(120, 100%, 40%);">+           # Example: --exclude ^include/osmocom/sabp/SABP_Data-Coding-Scheme.h$</span><br><span style="color: hsl(120, 100%, 40%);">+         echo '--exclude ^'$i'$'</span><br><span style="color: hsl(120, 100%, 40%);">+       done</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> exclude_paths_project() {</span><br><span>       case "$PROJECT" in</span><br><span>         libosmocore)</span><br><span>@@ -56,8 +72,11 @@</span><br><span> # * UNNECESSARY_INT: not followed (see https://gerrit.osmocom.org/c/libosmocore/+/25345)</span><br><span> # * UNSPECIFIED_INT: not followed (doesn't seem useful for us)</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+cd "$PROJECT_DIR"</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> $SCRIPT_DIR/checkpatch.pl \</span><br><span>        $(exclude_paths_common) \</span><br><span style="color: hsl(120, 100%, 40%);">+     $(exclude_paths_common_asn1c) \</span><br><span>      $(exclude_paths_project) \</span><br><span>   --ignore ASSIGN_IN_IF \</span><br><span>      --ignore AVOID_EXTERNS \</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-ci/+/25963">change 25963</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/+/25963"/><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: I7437d888b433fec8a444e4d7c285fff47d16c0c7 </div>
<div style="display:none"> Gerrit-Change-Number: 25963 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: osmith <osmith@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder </div>
<div style="display:none"> Gerrit-Reviewer: fixeria <vyanitskiy@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: osmith <osmith@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>