<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>docs/CODE_STYLE.md - fork/static-web-server @ allow-symlink</title>
<meta name="description" content="docs/CODE_STYLE.md in fork/static-web-server at allow-symlink.">
<meta property="og:title" content="docs/CODE_STYLE.md - fork/static-web-server @ allow-symlink">
<meta property="og:description" content="docs/CODE_STYLE.md in fork/static-web-server at allow-symlink.">
<meta property="og:type" content="website">
<meta property="og:site_name" content="git.julia.blue">
<link rel="stylesheet" href="/css/style.css?v=62">
<script type="module" src="/js/main.js?v=62"></script>
</head>
<body>
<main data-ref="allow-symlink" data-tip="4414610fe1b0370ff0ac415e9367548840584710">
<noscript>
  <div class="callout">
    <p>
      hey! this is a static git repo viewer. commit diffs, file history,
      older commits and other revisions won't load without javascript.
    </p>
    <p>
      you are still able to view source files on branch/tag tips,
      but the experience is degraded.
    </p>
  </div>
</noscript>
<header class="repo"><div>
<h1>fork/static-web-server</h1>
</div>
<pre class="clone">git clone https://git.julia.blue/fork/static-web-server</pre>
</header>
<p class="snapshot-commit"><span class="commit-author">Matthias Schoettle</span><span class="commit-message" data-commit="dd43d06551fcf853e0012381c76af5b832d23b57">refactor: format check support Markdown files via mdformat (#597)</span><span class="snapshot-sha sha" data-commit="dd43d06551fcf853e0012381c76af5b832d23b57">dd43d06</span><time datetime="2025-12-07T04:40:21-05:00" title="2025-12-07 04:40:21 -0500">2025-12-07</time></p>
<header class="topbar"><details class="switcher"><summary>allow-symlink</summary><div class="menu"><strong>branches</strong><a class="current" href="/fork/static-web-server/ref/allow-symlink/">allow-symlink</a><a class="all" href="/fork/static-web-server/refs">all refs →</a></div></details><nav class="crumbs"><a href="/fork/static-web-server/">static-web-server</a> / <a href="/fork/static-web-server/ref/allow-symlink/tree/docs/">docs</a> / <span class="cur">CODE_STYLE.md</span></nav>
<span class="view-stats"><span>654 B</span><span>26 lines</span></span><span class="actions"><a class="raw" href="/fork/static-web-server/raw/b27ff71f4c0c7ab61a2c500d1934659e61eab699/docs/CODE_STYLE.md">raw</a></span></header>
<div class="markdown-view"><input type="radio" name="markdown-view" id="markdown-rendered" checked><label for="markdown-rendered">rendered</label><input type="radio" name="markdown-view" id="markdown-code"><label for="markdown-code">code</label><section class="readme rendered"><h1>Code Style</h1>
<p>SWS uses the default configuration of <code>rustfmt</code>.</p>
<h2>cargo fmt</h2>
<p><code>cargo fmt --all</code> does not work in SWS. Please use the following commands:</p>
<h3>Linux/BSDs</h3>
<pre class="language-bash"><a-f>rustfmt</a-f> <a-co>--check</a-co> <a-co>--edition</a-co> 2021 <a-eb>$(</a-eb><a-f>git</a-f><a-eb> ls-files </a-eb><a-s>&#39;*.rs&#39;</a-s><a-eb>)</a-eb></pre>
<h3>Windows</h3>
<pre class="language-powershell"><a-f>Get-ChildItem</a-f> . -Filter <a-s>&quot;*.rs&quot;</a-s> -Recurse | <a-f>foreach</a-f> { <a-f>rustfmt</a-f> --check --edition <a-n>2021</a-n> <a-v>$_</a-v>.<a-pr>FullName</a-pr> }</pre>
<blockquote>
<p><strong>NOTE</strong>: If you are using <code>rust-analyzer</code>, you can add the following two lines in your <code>settings.json</code> to make sure the features get taken into account when checking the project:</p>
<pre class="language-json"> <a-s>&quot;rust-analyzer.cargo.features&quot;</a-s>: [<a-s>&quot;full&quot;</a-s>],
 <a-s>&quot;rust-analyzer.check.features&quot;</a-s>: [<a-s>&quot;full&quot;</a-s>],</pre>
</blockquote>
</section><div class="code-panel"><pre class="code src language-markdown"><span class="code-line"><a class="ln" id="L1" href="#L1">1</a><span class="code-text"><a-p>#</a-p> <a-tt>Code Style</a-tt></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L2" href="#L2">2</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L3" href="#L3">3</a><span class="code-text">SWS uses the default configuration of `rustfmt`.</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L4" href="#L4">4</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L5" href="#L5">5</a><span class="code-text"><a-p>##</a-p> <a-tt>cargo fmt</a-tt></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L6" href="#L6">6</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L7" href="#L7">7</a><span class="code-text">`cargo fmt --all` does not work in SWS. Please use the following commands:</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L8" href="#L8">8</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L9" href="#L9">9</a><span class="code-text"><a-p>###</a-p> <a-tt>Linux/BSDs</a-tt></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L10" href="#L10">10</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L11" href="#L11">11</a><span class="code-text"><a-p>```</a-p><a-tl>sh</a-tl></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L12" href="#L12">12</a><span class="code-text"><a-p>rustfmt --check --edition 2021 $(git ls-files &#39;*.rs&#39;)</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L13" href="#L13">13</a><span class="code-text"><a-p>```</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L14" href="#L14">14</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L15" href="#L15">15</a><span class="code-text"><a-p>### </a-p><a-tt>Windows</a-tt></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L16" href="#L16">16</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L17" href="#L17">17</a><span class="code-text"><a-p>```</a-p><a-tl>powershell</a-tl></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L18" href="#L18">18</a><span class="code-text"><a-p>Get-ChildItem . -Filter </a-p><a-s>&quot;*.rs&quot;</a-s><a-p> -Recurse | </a-p><a-f>foreach</a-f><a-p> { </a-p><a-f>rustfmt</a-f><a-p> --check --edition </a-p><a-n>2021</a-n><a-p> </a-p><a-v>$_</a-v><a-p>.</a-p><a-pr>FullName</a-pr><a-p> }</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L19" href="#L19">19</a><span class="code-text"><a-p>```</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L20" href="#L20">20</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L21" href="#L21">21</a><span class="code-text"><a-p>&gt; **NOTE**: If you are using `rust-analyzer`, you can add the following two lines in your `settings.json` to make sure the features get taken into account when checking the project:</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L22" href="#L22">22</a><span class="code-text"><a-p>&gt;</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L23" href="#L23">23</a><span class="code-text"><a-p>&gt; </a-p><a-tl>```json</a-tl></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L24" href="#L24">24</a><span class="code-text"><a-p>&gt; </a-p><a-tl> </a-tl><a-s>&quot;rust-analyzer.cargo.features&quot;</a-s><a-tl>: [</a-tl><a-s>&quot;full&quot;</a-s><a-tl>],</a-tl></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L25" href="#L25">25</a><span class="code-text"><a-p>&gt; </a-p><a-tl> </a-tl><a-s>&quot;rust-analyzer.check.features&quot;</a-s><a-tl>: [</a-tl><a-s>&quot;full&quot;</a-s><a-tl>],</a-tl></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L26" href="#L26">26</a><span class="code-text"><a-p>&gt; ```</a-p></span></span></pre></div></div>
</main>
</body>
</html>
