<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html lang="en">
<head>
<meta content="text/html; charset=US-ASCII" http-equiv="Content-Type">
<title>
GitLab
</title>
<style data-premailer="ignore" type="text/css">
a { color: #1068bf; }
</style>
<style>img {
max-width: 100%; height: auto;
}
body {
font-size: 0.875rem;
}
body {
-webkit-text-shadow: rgba(255,255,255,0.01) 0 0 1px;
}
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, Cantarell, "Helvetica Neue", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; font-size: inherit;
}
</style>
</head>
<body style='font-size: inherit; -webkit-text-shadow: rgba(255,255,255,0.01) 0 0 1px; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, Cantarell, "Helvetica Neue", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";'>
<div class="content">
<p style="color: #777777;">
<a href="https://gitlab.com/dueno">Daiki Ueno</a>
<a href="https://gitlab.com/gnutls/gnutls/-/issues/1419#note_1161601298">commented</a>:
</p>
<div class="md" style="color: #303030; word-wrap: break-word;">
<blockquote dir="auto" style="font-size: inherit; color: #525252; padding-top: 0.5rem; padding-bottom: 0.5rem; padding-left: 1.5rem; box-shadow: inset 4px 0 0 0 #dbdbdb; border-top-width: 0; border-bottom-width: 0; border-right-width: 0; margin: 0 0 0.5rem;" align="initial">
<p style="color: inherit; line-height: 1.5; margin: 0;">Ah right, yes 'make indent' and 'make syntax-check' requires a bootstrapped build, and I can see why we want something that works without that. A script 'devel/indent-code'?</p>
</blockquote>
<p dir="auto" style="color: #303030; margin: 0 0 16px;" align="initial">Sounds good to me. An alternative would be to introduce a new CI stage before <code style='font-size: 90%; color: #1f1f1f; word-wrap: break-word; background-color: #f0f0f0; border-radius: 4px; margin-top: 0; font-weight: inherit; font-family: "Menlo", "DejaVu Sans Mono", "Liberation Mono", "Consolas", "Ubuntu Mono", "Courier New", "andale mono", "lucida console", monospace; white-space: pre-wrap; overflow-wrap: break-word; word-break: keep-all; padding: 2px 4px;'>bootstrap</code> to do syntax checks, so even if it still requires bootstrap, subsequent stages are not executed if it fails.</p>
<blockquote dir="auto" style="font-size: inherit; color: #525252; padding-top: 0.5rem; padding-bottom: 0.5rem; padding-left: 1.5rem; box-shadow: inset 4px 0 0 0 #dbdbdb; border-top-width: 0; border-bottom-width: 0; border-right-width: 0; margin: 0.5rem 0;" align="initial">
<p style="color: inherit; line-height: 1.5; margin: 0;">I'm not familiar with clang-format, how does it interact here?</p>
</blockquote>
<p dir="auto" style="color: #303030; margin: 0 0 16px;" align="initial">Just adding some data points: the Linux kernel has this <a href="https://www.kernel.org/doc/html/latest/process/clang-format.html" rel="nofollow noreferrer noopener" target="_blank" style="margin-top: 0;">guidance</a> and also provides a <a href="https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/.clang-format?id=9d24322e887b6a3d3f9f9c3e76937a646102c8c1" rel="nofollow noreferrer noopener" target="_blank">.clang-format</a> file. NSS (not using the same rule) has this <a href="https://hg.mozilla.org/projects/nss/file/b7e45ee99b4db92e23fcf37806ad3e28a8a13c8a/coreconf/precommit.clang-format.sh" rel="nofollow noreferrer noopener" target="_blank">pre-commit</a>.</p>
<p dir="auto" style="color: #303030; margin: 0 0 16px;" align="initial">It seems clang-format is much slower than GNU indent:</p>
<div class="gl-relative markdown-code-block js-markdown-code" style="margin-bottom: 0;">
<pre class="code highlight js-syntax-highlight language-console" lang="console" v-pre="true" style='display: block; font-size: 13px; color: #303030; line-height: 1.6em; overflow-x: auto; border-radius: 4px; position: relative; font-family: "Menlo", "DejaVu Sans Mono", "Liberation Mono", "Consolas", "Ubuntu Mono", "Courier New", "andale mono", "lucida console", monospace; word-break: break-all; word-wrap: break-word; background-color: #fafafa; margin: 0 0 16px; padding: 12px; border: 1px solid #dbdbdb;'><code style='font-size: inherit; color: inherit; word-wrap: normal; word-break: keep-all; background-color: inherit; border-radius: 4px; white-space: pre; margin-top: 0; font-family: "Menlo", "DejaVu Sans Mono", "Liberation Mono", "Consolas", "Ubuntu Mono", "Courier New", "andale mono", "lucida console", monospace; overflow-wrap: normal; padding: unset;'><span id="LC1" class="line" lang="console" style="margin-top: 0;"><span class="go" style="margin-top: 0;">% cd lib</span></span>
<span id="LC2" class="line" lang="console"><span class="go" style="margin-top: 0;">% cp .../linux/.clang-format .</span></span>
<span id="LC3" class="line" lang="console"></span>
<span id="LC4" class="line" lang="console"><span class="gp" style="margin-top: 0;">% time find . -name "*.[ch]" -exec indent -ppi1 -linux {} \;</span></span>
<span id="LC5" class="line" lang="console"><span class="gp" style="margin-top: 0;">find . -name "*.[ch]" -exec indent -ppi1 -linux {} \;</span><span class="w"> </span>0.69s user 1.39s system 96% cpu 2.152 total</span>
<span id="LC6" class="line" lang="console"></span>
<span id="LC7" class="line" lang="console"><span class="gp" style="margin-top: 0;">% time find . -name "*.[ch]" -exec clang-format -i {} \;</span></span>
<span id="LC8" class="line" lang="console"><span class="gp" style="margin-top: 0;">find . -name "*.[ch]" -exec clang-format -i {} \;</span><span class="w"> </span>12.48s user 7.93s system 98% cpu 20.667 total</span></code></pre>
<copy-code></copy-code>
</div>
</div>
</div>
<div class="footer" style="margin-top: 10px;">
<p style="font-size: small; color: #666;">
—
<br>
Reply to this email directly or <a href="https://gitlab.com/gnutls/gnutls/-/issues/1419#note_1161601298">view it on GitLab</a>.
<br>
You're receiving this email because of your account on <a target="_blank" rel="noopener noreferrer" href="https://gitlab.com">gitlab.com</a>. <a href="https://gitlab.com/-/sent_notifications/bb6180c4b8baf3c0f19c82c707ae26eb/unsubscribe" target="_blank" rel="noopener noreferrer">Unsubscribe</a> from this thread · <a href="https://gitlab.com/-/profile/notifications" target="_blank" rel="noopener noreferrer" class="mng-notif-link">Manage all notifications</a> · <a href="https://gitlab.com/help" target="_blank" rel="noopener noreferrer" class="help-link">Help</a>
<script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","action":{"@type":"ViewAction","name":"View Issue","url":"https://gitlab.com/gnutls/gnutls/-/issues/1419#note_1161601298"}}</script>
</p>
</div>
</body>
</html>