<p>Martin Roth has uploaded this change for <strong>review</strong>.</p><p><a href="https://review.coreboot.org/28448">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">util/lint: Update non-ascii linter for FreeBSD<br><br>On FreeBSD, this test was failing with the error:<br>"grep: Argument list too long"<br><br>- Remove support for testing coreboot not in a git repo.  Many of<br>the other linters already don't support this.<br>- Use git grep to find offending files, then xargs to print out<br>the lines.<br><br>Change-Id: Ic017dc3465fd9a46ff4e6ec5ef16396e963483cd<br>Signed-off-by: Martin Roth <martinr@coreboot.org><br>---<br>M util/lint/lint-stable-016-non-ascii<br>1 file changed, 13 insertions(+), 13 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://review.coreboot.org:29418/coreboot refs/changes/48/28448/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/util/lint/lint-stable-016-non-ascii b/util/lint/lint-stable-016-non-ascii</span><br><span>index beffd83..3c22900 100755</span><br><span>--- a/util/lint/lint-stable-016-non-ascii</span><br><span>+++ b/util/lint/lint-stable-016-non-ascii</span><br><span>@@ -21,13 +21,11 @@</span><br><span> EXCLUDED_FILES='to-wiki/towiki\.sh$\|vga/vga_font\|video/font\|PDCurses.*x11'</span><br><span> EXCLUDED_PHRASES='Copyright\|Ported to\|Intel®\|°C\|°F\|Athlon™\|Copyright.*©\|A-Za-zÀ-ÿ'</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-# Use git ls-files if the code is in a git repo, otherwise use find.</span><br><span style="color: hsl(0, 100%, 40%);">-if [ -n "$(command -v git)" ] && \</span><br><span style="color: hsl(0, 100%, 40%);">- [ "$(git rev-parse --is-inside-work-tree 2>/dev/null)" = "true" ]</span><br><span style="color: hsl(120, 100%, 40%);">+# Exit if git isn't present or the code isn't in a git repo</span><br><span style="color: hsl(120, 100%, 40%);">+if [ -z "$(command -v git)" ] || \</span><br><span style="color: hsl(120, 100%, 40%);">+   [ "$(git rev-parse --is-inside-work-tree 2>/dev/null)" != "true" ]</span><br><span> then</span><br><span style="color: hsl(0, 100%, 40%);">-       FIND_FILES="git ls-files"</span><br><span style="color: hsl(0, 100%, 40%);">-else</span><br><span style="color: hsl(0, 100%, 40%);">- FIND_FILES="find . "</span><br><span style="color: hsl(120, 100%, 40%);">+        exit</span><br><span> fi</span><br><span> </span><br><span> # 1. Get the list of files to parse and send them through grep</span><br><span>@@ -36,10 +34,12 @@</span><br><span> # 3. Remove common phrases and names that have been found</span><br><span> # 4. Run the result through grep again to highlight the issues that were</span><br><span> #    found.  Without this step, the characters can be difficult to see.</span><br><span style="color: hsl(0, 100%, 40%);">-grep -n "[^       -~]" \</span><br><span style="color: hsl(0, 100%, 40%);">-    $(${FIND_FILES} | sed 's|^\./||' | sort | \</span><br><span style="color: hsl(0, 100%, 40%);">-             grep "$INCLUDED_FILES" | \</span><br><span style="color: hsl(0, 100%, 40%);">-            grep -v "$EXCLUDED_DIRS" | \</span><br><span style="color: hsl(0, 100%, 40%);">-          grep -v "$EXCLUDED_FILES") | \</span><br><span style="color: hsl(0, 100%, 40%);">-        grep -iv "$EXCLUDED_PHRASES" | \</span><br><span style="color: hsl(0, 100%, 40%);">-      grep --color='auto' "[^     -~]"</span><br><span style="color: hsl(120, 100%, 40%);">+# shellcheck disable=SC2046</span><br><span style="color: hsl(120, 100%, 40%);">+git grep -lP "[^\t-~]" | \</span><br><span style="color: hsl(120, 100%, 40%);">+ grep "$INCLUDED_FILES" | \</span><br><span style="color: hsl(120, 100%, 40%);">+  grep -v "$EXCLUDED_DIRS" | \</span><br><span style="color: hsl(120, 100%, 40%);">+        grep -v "$EXCLUDED_FILES" | \</span><br><span style="color: hsl(120, 100%, 40%);">+       xargs -I % \</span><br><span style="color: hsl(120, 100%, 40%);">+          grep -n "[^         -~]" % | \</span><br><span style="color: hsl(120, 100%, 40%);">+              grep -iv "$EXCLUDED_PHRASES" | \</span><br><span style="color: hsl(120, 100%, 40%);">+            grep --color='auto' "[^     -~]"</span><br><span></span><br></pre><p>To view, visit <a href="https://review.coreboot.org/28448">change 28448</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/28448"/><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: newchange </div>
<div style="display:none"> Gerrit-Change-Id: Ic017dc3465fd9a46ff4e6ec5ef16396e963483cd </div>
<div style="display:none"> Gerrit-Change-Number: 28448 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Martin Roth <martinroth@google.com> </div>