<p>Patrick Georgi <strong>merged</strong> this change.</p><p><a href="https://review.coreboot.org/28429">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  build bot (Jenkins): Verified
  Werner Zeh: Looks good to me, approved

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">util/lint: Update whitespace linter for FreeBSD<br><br>On FreeBSD, this test was failing with the error:<br>"grep: Argument list too long"<br><br>I found that changing this to other forms takes MUCH longer, so I left<br>the original method mostly unchanged except for moving the include &<br>exclude lists into variables.<br><br>Currently, I'm setting all non-linux operating systems to use the second<br>version. I'll update that if I find other that other OSes support the<br>first.<br><br>Change-Id: I1c9281440d051dea8a8b3a3ddc04676ccea77c7a<br>Signed-off-by: Martin Roth <martinr@coreboot.org><br>Reviewed-on: https://review.coreboot.org/28429<br>Tested-by: build bot (Jenkins) <no-reply@coreboot.org><br>Reviewed-by: Werner Zeh <werner.zeh@siemens.com><br>---<br>M util/lint/lint-stable-003-whitespace<br>1 file changed, 18 insertions(+), 2 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/util/lint/lint-stable-003-whitespace b/util/lint/lint-stable-003-whitespace</span><br><span>index d749f37..1a7dc7b 100755</span><br><span>--- a/util/lint/lint-stable-003-whitespace</span><br><span>+++ b/util/lint/lint-stable-003-whitespace</span><br><span>@@ -15,5 +15,21 @@</span><br><span> # DESCR: Check for superfluous whitespace in the tree</span><br><span> </span><br><span> LC_ALL=C export LC_ALL</span><br><span style="color: hsl(0, 100%, 40%);">-grep -l "[[:space:]][[:space:]]*$" `git ls-files src util |egrep -v "(^3rdparty|^src/vendorcode/|^util/kconfig/|^util/nvidia/cbootimage$|\<COPYING\>|\<LICENSE\>|\<README\>|_shipped$|\.patch$|\.bin$|\.hex$|\.jpg$|\.ttf$|\.woff$|\.png$|\.eot$|\.vbt$)"` | \</span><br><span style="color: hsl(0, 100%, 40%);">-        sed -e "s,^.*$,File & has lines ending with whitespace.,"</span><br><span style="color: hsl(120, 100%, 40%);">+EXCLUDELIST='^3rdparty|^src/vendorcode/|^util/kconfig/|^util/nvidia/cbootimage$|\<COPYING\>|\<LICENSE\>|\<README\>|_shipped$|\.patch$|\.bin$|\.hex$|\.jpg$|\.ttf$|\.woff$|\.png$|\.eot$|\.vbt$'</span><br><span style="color: hsl(120, 100%, 40%);">+INCLUDELIST="src util"</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+# shellcheck disable=SC2086,SC2046</span><br><span style="color: hsl(120, 100%, 40%);">+if uname | grep -qi "linux"; then</span><br><span style="color: hsl(120, 100%, 40%);">+       grep -l "[[:space:]][[:space:]]*$" \</span><br><span style="color: hsl(120, 100%, 40%);">+                $(git ls-files $INCLUDELIST | \</span><br><span style="color: hsl(120, 100%, 40%);">+                       grep -Ev "($EXCLUDELIST)" ) | \</span><br><span style="color: hsl(120, 100%, 40%);">+             sed -e "s,^.*$,File & has lines ending with whitespace.,"</span><br><span style="color: hsl(120, 100%, 40%);">+else</span><br><span style="color: hsl(120, 100%, 40%);">+ # The above form is much (100x) faster, but doesn't work</span><br><span style="color: hsl(120, 100%, 40%);">+  # on all systems. A for loop also works but takes 30% longer</span><br><span style="color: hsl(120, 100%, 40%);">+  git ls-files $INCLUDELIST | \</span><br><span style="color: hsl(120, 100%, 40%);">+         grep -Ev "($EXCLUDELIST)" | \</span><br><span style="color: hsl(120, 100%, 40%);">+               xargs -I % \</span><br><span style="color: hsl(120, 100%, 40%);">+                  grep -l "[[:space:]][[:space:]]*$" % | \</span><br><span style="color: hsl(120, 100%, 40%);">+                    sed -e "s,^.*$,File & has lines ending with whitespace.,"</span><br><span style="color: hsl(120, 100%, 40%);">+fi</span><br><span></span><br></pre><p>To view, visit <a href="https://review.coreboot.org/28429">change 28429</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://review.coreboot.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://review.coreboot.org/28429"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: coreboot </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: merged </div>
<div style="display:none"> Gerrit-Change-Id: I1c9281440d051dea8a8b3a3ddc04676ccea77c7a </div>
<div style="display:none"> Gerrit-Change-Number: 28429 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: Martin Roth <martinroth@google.com> </div>
<div style="display:none"> Gerrit-Reviewer: Patrick Georgi <pgeorgi@google.com> </div>
<div style="display:none"> Gerrit-Reviewer: Werner Zeh <werner.zeh@siemens.com> </div>
<div style="display:none"> Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org> </div>