From c97a83ddf27c435cc3d9c7ace394fb45473378d9 Mon Sep 17 00:00:00 2001 From: "Documenter.jl" <documenter@juliadocs.github.io> Date: Mon, 7 Oct 2024 06:16:56 +0000 Subject: [PATCH] build based on 82036b7 --- dev/.documenter-siteinfo.json | 2 +- dev/api/index.html | 26 +++++++++++++------------- dev/blue_style/index.html | 4 ++-- dev/config/index.html | 2 +- dev/custom_alignment/index.html | 2 +- dev/custom_styles/index.html | 2 +- dev/how_it_works/index.html | 2 +- dev/index.html | 2 +- dev/integrations/index.html | 2 +- dev/objects.inv | Bin 2407 -> 2407 bytes dev/sciml_style/index.html | 4 ++-- dev/skipping_formatting/index.html | 2 +- dev/style/index.html | 2 +- dev/transforms/index.html | 2 +- dev/yas_style/index.html | 4 ++-- 15 files changed, 29 insertions(+), 29 deletions(-) diff --git a/dev/.documenter-siteinfo.json b/dev/.documenter-siteinfo.json index f40b0527..906541fc 100644 --- a/dev/.documenter-siteinfo.json +++ b/dev/.documenter-siteinfo.json @@ -1 +1 @@ -{"documenter":{"julia_version":"1.10.5","generation_timestamp":"2024-10-07T06:14:44","documenter_version":"1.7.0"}} \ No newline at end of file +{"documenter":{"julia_version":"1.10.5","generation_timestamp":"2024-10-07T06:16:50","documenter_version":"1.7.0"}} \ No newline at end of file diff --git a/dev/api/index.html b/dev/api/index.html index d6b77b06..637e1fb2 100644 --- a/dev/api/index.html +++ b/dev/api/index.html @@ -7,14 +7,14 @@ to calculate extra whitespace padding. - `whitespaces`. Number of whitespaces between the alignment character and the prior FST node. If this is > 1 it signifies additional whitespace was -manually added by the user since the formatter would only use 0 or 1 whitespaces.</code></pre></div><a class="docs-sourcelink" target="_blank" href="https://github.com/domluna/JuliaFormatter.jl/blob/bd653ed12450f9a9e5f94ba0963d248acda259b6/src/align.jl#L34-L48">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="JuliaFormatter.DefaultStyle" href="#JuliaFormatter.DefaultStyle"><code>JuliaFormatter.DefaultStyle</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">DefaultStyle</code></pre><p>The default formatting style. See the <a href="../style/#Style">Style</a> section of the documentation for more details.</p><p>See also: <a href="../blue_style/#JuliaFormatter.BlueStyle"><code>BlueStyle</code></a>, <a href="../yas_style/#JuliaFormatter.YASStyle"><code>YASStyle</code></a>, <a href="../sciml_style/#JuliaFormatter.SciMLStyle"><code>SciMLStyle</code></a>, <a href="#JuliaFormatter.MinimalStyle"><code>MinimalStyle</code></a></p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/domluna/JuliaFormatter.jl/blob/bd653ed12450f9a9e5f94ba0963d248acda259b6/src/JuliaFormatter.jl#L57-L64">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="JuliaFormatter.FST" href="#JuliaFormatter.FST"><code>JuliaFormatter.FST</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><p>Formatted Syntax Tree</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/domluna/JuliaFormatter.jl/blob/bd653ed12450f9a9e5f94ba0963d248acda259b6/src/fst.jl#L95-L97">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="JuliaFormatter.MinimalStyle" href="#JuliaFormatter.MinimalStyle"><code>JuliaFormatter.MinimalStyle</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">MinimalStyle()</code></pre></div><a class="docs-sourcelink" target="_blank" href="https://github.com/domluna/JuliaFormatter.jl/blob/bd653ed12450f9a9e5f94ba0963d248acda259b6/src/styles/minimal/pretty.jl#L1-L3">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="JuliaFormatter.add_node!-Tuple{JuliaFormatter.FST, JuliaFormatter.FST, JuliaFormatter.State}" href="#JuliaFormatter.add_node!-Tuple{JuliaFormatter.FST, JuliaFormatter.FST, JuliaFormatter.State}"><code>JuliaFormatter.add_node!</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">add_node!( +manually added by the user since the formatter would only use 0 or 1 whitespaces.</code></pre></div><a class="docs-sourcelink" target="_blank" href="https://github.com/domluna/JuliaFormatter.jl/blob/82036b71c4c04e8cf82a5f1a4ea22dd9f15449aa/src/align.jl#L34-L48">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="JuliaFormatter.DefaultStyle" href="#JuliaFormatter.DefaultStyle"><code>JuliaFormatter.DefaultStyle</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">DefaultStyle</code></pre><p>The default formatting style. See the <a href="../style/#Style">Style</a> section of the documentation for more details.</p><p>See also: <a href="../blue_style/#JuliaFormatter.BlueStyle"><code>BlueStyle</code></a>, <a href="../yas_style/#JuliaFormatter.YASStyle"><code>YASStyle</code></a>, <a href="../sciml_style/#JuliaFormatter.SciMLStyle"><code>SciMLStyle</code></a>, <a href="#JuliaFormatter.MinimalStyle"><code>MinimalStyle</code></a></p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/domluna/JuliaFormatter.jl/blob/82036b71c4c04e8cf82a5f1a4ea22dd9f15449aa/src/JuliaFormatter.jl#L57-L64">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="JuliaFormatter.FST" href="#JuliaFormatter.FST"><code>JuliaFormatter.FST</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><p>Formatted Syntax Tree</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/domluna/JuliaFormatter.jl/blob/82036b71c4c04e8cf82a5f1a4ea22dd9f15449aa/src/fst.jl#L95-L97">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="JuliaFormatter.MinimalStyle" href="#JuliaFormatter.MinimalStyle"><code>JuliaFormatter.MinimalStyle</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">MinimalStyle()</code></pre></div><a class="docs-sourcelink" target="_blank" href="https://github.com/domluna/JuliaFormatter.jl/blob/82036b71c4c04e8cf82a5f1a4ea22dd9f15449aa/src/styles/minimal/pretty.jl#L1-L3">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="JuliaFormatter.add_node!-Tuple{JuliaFormatter.FST, JuliaFormatter.FST, JuliaFormatter.State}" href="#JuliaFormatter.add_node!-Tuple{JuliaFormatter.FST, JuliaFormatter.FST, JuliaFormatter.State}"><code>JuliaFormatter.add_node!</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">add_node!( t::FST, n::FST, s::State; join_lines::Bool = false, max_padding::Int = -1, override_join_lines_based_on_source::Bool = false, -)</code></pre><p>Appends <code>n</code> to <code>t</code>.</p><ul><li><code>join_lines</code> if <code>false</code> a NEWLINE node will be added and <code>n</code> will appear</li></ul><p>on the next line, otherwise it will appear on the same line as the previous node (when printing).</p><ul><li><code>max_padding</code> >= 0 indicates margin of <code>t</code> should be based on whether the margin</li></ul><p>of <code>n</code> + <code>max_padding</code> is greater than the current margin of <code>t</code>. Otherwise the margin <code>n</code> will be added to <code>t</code>.</p><ul><li><code>override_join_lines_based_on_source</code> is only used when <code>join_lines_based_on_source</code> option is <code>true</code>. In which</li></ul><p><code>n</code> is added to <code>t</code> as if <code>join_lines_based_on_source</code> was false.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/domluna/JuliaFormatter.jl/blob/bd653ed12450f9a9e5f94ba0963d248acda259b6/src/fst.jl#L434-L454">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="JuliaFormatter.align_binaryopcalls!-Tuple{JuliaFormatter.FST, Vector{Int64}}" href="#JuliaFormatter.align_binaryopcalls!-Tuple{JuliaFormatter.FST, Vector{Int64}}"><code>JuliaFormatter.align_binaryopcalls!</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">align_binaryopcalls!(fst::FST, op_inds::Vector{Int})</code></pre><p>Aligns binary operator expressions.</p><p>Additionally handles the case where a keyword such as <code>const</code> is used prior to the binary op call.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/domluna/JuliaFormatter.jl/blob/bd653ed12450f9a9e5f94ba0963d248acda259b6/src/align.jl#L108-L115">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="JuliaFormatter.align_conditional!-Tuple{JuliaFormatter.FST}" href="#JuliaFormatter.align_conditional!-Tuple{JuliaFormatter.FST}"><code>JuliaFormatter.align_conditional!</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">align_conditional!(fst::FST)</code></pre><p>Aligns a conditional expression.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/domluna/JuliaFormatter.jl/blob/bd653ed12450f9a9e5f94ba0963d248acda259b6/src/align.jl#L248-L252">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="JuliaFormatter.align_matrix!-Tuple{JuliaFormatter.FST}" href="#JuliaFormatter.align_matrix!-Tuple{JuliaFormatter.FST}"><code>JuliaFormatter.align_matrix!</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><p>Adjust whitespace in between matrix elements such that it's the same as the original source file.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/domluna/JuliaFormatter.jl/blob/bd653ed12450f9a9e5f94ba0963d248acda259b6/src/align.jl#L313-L315">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="JuliaFormatter.align_struct!-Tuple{JuliaFormatter.FST}" href="#JuliaFormatter.align_struct!-Tuple{JuliaFormatter.FST}"><code>JuliaFormatter.align_struct!</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">align_struct!(fst::FST)</code></pre><p>Aligns struct fields.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/domluna/JuliaFormatter.jl/blob/bd653ed12450f9a9e5f94ba0963d248acda259b6/src/align.jl#L181-L185">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="JuliaFormatter.annotate_typefields_with_any!-Tuple{JuliaFormatter.FST, JuliaFormatter.State}" href="#JuliaFormatter.annotate_typefields_with_any!-Tuple{JuliaFormatter.FST, JuliaFormatter.State}"><code>JuliaFormatter.annotate_typefields_with_any!</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">annotate_typefields_with_any!(fst::FST, s::State)</code></pre><p>Annotates fields in a type definitions with <code>::Any</code> if no type annotation is provided.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/domluna/JuliaFormatter.jl/blob/bd653ed12450f9a9e5f94ba0963d248acda259b6/src/passes.jl#L207-L212">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="JuliaFormatter.binaryop_to_whereop!-Tuple{JuliaFormatter.FST, JuliaFormatter.State}" href="#JuliaFormatter.binaryop_to_whereop!-Tuple{JuliaFormatter.FST, JuliaFormatter.State}"><code>JuliaFormatter.binaryop_to_whereop!</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">binaryop_to_whereop(fst::FST, s::State)</code></pre><p>Handles the case of a function def defined as:</p><pre><code class="language-julia hljs">foo(a::A)::R where A = body</code></pre><p>In this case instead of it being parsed as (1):</p><pre><code class="nohighlight hljs">Binary +)</code></pre><p>Appends <code>n</code> to <code>t</code>.</p><ul><li><code>join_lines</code> if <code>false</code> a NEWLINE node will be added and <code>n</code> will appear</li></ul><p>on the next line, otherwise it will appear on the same line as the previous node (when printing).</p><ul><li><code>max_padding</code> >= 0 indicates margin of <code>t</code> should be based on whether the margin</li></ul><p>of <code>n</code> + <code>max_padding</code> is greater than the current margin of <code>t</code>. Otherwise the margin <code>n</code> will be added to <code>t</code>.</p><ul><li><code>override_join_lines_based_on_source</code> is only used when <code>join_lines_based_on_source</code> option is <code>true</code>. In which</li></ul><p><code>n</code> is added to <code>t</code> as if <code>join_lines_based_on_source</code> was false.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/domluna/JuliaFormatter.jl/blob/82036b71c4c04e8cf82a5f1a4ea22dd9f15449aa/src/fst.jl#L434-L454">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="JuliaFormatter.align_binaryopcalls!-Tuple{JuliaFormatter.FST, Vector{Int64}}" href="#JuliaFormatter.align_binaryopcalls!-Tuple{JuliaFormatter.FST, Vector{Int64}}"><code>JuliaFormatter.align_binaryopcalls!</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">align_binaryopcalls!(fst::FST, op_inds::Vector{Int})</code></pre><p>Aligns binary operator expressions.</p><p>Additionally handles the case where a keyword such as <code>const</code> is used prior to the binary op call.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/domluna/JuliaFormatter.jl/blob/82036b71c4c04e8cf82a5f1a4ea22dd9f15449aa/src/align.jl#L108-L115">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="JuliaFormatter.align_conditional!-Tuple{JuliaFormatter.FST}" href="#JuliaFormatter.align_conditional!-Tuple{JuliaFormatter.FST}"><code>JuliaFormatter.align_conditional!</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">align_conditional!(fst::FST)</code></pre><p>Aligns a conditional expression.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/domluna/JuliaFormatter.jl/blob/82036b71c4c04e8cf82a5f1a4ea22dd9f15449aa/src/align.jl#L248-L252">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="JuliaFormatter.align_matrix!-Tuple{JuliaFormatter.FST}" href="#JuliaFormatter.align_matrix!-Tuple{JuliaFormatter.FST}"><code>JuliaFormatter.align_matrix!</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><p>Adjust whitespace in between matrix elements such that it's the same as the original source file.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/domluna/JuliaFormatter.jl/blob/82036b71c4c04e8cf82a5f1a4ea22dd9f15449aa/src/align.jl#L313-L315">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="JuliaFormatter.align_struct!-Tuple{JuliaFormatter.FST}" href="#JuliaFormatter.align_struct!-Tuple{JuliaFormatter.FST}"><code>JuliaFormatter.align_struct!</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">align_struct!(fst::FST)</code></pre><p>Aligns struct fields.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/domluna/JuliaFormatter.jl/blob/82036b71c4c04e8cf82a5f1a4ea22dd9f15449aa/src/align.jl#L181-L185">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="JuliaFormatter.annotate_typefields_with_any!-Tuple{JuliaFormatter.FST, JuliaFormatter.State}" href="#JuliaFormatter.annotate_typefields_with_any!-Tuple{JuliaFormatter.FST, JuliaFormatter.State}"><code>JuliaFormatter.annotate_typefields_with_any!</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">annotate_typefields_with_any!(fst::FST, s::State)</code></pre><p>Annotates fields in a type definitions with <code>::Any</code> if no type annotation is provided.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/domluna/JuliaFormatter.jl/blob/82036b71c4c04e8cf82a5f1a4ea22dd9f15449aa/src/passes.jl#L207-L212">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="JuliaFormatter.binaryop_to_whereop!-Tuple{JuliaFormatter.FST, JuliaFormatter.State}" href="#JuliaFormatter.binaryop_to_whereop!-Tuple{JuliaFormatter.FST, JuliaFormatter.State}"><code>JuliaFormatter.binaryop_to_whereop!</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">binaryop_to_whereop(fst::FST, s::State)</code></pre><p>Handles the case of a function def defined as:</p><pre><code class="language-julia hljs">foo(a::A)::R where A = body</code></pre><p>In this case instead of it being parsed as (1):</p><pre><code class="nohighlight hljs">Binary - Where - OP - RHS</code></pre><p>It's parsed as (2):</p><pre><code class="nohighlight hljs">Binary @@ -25,7 +25,7 @@ - R - ... - OP - - RHS</code></pre><p>(1) is preferrable since it's the same parsed result as:</p><pre><code class="language-julia hljs">foo(a::A) where A = body</code></pre><p>This transformation converts (2) to (1).</p><p>ref https://github.com/julia-vscode/CSTParser.jl/issues/93</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/domluna/JuliaFormatter.jl/blob/bd653ed12450f9a9e5f94ba0963d248acda259b6/src/passes.jl#L391-L432">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="JuliaFormatter.eq_to_in_normalization!-Tuple{JuliaFormatter.FST, Bool, String}" href="#JuliaFormatter.eq_to_in_normalization!-Tuple{JuliaFormatter.FST, Bool, String}"><code>JuliaFormatter.eq_to_in_normalization!</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">eq_to_in_normalization!(fst::FST, always_for_in::Bool, for_in_replacement::String) + - RHS</code></pre><p>(1) is preferrable since it's the same parsed result as:</p><pre><code class="language-julia hljs">foo(a::A) where A = body</code></pre><p>This transformation converts (2) to (1).</p><p>ref https://github.com/julia-vscode/CSTParser.jl/issues/93</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/domluna/JuliaFormatter.jl/blob/82036b71c4c04e8cf82a5f1a4ea22dd9f15449aa/src/passes.jl#L391-L432">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="JuliaFormatter.eq_to_in_normalization!-Tuple{JuliaFormatter.FST, Bool, String}" href="#JuliaFormatter.eq_to_in_normalization!-Tuple{JuliaFormatter.FST, Bool, String}"><code>JuliaFormatter.eq_to_in_normalization!</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">eq_to_in_normalization!(fst::FST, always_for_in::Bool, for_in_replacement::String) eq_to_in_normalization!(fst::FST, always_for_in::Nothing, for_in_replacement::String)</code></pre><p>Transforms</p><pre><code class="language-julia hljs">for i = iter body end => @@ -34,16 +34,16 @@ => -for i = 1:10 body end</code></pre><p><code>always_for_in=nothing</code> disables this normalization behavior.</p><ul><li>https://github.com/domluna/JuliaFormatter.jl/issues/34</li></ul></div><a class="docs-sourcelink" target="_blank" href="https://github.com/domluna/JuliaFormatter.jl/blob/bd653ed12450f9a9e5f94ba0963d248acda259b6/src/fst.jl#L1103-L1130">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="JuliaFormatter.find_optimal_nest_placeholders-Tuple{JuliaFormatter.FST, Int64, Int64}" href="#JuliaFormatter.find_optimal_nest_placeholders-Tuple{JuliaFormatter.FST, Int64, Int64}"><code>JuliaFormatter.find_optimal_nest_placeholders</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><p>Finds the optimal placeholders to turn into a newlines such that the length of the arguments on each line is as close as possible while following margin constraints.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/domluna/JuliaFormatter.jl/blob/bd653ed12450f9a9e5f94ba0963d248acda259b6/src/nest_utils.jl#L225-L227">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="JuliaFormatter.flatten_binaryopcall-Tuple{JuliaFormatter.FST}" href="#JuliaFormatter.flatten_binaryopcall-Tuple{JuliaFormatter.FST}"><code>JuliaFormatter.flatten_binaryopcall</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><p>Flattens a binary operation call tree if the operation repeats 2 or more times. "a && b && c" will be transformed while "a && b" will not.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/domluna/JuliaFormatter.jl/blob/bd653ed12450f9a9e5f94ba0963d248acda259b6/src/passes.jl#L13-L16">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="JuliaFormatter.format-Tuple{Any, JuliaFormatter.AbstractStyle}" href="#JuliaFormatter.format-Tuple{Any, JuliaFormatter.AbstractStyle}"><code>JuliaFormatter.format</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">format(path, style::AbstractStyle; options...)::Bool</code></pre></div><a class="docs-sourcelink" target="_blank" href="https://github.com/domluna/JuliaFormatter.jl/blob/bd653ed12450f9a9e5f94ba0963d248acda259b6/src/JuliaFormatter.jl#L484-L486">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="JuliaFormatter.format-Tuple{Any}" href="#JuliaFormatter.format-Tuple{Any}"><code>JuliaFormatter.format</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">format( +for i = 1:10 body end</code></pre><p><code>always_for_in=nothing</code> disables this normalization behavior.</p><ul><li>https://github.com/domluna/JuliaFormatter.jl/issues/34</li></ul></div><a class="docs-sourcelink" target="_blank" href="https://github.com/domluna/JuliaFormatter.jl/blob/82036b71c4c04e8cf82a5f1a4ea22dd9f15449aa/src/fst.jl#L1103-L1130">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="JuliaFormatter.find_optimal_nest_placeholders-Tuple{JuliaFormatter.FST, Int64, Int64}" href="#JuliaFormatter.find_optimal_nest_placeholders-Tuple{JuliaFormatter.FST, Int64, Int64}"><code>JuliaFormatter.find_optimal_nest_placeholders</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><p>Finds the optimal placeholders to turn into a newlines such that the length of the arguments on each line is as close as possible while following margin constraints.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/domluna/JuliaFormatter.jl/blob/82036b71c4c04e8cf82a5f1a4ea22dd9f15449aa/src/nest_utils.jl#L225-L227">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="JuliaFormatter.flatten_binaryopcall-Tuple{JuliaFormatter.FST}" href="#JuliaFormatter.flatten_binaryopcall-Tuple{JuliaFormatter.FST}"><code>JuliaFormatter.flatten_binaryopcall</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><p>Flattens a binary operation call tree if the operation repeats 2 or more times. "a && b && c" will be transformed while "a && b" will not.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/domluna/JuliaFormatter.jl/blob/82036b71c4c04e8cf82a5f1a4ea22dd9f15449aa/src/passes.jl#L13-L16">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="JuliaFormatter.format-Tuple{Any, JuliaFormatter.AbstractStyle}" href="#JuliaFormatter.format-Tuple{Any, JuliaFormatter.AbstractStyle}"><code>JuliaFormatter.format</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">format(path, style::AbstractStyle; options...)::Bool</code></pre></div><a class="docs-sourcelink" target="_blank" href="https://github.com/domluna/JuliaFormatter.jl/blob/82036b71c4c04e8cf82a5f1a4ea22dd9f15449aa/src/JuliaFormatter.jl#L484-L486">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="JuliaFormatter.format-Tuple{Any}" href="#JuliaFormatter.format-Tuple{Any}"><code>JuliaFormatter.format</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">format( paths; # a path or collection of paths options..., -)::Bool</code></pre><p>Recursively descend into files and directories, formatting any <code>.jl</code>, <code>.md</code>, <code>.jmd</code>, or <code>.qmd</code> files.</p><p>See <a href="#JuliaFormatter.format_file-Tuple{AbstractString}"><code>format_file</code></a> and <a href="#JuliaFormatter.format_text-Tuple{AbstractString}"><code>format_text</code></a> for a description of the options.</p><p>This function will look for <code>.JuliaFormatter.toml</code> in the location of the file being formatted, and searching <em>up</em> the file tree until a config file is (or isn't) found. When found, the configurations in the file will overwrite the given <code>options</code>. See <a href="../config/#Configuration-File">Configuration File</a> for more details.</p><p><strong>Output</strong></p><p>Returns a boolean indicating whether the file was already formatted (<code>true</code>) or not (<code>false</code>).</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/domluna/JuliaFormatter.jl/blob/bd653ed12450f9a9e5f94ba0963d248acda259b6/src/JuliaFormatter.jl#L405-L425">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="JuliaFormatter.format-Tuple{Module, Vararg{Any}}" href="#JuliaFormatter.format-Tuple{Module, Vararg{Any}}"><code>JuliaFormatter.format</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">format(mod::Module, args...; options...)</code></pre></div><a class="docs-sourcelink" target="_blank" href="https://github.com/domluna/JuliaFormatter.jl/blob/bd653ed12450f9a9e5f94ba0963d248acda259b6/src/JuliaFormatter.jl#L492-L494">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="JuliaFormatter.format_file-Tuple{AbstractString}" href="#JuliaFormatter.format_file-Tuple{AbstractString}"><code>JuliaFormatter.format_file</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">format_file( +)::Bool</code></pre><p>Recursively descend into files and directories, formatting any <code>.jl</code>, <code>.md</code>, <code>.jmd</code>, or <code>.qmd</code> files.</p><p>See <a href="#JuliaFormatter.format_file-Tuple{AbstractString}"><code>format_file</code></a> and <a href="#JuliaFormatter.format_text-Tuple{AbstractString}"><code>format_text</code></a> for a description of the options.</p><p>This function will look for <code>.JuliaFormatter.toml</code> in the location of the file being formatted, and searching <em>up</em> the file tree until a config file is (or isn't) found. When found, the configurations in the file will overwrite the given <code>options</code>. See <a href="../config/#Configuration-File">Configuration File</a> for more details.</p><p><strong>Output</strong></p><p>Returns a boolean indicating whether the file was already formatted (<code>true</code>) or not (<code>false</code>).</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/domluna/JuliaFormatter.jl/blob/82036b71c4c04e8cf82a5f1a4ea22dd9f15449aa/src/JuliaFormatter.jl#L405-L425">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="JuliaFormatter.format-Tuple{Module, Vararg{Any}}" href="#JuliaFormatter.format-Tuple{Module, Vararg{Any}}"><code>JuliaFormatter.format</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">format(mod::Module, args...; options...)</code></pre></div><a class="docs-sourcelink" target="_blank" href="https://github.com/domluna/JuliaFormatter.jl/blob/82036b71c4c04e8cf82a5f1a4ea22dd9f15449aa/src/JuliaFormatter.jl#L492-L494">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="JuliaFormatter.format_file-Tuple{AbstractString}" href="#JuliaFormatter.format_file-Tuple{AbstractString}"><code>JuliaFormatter.format_file</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">format_file( filename::AbstractString; overwrite::Bool = true, verbose::Bool = false, format_markdown::Bool = false, format_options..., -)::Bool</code></pre><p>Formats the contents of <code>filename</code> assuming it's a <code>.jl</code>, <code>.md</code>, <code>.jmd</code> or <code>.qmd</code> file.</p><p>See https://domluna.github.io/JuliaFormatter.jl/dev/#File-Options for details on available options.</p><p><strong>Output</strong></p><p>Returns a boolean indicating whether the file was already formatted (<code>true</code>) or not (<code>false</code>).</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/domluna/JuliaFormatter.jl/blob/bd653ed12450f9a9e5f94ba0963d248acda259b6/src/JuliaFormatter.jl#L368-L384">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="JuliaFormatter.format_md-Tuple{AbstractString}" href="#JuliaFormatter.format_md-Tuple{AbstractString}"><code>JuliaFormatter.format_md</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">format_md(text::AbstractString; style::AbstractStyle = DefaultStyle(), kwargs...)</code></pre><p>Normalizes the Markdown source and formats Julia code blocks.</p><p>See <a href="#JuliaFormatter.format_text-Tuple{AbstractString}"><code>format_text</code></a> for description of formatting options.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/domluna/JuliaFormatter.jl/blob/bd653ed12450f9a9e5f94ba0963d248acda259b6/src/markdown.jl#L1-L7">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="JuliaFormatter.format_text-Tuple{AbstractString}" href="#JuliaFormatter.format_text-Tuple{AbstractString}"><code>JuliaFormatter.format_text</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">format_text( +)::Bool</code></pre><p>Formats the contents of <code>filename</code> assuming it's a <code>.jl</code>, <code>.md</code>, <code>.jmd</code> or <code>.qmd</code> file.</p><p>See https://domluna.github.io/JuliaFormatter.jl/dev/#File-Options for details on available options.</p><p><strong>Output</strong></p><p>Returns a boolean indicating whether the file was already formatted (<code>true</code>) or not (<code>false</code>).</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/domluna/JuliaFormatter.jl/blob/82036b71c4c04e8cf82a5f1a4ea22dd9f15449aa/src/JuliaFormatter.jl#L368-L384">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="JuliaFormatter.format_md-Tuple{AbstractString}" href="#JuliaFormatter.format_md-Tuple{AbstractString}"><code>JuliaFormatter.format_md</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">format_md(text::AbstractString; style::AbstractStyle = DefaultStyle(), kwargs...)</code></pre><p>Normalizes the Markdown source and formats Julia code blocks.</p><p>See <a href="#JuliaFormatter.format_text-Tuple{AbstractString}"><code>format_text</code></a> for description of formatting options.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/domluna/JuliaFormatter.jl/blob/82036b71c4c04e8cf82a5f1a4ea22dd9f15449aa/src/markdown.jl#L1-L7">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="JuliaFormatter.format_text-Tuple{AbstractString}" href="#JuliaFormatter.format_text-Tuple{AbstractString}"><code>JuliaFormatter.format_text</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">format_text( text::AbstractString; style::AbstractStyle = DefaultStyle(), indent::Int = 4, @@ -75,7 +75,7 @@ surround_whereop_typeparameters::Bool = true, variable_call_indent::Vector{String} = [] short_circuit_to_if::Bool = false, -)::String</code></pre><p>Formats a Julia source passed in as a string, returning the formatted code as another string.</p><p>See https://domluna.github.io/JuliaFormatter.jl/dev/#Formatting-Options for details on available options.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/domluna/JuliaFormatter.jl/blob/bd653ed12450f9a9e5f94ba0963d248acda259b6/src/JuliaFormatter.jl#L180-L219">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="JuliaFormatter.has_semicolon-Tuple{JuliaFormatter.Document, Integer}" href="#JuliaFormatter.has_semicolon-Tuple{JuliaFormatter.Document, Integer}"><code>JuliaFormatter.has_semicolon</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">has_semicolon(d::Document, line::Integer)</code></pre><p>Returns whether <code>d</code> has a valid semicolon grouping on <code>line</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/domluna/JuliaFormatter.jl/blob/bd653ed12450f9a9e5f94ba0963d248acda259b6/src/state.jl#L17-L21">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="JuliaFormatter.is_dot_op-Tuple{CSTParser.EXPR}" href="#JuliaFormatter.is_dot_op-Tuple{CSTParser.EXPR}"><code>JuliaFormatter.is_dot_op</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">is_dot_op(x::CSTParser.EXPR)</code></pre><p>Checks if the binary operation is a dot operation (e.g. <code>x.y</code>, <code>x..z</code>, <code>x...z</code>). This is different from a dot or broadcast operation.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/domluna/JuliaFormatter.jl/blob/bd653ed12450f9a9e5f94ba0963d248acda259b6/src/fst.jl#L1177-L1181">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="JuliaFormatter.is_iterable_arg-Tuple{JuliaFormatter.FST}" href="#JuliaFormatter.is_iterable_arg-Tuple{JuliaFormatter.FST}"><code>JuliaFormatter.is_iterable_arg</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><p>Returns whether <code>fst</code> can be an iterable argument. For example in the case of a function call, which is of type <code>Call</code>:</p><pre><code class="language-julia hljs">(a, b, c; k1=v1)</code></pre><p>This would return <code>true</code> for <code>a</code>, <code>b</code>, <code>c</code> and <code>k1=v1</code> and <code>false</code> for all other nodes.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/domluna/JuliaFormatter.jl/blob/bd653ed12450f9a9e5f94ba0963d248acda259b6/src/fst.jl#L791-L800">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="JuliaFormatter.is_standalone_shortcircuit-Tuple{CSTParser.EXPR}" href="#JuliaFormatter.is_standalone_shortcircuit-Tuple{CSTParser.EXPR}"><code>JuliaFormatter.is_standalone_shortcircuit</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">is_standalone_shortcircuit(cst::CSTParser.EXPR)</code></pre><p>Returns <code>true</code> if the <code>cst</code> is a short-circuit expression (uses <code>&&</code>, <code>||</code>) and is <em>standalone</em>, meaning it's not directly associated with another statement or expression.</p><p><strong>Examples</strong></p><pre><code class="language-julia hljs"># this IS a standalone short-circuit +)::String</code></pre><p>Formats a Julia source passed in as a string, returning the formatted code as another string.</p><p>See https://domluna.github.io/JuliaFormatter.jl/dev/#Formatting-Options for details on available options.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/domluna/JuliaFormatter.jl/blob/82036b71c4c04e8cf82a5f1a4ea22dd9f15449aa/src/JuliaFormatter.jl#L180-L219">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="JuliaFormatter.has_semicolon-Tuple{JuliaFormatter.Document, Integer}" href="#JuliaFormatter.has_semicolon-Tuple{JuliaFormatter.Document, Integer}"><code>JuliaFormatter.has_semicolon</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">has_semicolon(d::Document, line::Integer)</code></pre><p>Returns whether <code>d</code> has a valid semicolon grouping on <code>line</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/domluna/JuliaFormatter.jl/blob/82036b71c4c04e8cf82a5f1a4ea22dd9f15449aa/src/state.jl#L17-L21">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="JuliaFormatter.is_dot_op-Tuple{CSTParser.EXPR}" href="#JuliaFormatter.is_dot_op-Tuple{CSTParser.EXPR}"><code>JuliaFormatter.is_dot_op</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">is_dot_op(x::CSTParser.EXPR)</code></pre><p>Checks if the binary operation is a dot operation (e.g. <code>x.y</code>, <code>x..z</code>, <code>x...z</code>). This is different from a dot or broadcast operation.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/domluna/JuliaFormatter.jl/blob/82036b71c4c04e8cf82a5f1a4ea22dd9f15449aa/src/fst.jl#L1177-L1181">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="JuliaFormatter.is_iterable_arg-Tuple{JuliaFormatter.FST}" href="#JuliaFormatter.is_iterable_arg-Tuple{JuliaFormatter.FST}"><code>JuliaFormatter.is_iterable_arg</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><p>Returns whether <code>fst</code> can be an iterable argument. For example in the case of a function call, which is of type <code>Call</code>:</p><pre><code class="language-julia hljs">(a, b, c; k1=v1)</code></pre><p>This would return <code>true</code> for <code>a</code>, <code>b</code>, <code>c</code> and <code>k1=v1</code> and <code>false</code> for all other nodes.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/domluna/JuliaFormatter.jl/blob/82036b71c4c04e8cf82a5f1a4ea22dd9f15449aa/src/fst.jl#L791-L800">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="JuliaFormatter.is_standalone_shortcircuit-Tuple{CSTParser.EXPR}" href="#JuliaFormatter.is_standalone_shortcircuit-Tuple{CSTParser.EXPR}"><code>JuliaFormatter.is_standalone_shortcircuit</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">is_standalone_shortcircuit(cst::CSTParser.EXPR)</code></pre><p>Returns <code>true</code> if the <code>cst</code> is a short-circuit expression (uses <code>&&</code>, <code>||</code>) and is <em>standalone</em>, meaning it's not directly associated with another statement or expression.</p><p><strong>Examples</strong></p><pre><code class="language-julia hljs"># this IS a standalone short-circuit a && b # this IS NOT a standalone short-circuit @@ -90,21 +90,21 @@ # operation inside parenthesis IS NOT a standalone short-circuit # operation outside parenthesis IS a standalone short-circuit -(a && b) && c</code></pre></div><a class="docs-sourcelink" target="_blank" href="https://github.com/domluna/JuliaFormatter.jl/blob/bd653ed12450f9a9e5f94ba0963d248acda259b6/src/fst.jl#L1063-L1090">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="JuliaFormatter.length_to-Tuple{JuliaFormatter.FST, Any}" href="#JuliaFormatter.length_to-Tuple{JuliaFormatter.FST, Any}"><code>JuliaFormatter.length_to</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">`length_to(x::FST, ntyps; start::Int = 1)`</code></pre><p>Returns the length to any node type in <code>ntyps</code> based off the <code>start</code> index.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/domluna/JuliaFormatter.jl/blob/bd653ed12450f9a9e5f94ba0963d248acda259b6/src/fst.jl#L707-L711">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="JuliaFormatter.long_to_short_function_def!-Tuple{JuliaFormatter.FST, JuliaFormatter.State}" href="#JuliaFormatter.long_to_short_function_def!-Tuple{JuliaFormatter.FST, JuliaFormatter.State}"><code>JuliaFormatter.long_to_short_function_def!</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">long_to_short_function_def!(fst::FST, s::State)</code></pre><p>Transforms a <em>long</em> function definition</p><pre><code class="language-julia hljs">function f(arg2, arg2) +(a && b) && c</code></pre></div><a class="docs-sourcelink" target="_blank" href="https://github.com/domluna/JuliaFormatter.jl/blob/82036b71c4c04e8cf82a5f1a4ea22dd9f15449aa/src/fst.jl#L1063-L1090">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="JuliaFormatter.length_to-Tuple{JuliaFormatter.FST, Any}" href="#JuliaFormatter.length_to-Tuple{JuliaFormatter.FST, Any}"><code>JuliaFormatter.length_to</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">`length_to(x::FST, ntyps; start::Int = 1)`</code></pre><p>Returns the length to any node type in <code>ntyps</code> based off the <code>start</code> index.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/domluna/JuliaFormatter.jl/blob/82036b71c4c04e8cf82a5f1a4ea22dd9f15449aa/src/fst.jl#L707-L711">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="JuliaFormatter.long_to_short_function_def!-Tuple{JuliaFormatter.FST, JuliaFormatter.State}" href="#JuliaFormatter.long_to_short_function_def!-Tuple{JuliaFormatter.FST, JuliaFormatter.State}"><code>JuliaFormatter.long_to_short_function_def!</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">long_to_short_function_def!(fst::FST, s::State)</code></pre><p>Transforms a <em>long</em> function definition</p><pre><code class="language-julia hljs">function f(arg2, arg2) body -end</code></pre><p>to a <em>short</em> function definition</p><pre><code class="language-julia hljs">f(arg1, arg2) = body</code></pre></div><a class="docs-sourcelink" target="_blank" href="https://github.com/domluna/JuliaFormatter.jl/blob/bd653ed12450f9a9e5f94ba0963d248acda259b6/src/passes.jl#L333-L349">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="JuliaFormatter.move_at_sign_to_the_end-Tuple{JuliaFormatter.FST, JuliaFormatter.State}" href="#JuliaFormatter.move_at_sign_to_the_end-Tuple{JuliaFormatter.FST, JuliaFormatter.State}"><code>JuliaFormatter.move_at_sign_to_the_end</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">move_at_sign_to_the_end(fst::FST, s::State)</code></pre><p>NOTE: Assumes <code>fst</code> is the caller name of a macrocall such as <code>@macro</code> or <code>Module.@macro</code>.</p><p>Moves <code>@</code> to the last identifier.</p><p>Example:</p><pre><code class="language-julia hljs">@Module.macro</code></pre><p>to</p><pre><code class="language-julia hljs">Module.@macro</code></pre></div><a class="docs-sourcelink" target="_blank" href="https://github.com/domluna/JuliaFormatter.jl/blob/bd653ed12450f9a9e5f94ba0963d248acda259b6/src/passes.jl#L523-L542">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="JuliaFormatter.nest_if_over_margin!-Union{Tuple{S}, Tuple{S, JuliaFormatter.FST, JuliaFormatter.State, Int64}} where S<:JuliaFormatter.AbstractStyle" href="#JuliaFormatter.nest_if_over_margin!-Union{Tuple{S}, Tuple{S, JuliaFormatter.FST, JuliaFormatter.State, Int64}} where S<:JuliaFormatter.AbstractStyle"><code>JuliaFormatter.nest_if_over_margin!</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">nest_if_over_margin!( +end</code></pre><p>to a <em>short</em> function definition</p><pre><code class="language-julia hljs">f(arg1, arg2) = body</code></pre></div><a class="docs-sourcelink" target="_blank" href="https://github.com/domluna/JuliaFormatter.jl/blob/82036b71c4c04e8cf82a5f1a4ea22dd9f15449aa/src/passes.jl#L333-L349">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="JuliaFormatter.move_at_sign_to_the_end-Tuple{JuliaFormatter.FST, JuliaFormatter.State}" href="#JuliaFormatter.move_at_sign_to_the_end-Tuple{JuliaFormatter.FST, JuliaFormatter.State}"><code>JuliaFormatter.move_at_sign_to_the_end</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">move_at_sign_to_the_end(fst::FST, s::State)</code></pre><p>NOTE: Assumes <code>fst</code> is the caller name of a macrocall such as <code>@macro</code> or <code>Module.@macro</code>.</p><p>Moves <code>@</code> to the last identifier.</p><p>Example:</p><pre><code class="language-julia hljs">@Module.macro</code></pre><p>to</p><pre><code class="language-julia hljs">Module.@macro</code></pre></div><a class="docs-sourcelink" target="_blank" href="https://github.com/domluna/JuliaFormatter.jl/blob/82036b71c4c04e8cf82a5f1a4ea22dd9f15449aa/src/passes.jl#L523-L542">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="JuliaFormatter.nest_if_over_margin!-Union{Tuple{S}, Tuple{S, JuliaFormatter.FST, JuliaFormatter.State, Int64}} where S<:JuliaFormatter.AbstractStyle" href="#JuliaFormatter.nest_if_over_margin!-Union{Tuple{S}, Tuple{S, JuliaFormatter.FST, JuliaFormatter.State, Int64}} where S<:JuliaFormatter.AbstractStyle"><code>JuliaFormatter.nest_if_over_margin!</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">nest_if_over_margin!( style, fst::FST, s::State, idx::Int; stop_idx::Union{Int,Nothing} = nothing, -)::Bool</code></pre><p>Converts the node at <code>idx</code> to a <code>NEWLINE</code> if the current margin plus the additional margin from <code>fst[idx:stop_idx-1]</code> is greater than the allowed margin.</p><p>If <code>stop_idx == nothing</code> the range is <code>fst[idx:end]</code>.</p><p>Returns whether nesting occurred.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/domluna/JuliaFormatter.jl/blob/bd653ed12450f9a9e5f94ba0963d248acda259b6/src/nest_utils.jl#L135-L150">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="JuliaFormatter.p_macrostr_identifier-Tuple{DefaultStyle, CSTParser.EXPR, JuliaFormatter.State}" href="#JuliaFormatter.p_macrostr_identifier-Tuple{DefaultStyle, CSTParser.EXPR, JuliaFormatter.State}"><code>JuliaFormatter.p_macrostr_identifier</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><p>This is a special prettifier to handle the case of string macros. As such it is not part of <a href="@ref"><code>pretty</code></a>.</p><pre><code class="language-julia hljs">format"hello"</code></pre><p>The above "format" identifier is parsed by CSTParser as if the text is "@format_str". This creates problems when we format without intervention:</p><ol><li>"@format_str" is printed instead of "format"</li><li>The state offset is incorrect since the length of "@format_str" is greater than "format"</li></ol></div><a class="docs-sourcelink" target="_blank" href="https://github.com/domluna/JuliaFormatter.jl/blob/bd653ed12450f9a9e5f94ba0963d248acda259b6/src/styles/default/pretty.jl#L600-L613">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="JuliaFormatter.parent_is-Tuple{CSTParser.EXPR, Any}" href="#JuliaFormatter.parent_is-Tuple{CSTParser.EXPR, Any}"><code>JuliaFormatter.parent_is</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><p>Returns whether the first unignored parent of <code>cst</code> matches the criteria determined by <code>valid</code>, which is a function that returns a boolean. <code>ignore</code> can be used to ignore certain parent nodes if desired, also a function which returns a boolean.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/domluna/JuliaFormatter.jl/blob/bd653ed12450f9a9e5f94ba0963d248acda259b6/src/fst.jl#L363-L367">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="JuliaFormatter.pipe_to_function_call_pass!-Tuple{JuliaFormatter.FST}" href="#JuliaFormatter.pipe_to_function_call_pass!-Tuple{JuliaFormatter.FST}"><code>JuliaFormatter.pipe_to_function_call_pass!</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">pipe_to_function_call_pass!(fst::FST)</code></pre><p>Rewrites <code>x |> f</code> to <code>f(x)</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/domluna/JuliaFormatter.jl/blob/bd653ed12450f9a9e5f94ba0963d248acda259b6/src/passes.jl#L84-L88">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="JuliaFormatter.prepend_return!-Tuple{JuliaFormatter.FST, JuliaFormatter.State}" href="#JuliaFormatter.prepend_return!-Tuple{JuliaFormatter.FST, JuliaFormatter.State}"><code>JuliaFormatter.prepend_return!</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">prepend_return!(fst::FST, s::State)</code></pre><p>Prepends <code>return</code> to the last expression of a block if applicable.</p><pre><code class="language-julia hljs">function foo() +)::Bool</code></pre><p>Converts the node at <code>idx</code> to a <code>NEWLINE</code> if the current margin plus the additional margin from <code>fst[idx:stop_idx-1]</code> is greater than the allowed margin.</p><p>If <code>stop_idx == nothing</code> the range is <code>fst[idx:end]</code>.</p><p>Returns whether nesting occurred.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/domluna/JuliaFormatter.jl/blob/82036b71c4c04e8cf82a5f1a4ea22dd9f15449aa/src/nest_utils.jl#L135-L150">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="JuliaFormatter.p_macrostr_identifier-Tuple{DefaultStyle, CSTParser.EXPR, JuliaFormatter.State}" href="#JuliaFormatter.p_macrostr_identifier-Tuple{DefaultStyle, CSTParser.EXPR, JuliaFormatter.State}"><code>JuliaFormatter.p_macrostr_identifier</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><p>This is a special prettifier to handle the case of string macros. As such it is not part of <a href="@ref"><code>pretty</code></a>.</p><pre><code class="language-julia hljs">format"hello"</code></pre><p>The above "format" identifier is parsed by CSTParser as if the text is "@format_str". This creates problems when we format without intervention:</p><ol><li>"@format_str" is printed instead of "format"</li><li>The state offset is incorrect since the length of "@format_str" is greater than "format"</li></ol></div><a class="docs-sourcelink" target="_blank" href="https://github.com/domluna/JuliaFormatter.jl/blob/82036b71c4c04e8cf82a5f1a4ea22dd9f15449aa/src/styles/default/pretty.jl#L600-L613">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="JuliaFormatter.parent_is-Tuple{CSTParser.EXPR, Any}" href="#JuliaFormatter.parent_is-Tuple{CSTParser.EXPR, Any}"><code>JuliaFormatter.parent_is</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><p>Returns whether the first unignored parent of <code>cst</code> matches the criteria determined by <code>valid</code>, which is a function that returns a boolean. <code>ignore</code> can be used to ignore certain parent nodes if desired, also a function which returns a boolean.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/domluna/JuliaFormatter.jl/blob/82036b71c4c04e8cf82a5f1a4ea22dd9f15449aa/src/fst.jl#L363-L367">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="JuliaFormatter.pipe_to_function_call_pass!-Tuple{JuliaFormatter.FST}" href="#JuliaFormatter.pipe_to_function_call_pass!-Tuple{JuliaFormatter.FST}"><code>JuliaFormatter.pipe_to_function_call_pass!</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">pipe_to_function_call_pass!(fst::FST)</code></pre><p>Rewrites <code>x |> f</code> to <code>f(x)</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/domluna/JuliaFormatter.jl/blob/82036b71c4c04e8cf82a5f1a4ea22dd9f15449aa/src/passes.jl#L84-L88">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="JuliaFormatter.prepend_return!-Tuple{JuliaFormatter.FST, JuliaFormatter.State}" href="#JuliaFormatter.prepend_return!-Tuple{JuliaFormatter.FST, JuliaFormatter.State}"><code>JuliaFormatter.prepend_return!</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">prepend_return!(fst::FST, s::State)</code></pre><p>Prepends <code>return</code> to the last expression of a block if applicable.</p><pre><code class="language-julia hljs">function foo() a = 2 * 3 a / 3 end</code></pre><p>to</p><pre><code class="language-julia hljs">function foo() a = 2 * 3 return a / 3 -end</code></pre></div><a class="docs-sourcelink" target="_blank" href="https://github.com/domluna/JuliaFormatter.jl/blob/bd653ed12450f9a9e5f94ba0963d248acda259b6/src/passes.jl#L460-L480">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="JuliaFormatter.remove_superfluous_whitespace!-Tuple{JuliaFormatter.FST}" href="#JuliaFormatter.remove_superfluous_whitespace!-Tuple{JuliaFormatter.FST}"><code>JuliaFormatter.remove_superfluous_whitespace!</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">remove_superfluous_whitespace!(fst::FST)</code></pre><p>Soft deletes <code>WHITESPACE</code> or <code>PLACEHOLDER</code> that's directly followed by a <code>NEWLINE</code> or <code>INLINECOMMENT</code> node.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/domluna/JuliaFormatter.jl/blob/bd653ed12450f9a9e5f94ba0963d248acda259b6/src/passes.jl#L698-L702">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="JuliaFormatter.separate_kwargs_with_semicolon!-Tuple{JuliaFormatter.FST}" href="#JuliaFormatter.separate_kwargs_with_semicolon!-Tuple{JuliaFormatter.FST}"><code>JuliaFormatter.separate_kwargs_with_semicolon!</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">separate_kwargs_with_semicolon!(fst::FST)</code></pre><p>Ensures keyword arguments are separated by a ";".</p><p><strong>Examples</strong></p><p>Replace "," with ";".</p><pre><code class="language-julia hljs">a = f(x, y = 3) +end</code></pre></div><a class="docs-sourcelink" target="_blank" href="https://github.com/domluna/JuliaFormatter.jl/blob/82036b71c4c04e8cf82a5f1a4ea22dd9f15449aa/src/passes.jl#L460-L480">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="JuliaFormatter.remove_superfluous_whitespace!-Tuple{JuliaFormatter.FST}" href="#JuliaFormatter.remove_superfluous_whitespace!-Tuple{JuliaFormatter.FST}"><code>JuliaFormatter.remove_superfluous_whitespace!</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">remove_superfluous_whitespace!(fst::FST)</code></pre><p>Soft deletes <code>WHITESPACE</code> or <code>PLACEHOLDER</code> that's directly followed by a <code>NEWLINE</code> or <code>INLINECOMMENT</code> node.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/domluna/JuliaFormatter.jl/blob/82036b71c4c04e8cf82a5f1a4ea22dd9f15449aa/src/passes.jl#L698-L702">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="JuliaFormatter.separate_kwargs_with_semicolon!-Tuple{JuliaFormatter.FST}" href="#JuliaFormatter.separate_kwargs_with_semicolon!-Tuple{JuliaFormatter.FST}"><code>JuliaFormatter.separate_kwargs_with_semicolon!</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">separate_kwargs_with_semicolon!(fst::FST)</code></pre><p>Ensures keyword arguments are separated by a ";".</p><p><strong>Examples</strong></p><p>Replace "," with ";".</p><pre><code class="language-julia hljs">a = f(x, y = 3) -> @@ -112,6 +112,6 @@ -> -a = f(; x = 1, y = 2)</code></pre></div><a class="docs-sourcelink" target="_blank" href="https://github.com/domluna/JuliaFormatter.jl/blob/bd653ed12450f9a9e5f94ba0963d248acda259b6/src/passes.jl#L630-L656">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="JuliaFormatter.short_to_long_function_def!-Tuple{JuliaFormatter.FST, JuliaFormatter.State}" href="#JuliaFormatter.short_to_long_function_def!-Tuple{JuliaFormatter.FST, JuliaFormatter.State}"><code>JuliaFormatter.short_to_long_function_def!</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">short_to_long_function_def!(fst::FST, s::State)</code></pre><p>Transforms a <em>short</em> function definition</p><pre><code class="language-julia hljs">f(arg1, arg2) = body</code></pre><p>to a <em>long</em> function definition</p><pre><code class="language-julia hljs">function f(arg2, arg2) +a = f(; x = 1, y = 2)</code></pre></div><a class="docs-sourcelink" target="_blank" href="https://github.com/domluna/JuliaFormatter.jl/blob/82036b71c4c04e8cf82a5f1a4ea22dd9f15449aa/src/passes.jl#L630-L656">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="JuliaFormatter.short_to_long_function_def!-Tuple{JuliaFormatter.FST, JuliaFormatter.State}" href="#JuliaFormatter.short_to_long_function_def!-Tuple{JuliaFormatter.FST, JuliaFormatter.State}"><code>JuliaFormatter.short_to_long_function_def!</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">short_to_long_function_def!(fst::FST, s::State)</code></pre><p>Transforms a <em>short</em> function definition</p><pre><code class="language-julia hljs">f(arg1, arg2) = body</code></pre><p>to a <em>long</em> function definition</p><pre><code class="language-julia hljs">function f(arg2, arg2) body -end</code></pre></div><a class="docs-sourcelink" target="_blank" href="https://github.com/domluna/JuliaFormatter.jl/blob/bd653ed12450f9a9e5f94ba0963d248acda259b6/src/passes.jl#L239-L255">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="JuliaFormatter.unnestable_node-Tuple{CSTParser.EXPR}" href="#JuliaFormatter.unnestable_node-Tuple{CSTParser.EXPR}"><code>JuliaFormatter.unnestable_node</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><p><code>cst</code> is assumed to be a single child node. Returns true if the node is of the syntactic form <code>{...}, [...], or (...)</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/domluna/JuliaFormatter.jl/blob/bd653ed12450f9a9e5f94ba0963d248acda259b6/src/fst.jl#L991-L993">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="JuliaFormatter.walk-Tuple{Any, JuliaFormatter.FST, JuliaFormatter.State}" href="#JuliaFormatter.walk-Tuple{Any, JuliaFormatter.FST, JuliaFormatter.State}"><code>JuliaFormatter.walk</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">walk(f, fst::FST, s::State)</code></pre><p>Walks <code>fst</code> calling <code>f</code> on each node.</p><p>In situations where descending further into a subtree is not desirable <code>f</code> should return a value other than <code>nothing</code>.</p><div class="admonition is-info"><header class="admonition-header">Note</header><div class="admonition-body"><p>This function mutates the State's (<code>s</code>) <code>line_offset</code>. If this is not desired you should save the value before calling this function and restore it after.</p></div></div></div><a class="docs-sourcelink" target="_blank" href="https://github.com/domluna/JuliaFormatter.jl/blob/bd653ed12450f9a9e5f94ba0963d248acda259b6/src/nest_utils.jl#L24-L35">source</a></section></article></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../config/">« Configuration File</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.7.0 on <span class="colophon-date" title="Monday 7 October 2024 06:14">Monday 7 October 2024</span>. Using Julia version 1.10.5.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html> +end</code></pre></div><a class="docs-sourcelink" target="_blank" href="https://github.com/domluna/JuliaFormatter.jl/blob/82036b71c4c04e8cf82a5f1a4ea22dd9f15449aa/src/passes.jl#L239-L255">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="JuliaFormatter.unnestable_node-Tuple{CSTParser.EXPR}" href="#JuliaFormatter.unnestable_node-Tuple{CSTParser.EXPR}"><code>JuliaFormatter.unnestable_node</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><p><code>cst</code> is assumed to be a single child node. Returns true if the node is of the syntactic form <code>{...}, [...], or (...)</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/domluna/JuliaFormatter.jl/blob/82036b71c4c04e8cf82a5f1a4ea22dd9f15449aa/src/fst.jl#L991-L993">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="JuliaFormatter.walk-Tuple{Any, JuliaFormatter.FST, JuliaFormatter.State}" href="#JuliaFormatter.walk-Tuple{Any, JuliaFormatter.FST, JuliaFormatter.State}"><code>JuliaFormatter.walk</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">walk(f, fst::FST, s::State)</code></pre><p>Walks <code>fst</code> calling <code>f</code> on each node.</p><p>In situations where descending further into a subtree is not desirable <code>f</code> should return a value other than <code>nothing</code>.</p><div class="admonition is-info"><header class="admonition-header">Note</header><div class="admonition-body"><p>This function mutates the State's (<code>s</code>) <code>line_offset</code>. If this is not desired you should save the value before calling this function and restore it after.</p></div></div></div><a class="docs-sourcelink" target="_blank" href="https://github.com/domluna/JuliaFormatter.jl/blob/82036b71c4c04e8cf82a5f1a4ea22dd9f15449aa/src/nest_utils.jl#L24-L35">source</a></section></article></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../config/">« Configuration File</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.7.0 on <span class="colophon-date" title="Monday 7 October 2024 06:16">Monday 7 October 2024</span>. Using Julia version 1.10.5.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html> diff --git a/dev/blue_style/index.html b/dev/blue_style/index.html index c6b14c4e..1d48cf81 100644 --- a/dev/blue_style/index.html +++ b/dev/blue_style/index.html @@ -1,3 +1,3 @@ <!DOCTYPE html> -<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Blue Style · JuliaFormatter</title><meta name="title" content="Blue Style · JuliaFormatter"/><meta property="og:title" content="Blue Style · JuliaFormatter"/><meta property="twitter:title" content="Blue Style · JuliaFormatter"/><meta name="description" content="Documentation for JuliaFormatter."/><meta property="og:description" content="Documentation for JuliaFormatter."/><meta property="twitter:description" content="Documentation for JuliaFormatter."/><script data-outdated-warner src="../assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.050/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.8/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL=".."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="../assets/documenter.js"></script><script src="../search_index.js"></script><script src="../siteinfo.js"></script><script src="../../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-mocha.css" data-theme-name="catppuccin-mocha"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-macchiato.css" data-theme-name="catppuccin-macchiato"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-frappe.css" data-theme-name="catppuccin-frappe"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-latte.css" data-theme-name="catppuccin-latte"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="../assets/themeswap.js"></script></head><body><div id="documenter"><nav class="docs-sidebar"><div class="docs-package-name"><span class="docs-autofit"><a href="../">JuliaFormatter</a></span></div><button class="docs-search-query input is-rounded is-small is-clickable my-2 mx-auto py-1 px-2" id="documenter-search-query">Search docs (Ctrl + /)</button><ul class="docs-menu"><li><a class="tocitem" href="../">Introduction</a></li><li><a class="tocitem" href="../how_it_works/">How It Works</a></li><li><a class="tocitem" href="../style/">Code Style</a></li><li><a class="tocitem" href="../skipping_formatting/">Skipping Formatting</a></li><li><a class="tocitem" href="../transforms/">Syntax Transforms</a></li><li><a class="tocitem" href="../custom_alignment/">Custom Alignment</a></li><li><a class="tocitem" href="../custom_styles/">Custom Styles</a></li><li><a class="tocitem" href="../yas_style/">YAS Style</a></li><li class="is-active"><a class="tocitem" href>Blue Style</a><ul class="internal"><li><a class="tocitem" href="#Configuration-File-Example"><span>Configuration File Example</span></a></li><li><a class="tocitem" href="#Direct-Usage"><span>Direct Usage</span></a></li></ul></li><li><a class="tocitem" href="../sciml_style/">SciML Style</a></li><li><a class="tocitem" href="../config/">Configuration File</a></li><li><a class="tocitem" href="../api/">API Reference</a></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><a class="docs-sidebar-button docs-navbar-link fa-solid fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a><nav class="breadcrumb"><ul class="is-hidden-mobile"><li class="is-active"><a href>Blue Style</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href>Blue Style</a></li></ul></nav><div class="docs-right"><a class="docs-navbar-link" href="https://github.com/domluna/JuliaFormatter.jl" title="View the repository on GitHub"><span class="docs-icon fa-brands"></span><span class="docs-label is-hidden-touch">GitHub</span></a><a class="docs-navbar-link" href="https://github.com/domluna/JuliaFormatter.jl/blob/master/docs/src/blue_style.md" title="Edit source on GitHub"><span class="docs-icon fa-solid"></span></a><a class="docs-settings-button docs-navbar-link fa-solid fa-gear" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-article-toggle-button fa-solid fa-chevron-up" id="documenter-article-toggle-button" href="javascript:;" title="Collapse all docstrings"></a></div></header><article class="content" id="documenter-page"><h1 id="Blue-Style"><a class="docs-heading-anchor" href="#Blue-Style">Blue Style</a><a id="Blue-Style-1"></a><a class="docs-heading-anchor-permalink" href="#Blue-Style" title="Permalink"></a></h1><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="JuliaFormatter.BlueStyle" href="#JuliaFormatter.BlueStyle"><code>JuliaFormatter.BlueStyle</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">BlueStyle()</code></pre><p>Formatting style based on <a href="https://github.com/invenia/BlueStyle">BlueStyle</a> and <a href="https://github.com/domluna/JuliaFormatter.jl/issues/283">JuliaFormatter#283</a>.</p><div class="admonition is-info"><header class="admonition-header">Note</header><div class="admonition-body"><p>This style is still work-in-progress, and does not yet implement all of the BlueStyle guide.</p></div></div><p>Configurable options with different defaults to <a href="../api/#JuliaFormatter.DefaultStyle"><code>DefaultStyle</code></a> are:</p><ul><li><code>always_for_in</code> = true</li><li><code>always_use_return</code> = true</li><li><code>annotate_untyped_fields_with_any</code> = false</li><li><code>conditional_to_if</code> = true</li><li><code>import_to_using</code> = true</li><li><code>indent_submodule</code> = true</li><li><code>pipe_to_function_call</code> = true</li><li><code>remove_extra_newlines</code> = true</li><li><code>separate_kwargs_with_semicolon</code> = true</li><li><code>short_to_long_function_def</code> = true</li><li><code>whitespace_in_kwargs</code> = false</li><li><code>whitespace_ops_in_indices</code> = true</li><li><code>yas_style_nesting</code> = false</li></ul></div><a class="docs-sourcelink" target="_blank" href="https://github.com/domluna/JuliaFormatter.jl/blob/bd653ed12450f9a9e5f94ba0963d248acda259b6/src/styles/blue/pretty.jl#L40-L52">source</a></section></article><h2 id="Configuration-File-Example"><a class="docs-heading-anchor" href="#Configuration-File-Example">Configuration File Example</a><a id="Configuration-File-Example-1"></a><a class="docs-heading-anchor-permalink" href="#Configuration-File-Example" title="Permalink"></a></h2><p>The <code>.JuliaFormatter.toml</code> which represents these settings is</p><pre><code class="language-toml hljs">style = "blue"</code></pre><p>Or to use <code>BlueStyle</code> except change one of the settings:</p><pre><code class="language-toml hljs">style = "blue" -remove_extra_newlines = false</code></pre><h2 id="Direct-Usage"><a class="docs-heading-anchor" href="#Direct-Usage">Direct Usage</a><a id="Direct-Usage-1"></a><a class="docs-heading-anchor-permalink" href="#Direct-Usage" title="Permalink"></a></h2><pre><code class="language-julia hljs">format("file.jl", BlueStyle())</code></pre><p>Or to use <code>BlueStyle</code> except change one of the settings:</p><pre><code class="language-julia hljs">format("file.jl", BlueStyle(), remove_extra_newlines=false)</code></pre></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../yas_style/">« YAS Style</a><a class="docs-footer-nextpage" href="../sciml_style/">SciML Style »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.7.0 on <span class="colophon-date" title="Monday 7 October 2024 06:14">Monday 7 October 2024</span>. Using Julia version 1.10.5.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html> +<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Blue Style · JuliaFormatter</title><meta name="title" content="Blue Style · JuliaFormatter"/><meta property="og:title" content="Blue Style · JuliaFormatter"/><meta property="twitter:title" content="Blue Style · JuliaFormatter"/><meta name="description" content="Documentation for JuliaFormatter."/><meta property="og:description" content="Documentation for JuliaFormatter."/><meta property="twitter:description" content="Documentation for JuliaFormatter."/><script data-outdated-warner src="../assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.050/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.8/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL=".."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="../assets/documenter.js"></script><script src="../search_index.js"></script><script src="../siteinfo.js"></script><script src="../../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-mocha.css" data-theme-name="catppuccin-mocha"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-macchiato.css" data-theme-name="catppuccin-macchiato"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-frappe.css" data-theme-name="catppuccin-frappe"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-latte.css" data-theme-name="catppuccin-latte"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="../assets/themeswap.js"></script></head><body><div id="documenter"><nav class="docs-sidebar"><div class="docs-package-name"><span class="docs-autofit"><a href="../">JuliaFormatter</a></span></div><button class="docs-search-query input is-rounded is-small is-clickable my-2 mx-auto py-1 px-2" id="documenter-search-query">Search docs (Ctrl + /)</button><ul class="docs-menu"><li><a class="tocitem" href="../">Introduction</a></li><li><a class="tocitem" href="../how_it_works/">How It Works</a></li><li><a class="tocitem" href="../style/">Code Style</a></li><li><a class="tocitem" href="../skipping_formatting/">Skipping Formatting</a></li><li><a class="tocitem" href="../transforms/">Syntax Transforms</a></li><li><a class="tocitem" href="../custom_alignment/">Custom Alignment</a></li><li><a class="tocitem" href="../custom_styles/">Custom Styles</a></li><li><a class="tocitem" href="../yas_style/">YAS Style</a></li><li class="is-active"><a class="tocitem" href>Blue Style</a><ul class="internal"><li><a class="tocitem" href="#Configuration-File-Example"><span>Configuration File Example</span></a></li><li><a class="tocitem" href="#Direct-Usage"><span>Direct Usage</span></a></li></ul></li><li><a class="tocitem" href="../sciml_style/">SciML Style</a></li><li><a class="tocitem" href="../config/">Configuration File</a></li><li><a class="tocitem" href="../api/">API Reference</a></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><a class="docs-sidebar-button docs-navbar-link fa-solid fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a><nav class="breadcrumb"><ul class="is-hidden-mobile"><li class="is-active"><a href>Blue Style</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href>Blue Style</a></li></ul></nav><div class="docs-right"><a class="docs-navbar-link" href="https://github.com/domluna/JuliaFormatter.jl" title="View the repository on GitHub"><span class="docs-icon fa-brands"></span><span class="docs-label is-hidden-touch">GitHub</span></a><a class="docs-navbar-link" href="https://github.com/domluna/JuliaFormatter.jl/blob/master/docs/src/blue_style.md" title="Edit source on GitHub"><span class="docs-icon fa-solid"></span></a><a class="docs-settings-button docs-navbar-link fa-solid fa-gear" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-article-toggle-button fa-solid fa-chevron-up" id="documenter-article-toggle-button" href="javascript:;" title="Collapse all docstrings"></a></div></header><article class="content" id="documenter-page"><h1 id="Blue-Style"><a class="docs-heading-anchor" href="#Blue-Style">Blue Style</a><a id="Blue-Style-1"></a><a class="docs-heading-anchor-permalink" href="#Blue-Style" title="Permalink"></a></h1><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="JuliaFormatter.BlueStyle" href="#JuliaFormatter.BlueStyle"><code>JuliaFormatter.BlueStyle</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">BlueStyle()</code></pre><p>Formatting style based on <a href="https://github.com/invenia/BlueStyle">BlueStyle</a> and <a href="https://github.com/domluna/JuliaFormatter.jl/issues/283">JuliaFormatter#283</a>.</p><div class="admonition is-info"><header class="admonition-header">Note</header><div class="admonition-body"><p>This style is still work-in-progress, and does not yet implement all of the BlueStyle guide.</p></div></div><p>Configurable options with different defaults to <a href="../api/#JuliaFormatter.DefaultStyle"><code>DefaultStyle</code></a> are:</p><ul><li><code>always_for_in</code> = true</li><li><code>always_use_return</code> = true</li><li><code>annotate_untyped_fields_with_any</code> = false</li><li><code>conditional_to_if</code> = true</li><li><code>import_to_using</code> = true</li><li><code>indent_submodule</code> = true</li><li><code>pipe_to_function_call</code> = true</li><li><code>remove_extra_newlines</code> = true</li><li><code>separate_kwargs_with_semicolon</code> = true</li><li><code>short_to_long_function_def</code> = true</li><li><code>whitespace_in_kwargs</code> = false</li><li><code>whitespace_ops_in_indices</code> = true</li><li><code>yas_style_nesting</code> = false</li></ul></div><a class="docs-sourcelink" target="_blank" href="https://github.com/domluna/JuliaFormatter.jl/blob/82036b71c4c04e8cf82a5f1a4ea22dd9f15449aa/src/styles/blue/pretty.jl#L40-L52">source</a></section></article><h2 id="Configuration-File-Example"><a class="docs-heading-anchor" href="#Configuration-File-Example">Configuration File Example</a><a id="Configuration-File-Example-1"></a><a class="docs-heading-anchor-permalink" href="#Configuration-File-Example" title="Permalink"></a></h2><p>The <code>.JuliaFormatter.toml</code> which represents these settings is</p><pre><code class="language-toml hljs">style = "blue"</code></pre><p>Or to use <code>BlueStyle</code> except change one of the settings:</p><pre><code class="language-toml hljs">style = "blue" +remove_extra_newlines = false</code></pre><h2 id="Direct-Usage"><a class="docs-heading-anchor" href="#Direct-Usage">Direct Usage</a><a id="Direct-Usage-1"></a><a class="docs-heading-anchor-permalink" href="#Direct-Usage" title="Permalink"></a></h2><pre><code class="language-julia hljs">format("file.jl", BlueStyle())</code></pre><p>Or to use <code>BlueStyle</code> except change one of the settings:</p><pre><code class="language-julia hljs">format("file.jl", BlueStyle(), remove_extra_newlines=false)</code></pre></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../yas_style/">« YAS Style</a><a class="docs-footer-nextpage" href="../sciml_style/">SciML Style »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.7.0 on <span class="colophon-date" title="Monday 7 October 2024 06:16">Monday 7 October 2024</span>. Using Julia version 1.10.5.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html> diff --git a/dev/config/index.html b/dev/config/index.html index 72ae2f40..2c7a3c68 100644 --- a/dev/config/index.html +++ b/dev/config/index.html @@ -13,4 +13,4 @@ │ ├─ .JuliaFormatter.toml │ └─ sub_code1.jl └─ subdir2 - └─ sub_code2.jl</code></pre><p>and call <code>format("dir")</code>, <code>code.jl</code> and <code>sub_code2.jl</code> will be formatted according to the rules defined in <code>dir/.JuliaFormatter.toml</code>, while formatting <code>sub_code1.jl</code> will be configured by <code>dir/subdir1/.JuliaFormatter.toml</code>.</p><h2 id="ignore"><a class="docs-heading-anchor" href="#ignore">Ignoring specific files and directories</a><a id="ignore-1"></a><a class="docs-heading-anchor-permalink" href="#ignore" title="Permalink"></a></h2><p>If there is an entry in <code>.JuliaFormatter.toml</code> with</p><pre><code class="nohighlight hljs">ignore = ["file.jl", "directory", "file_*.jl"]</code></pre><p>then all of these files will be reported as already formatted: <code>./file.jl</code>, <code>./directory/something.jl</code> <code>./other_directory/file.jl</code>, <code>file_1.jl</code>, <code>.other_directory/file_name.jl</code>.</p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../sciml_style/">« SciML Style</a><a class="docs-footer-nextpage" href="../api/">API Reference »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.7.0 on <span class="colophon-date" title="Monday 7 October 2024 06:14">Monday 7 October 2024</span>. Using Julia version 1.10.5.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html> + └─ sub_code2.jl</code></pre><p>and call <code>format("dir")</code>, <code>code.jl</code> and <code>sub_code2.jl</code> will be formatted according to the rules defined in <code>dir/.JuliaFormatter.toml</code>, while formatting <code>sub_code1.jl</code> will be configured by <code>dir/subdir1/.JuliaFormatter.toml</code>.</p><h2 id="ignore"><a class="docs-heading-anchor" href="#ignore">Ignoring specific files and directories</a><a id="ignore-1"></a><a class="docs-heading-anchor-permalink" href="#ignore" title="Permalink"></a></h2><p>If there is an entry in <code>.JuliaFormatter.toml</code> with</p><pre><code class="nohighlight hljs">ignore = ["file.jl", "directory", "file_*.jl"]</code></pre><p>then all of these files will be reported as already formatted: <code>./file.jl</code>, <code>./directory/something.jl</code> <code>./other_directory/file.jl</code>, <code>file_1.jl</code>, <code>.other_directory/file_name.jl</code>.</p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../sciml_style/">« SciML Style</a><a class="docs-footer-nextpage" href="../api/">API Reference »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.7.0 on <span class="colophon-date" title="Monday 7 October 2024 06:16">Monday 7 October 2024</span>. Using Julia version 1.10.5.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html> diff --git a/dev/custom_alignment/index.html b/dev/custom_alignment/index.html index 3edc6b83..8a9dddda 100644 --- a/dev/custom_alignment/index.html +++ b/dev/custom_alignment/index.html @@ -133,4 +133,4 @@ 100 300 400 1 ee 40000 2 a b -]</code></pre></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../transforms/">« Syntax Transforms</a><a class="docs-footer-nextpage" href="../custom_styles/">Custom Styles »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.7.0 on <span class="colophon-date" title="Monday 7 October 2024 06:14">Monday 7 October 2024</span>. Using Julia version 1.10.5.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html> +]</code></pre></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../transforms/">« Syntax Transforms</a><a class="docs-footer-nextpage" href="../custom_styles/">Custom Styles »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.7.0 on <span class="colophon-date" title="Monday 7 October 2024 06:16">Monday 7 October 2024</span>. Using Julia version 1.10.5.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html> diff --git a/dev/custom_styles/index.html b/dev/custom_styles/index.html index d9fdc6ba..a6268caf 100644 --- a/dev/custom_styles/index.html +++ b/dev/custom_styles/index.html @@ -32,4 +32,4 @@ foo(a, b, key1 = val1, key3 = val4) julia> format_text(s, style=CustomStyle()) |> print -foo(a, b, key1=val1, key3=val4)</code></pre><p>Nice! Looks like it's working.</p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../custom_alignment/">« Custom Alignment</a><a class="docs-footer-nextpage" href="../yas_style/">YAS Style »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.7.0 on <span class="colophon-date" title="Monday 7 October 2024 06:14">Monday 7 October 2024</span>. Using Julia version 1.10.5.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html> +foo(a, b, key1=val1, key3=val4)</code></pre><p>Nice! Looks like it's working.</p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../custom_alignment/">« Custom Alignment</a><a class="docs-footer-nextpage" href="../yas_style/">YAS Style »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.7.0 on <span class="colophon-date" title="Monday 7 October 2024 06:16">Monday 7 October 2024</span>. Using Julia version 1.10.5.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html> diff --git a/dev/how_it_works/index.html b/dev/how_it_works/index.html index da0ce796..b284461b 100644 --- a/dev/how_it_works/index.html +++ b/dev/how_it_works/index.html @@ -31,4 +31,4 @@ ..., argument120 ) # way over margin limit !!! -end</code></pre><blockquote><p>You can read how code is nested in the style section.</p></blockquote><p>Once the <code>FST</code> has been nested it's then printed out to a file and voila! You have a formatted version of your code!</p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../">« Introduction</a><a class="docs-footer-nextpage" href="../style/">Code Style »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.7.0 on <span class="colophon-date" title="Monday 7 October 2024 06:14">Monday 7 October 2024</span>. Using Julia version 1.10.5.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html> +end</code></pre><blockquote><p>You can read how code is nested in the style section.</p></blockquote><p>Once the <code>FST</code> has been nested it's then printed out to a file and voila! You have a formatted version of your code!</p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../">« Introduction</a><a class="docs-footer-nextpage" href="../style/">Code Style »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.7.0 on <span class="colophon-date" title="Monday 7 October 2024 06:16">Monday 7 October 2024</span>. Using Julia version 1.10.5.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html> diff --git a/dev/index.html b/dev/index.html index 5a189f34..f224b344 100644 --- a/dev/index.html +++ b/dev/index.html @@ -200,4 +200,4 @@ a * b end -end</code></pre><p>Notice the contents of <code>@muladd begin</code> is not indented.</p><p><code>#! format: noindent</code> can also be nested.</p><h2 id="Editor-Plugins"><a class="docs-heading-anchor" href="#Editor-Plugins">Editor Plugins</a><a id="Editor-Plugins-1"></a><a class="docs-heading-anchor-permalink" href="#Editor-Plugins" title="Permalink"></a></h2><p>For integration with other editors:</p><ul><li><a href="https://github.com/singularitti/vscode-julia-formatter/">VSCode</a></li><li><a href="https://codeberg.org/FelipeLema/julia-formatter.el">Emacs</a></li><li><a href="https://github.com/kdheepak/JuliaFormatter.vim">Vim</a></li><li><a href="https://github.com/JunoLab/Atom.jl">Atom (deprecated)</a></li></ul></article><nav class="docs-footer"><a class="docs-footer-nextpage" href="how_it_works/">How It Works »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.7.0 on <span class="colophon-date" title="Monday 7 October 2024 06:14">Monday 7 October 2024</span>. Using Julia version 1.10.5.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html> +end</code></pre><p>Notice the contents of <code>@muladd begin</code> is not indented.</p><p><code>#! format: noindent</code> can also be nested.</p><h2 id="Editor-Plugins"><a class="docs-heading-anchor" href="#Editor-Plugins">Editor Plugins</a><a id="Editor-Plugins-1"></a><a class="docs-heading-anchor-permalink" href="#Editor-Plugins" title="Permalink"></a></h2><p>For integration with other editors:</p><ul><li><a href="https://github.com/singularitti/vscode-julia-formatter/">VSCode</a></li><li><a href="https://codeberg.org/FelipeLema/julia-formatter.el">Emacs</a></li><li><a href="https://github.com/kdheepak/JuliaFormatter.vim">Vim</a></li><li><a href="https://github.com/JunoLab/Atom.jl">Atom (deprecated)</a></li></ul></article><nav class="docs-footer"><a class="docs-footer-nextpage" href="how_it_works/">How It Works »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.7.0 on <span class="colophon-date" title="Monday 7 October 2024 06:16">Monday 7 October 2024</span>. Using Julia version 1.10.5.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html> diff --git a/dev/integrations/index.html b/dev/integrations/index.html index 51de7e5f..0e1e8568 100644 --- a/dev/integrations/index.html +++ b/dev/integrations/index.html @@ -5,4 +5,4 @@ rev: "v1.0.18" # or whatever the desired release is hooks: - id: "julia-formatter" -# ... other repos you may have</code></pre><p>You can find a list of releases <a href="https://github.com/domluna/JuliaFormatter.jl/releases">here</a>. <strong>Be sure to use the entire version string!</strong> (You can double-check this by opening the release and looking at the part of the URL that follows <code>.../releases/tag/VERSION</code>.)</p></article><nav class="docs-footer"><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.7.0 on <span class="colophon-date" title="Monday 7 October 2024 06:14">Monday 7 October 2024</span>. Using Julia version 1.10.5.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html> +# ... other repos you may have</code></pre><p>You can find a list of releases <a href="https://github.com/domluna/JuliaFormatter.jl/releases">here</a>. <strong>Be sure to use the entire version string!</strong> (You can double-check this by opening the release and looking at the part of the URL that follows <code>.../releases/tag/VERSION</code>.)</p></article><nav class="docs-footer"><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.7.0 on <span class="colophon-date" title="Monday 7 October 2024 06:16">Monday 7 October 2024</span>. Using Julia version 1.10.5.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html> diff --git a/dev/objects.inv b/dev/objects.inv index ff2da7a5247ac9699ec93689f8b6a7b237120949..19e70e69fef79e3bf69f2c2b57f9e7e20f9fe18d 100644 GIT binary patch delta 12 TcmaDZ^jv6yJEP%74|z@iAe{sq delta 12 TcmaDZ^jv6yJEPG?4|z@iAff~w diff --git a/dev/sciml_style/index.html b/dev/sciml_style/index.html index 5f06ff9e..83ac8ecc 100644 --- a/dev/sciml_style/index.html +++ b/dev/sciml_style/index.html @@ -1,5 +1,5 @@ <!DOCTYPE html> -<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>SciML Style · JuliaFormatter</title><meta name="title" content="SciML Style · JuliaFormatter"/><meta property="og:title" content="SciML Style · JuliaFormatter"/><meta property="twitter:title" content="SciML Style · JuliaFormatter"/><meta name="description" content="Documentation for JuliaFormatter."/><meta property="og:description" content="Documentation for JuliaFormatter."/><meta property="twitter:description" content="Documentation for JuliaFormatter."/><script data-outdated-warner src="../assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.050/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.8/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL=".."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="../assets/documenter.js"></script><script src="../search_index.js"></script><script src="../siteinfo.js"></script><script src="../../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-mocha.css" data-theme-name="catppuccin-mocha"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-macchiato.css" data-theme-name="catppuccin-macchiato"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-frappe.css" data-theme-name="catppuccin-frappe"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-latte.css" data-theme-name="catppuccin-latte"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="../assets/themeswap.js"></script></head><body><div id="documenter"><nav class="docs-sidebar"><div class="docs-package-name"><span class="docs-autofit"><a href="../">JuliaFormatter</a></span></div><button class="docs-search-query input is-rounded is-small is-clickable my-2 mx-auto py-1 px-2" id="documenter-search-query">Search docs (Ctrl + /)</button><ul class="docs-menu"><li><a class="tocitem" href="../">Introduction</a></li><li><a class="tocitem" href="../how_it_works/">How It Works</a></li><li><a class="tocitem" href="../style/">Code Style</a></li><li><a class="tocitem" href="../skipping_formatting/">Skipping Formatting</a></li><li><a class="tocitem" href="../transforms/">Syntax Transforms</a></li><li><a class="tocitem" href="../custom_alignment/">Custom Alignment</a></li><li><a class="tocitem" href="../custom_styles/">Custom Styles</a></li><li><a class="tocitem" href="../yas_style/">YAS Style</a></li><li><a class="tocitem" href="../blue_style/">Blue Style</a></li><li class="is-active"><a class="tocitem" href>SciML Style</a><ul class="internal"><li><a class="tocitem" href="#Configuration-File-Example"><span>Configuration File Example</span></a></li><li><a class="tocitem" href="#Direct-Usage"><span>Direct Usage</span></a></li><li><a class="tocitem" href="#Additional-Options"><span>Additional Options</span></a></li></ul></li><li><a class="tocitem" href="../config/">Configuration File</a></li><li><a class="tocitem" href="../api/">API Reference</a></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><a class="docs-sidebar-button docs-navbar-link fa-solid fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a><nav class="breadcrumb"><ul class="is-hidden-mobile"><li class="is-active"><a href>SciML Style</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href>SciML Style</a></li></ul></nav><div class="docs-right"><a class="docs-navbar-link" href="https://github.com/domluna/JuliaFormatter.jl" title="View the repository on GitHub"><span class="docs-icon fa-brands"></span><span class="docs-label is-hidden-touch">GitHub</span></a><a class="docs-navbar-link" href="https://github.com/domluna/JuliaFormatter.jl/blob/master/docs/src/sciml_style.md" title="Edit source on GitHub"><span class="docs-icon fa-solid"></span></a><a class="docs-settings-button docs-navbar-link fa-solid fa-gear" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-article-toggle-button fa-solid fa-chevron-up" id="documenter-article-toggle-button" href="javascript:;" title="Collapse all docstrings"></a></div></header><article class="content" id="documenter-page"><h1 id="SciML-Style"><a class="docs-heading-anchor" href="#SciML-Style">SciML Style</a><a id="SciML-Style-1"></a><a class="docs-heading-anchor-permalink" href="#SciML-Style" title="Permalink"></a></h1><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="JuliaFormatter.SciMLStyle" href="#JuliaFormatter.SciMLStyle"><code>JuliaFormatter.SciMLStyle</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">SciMLStyle()</code></pre><p>Formatting style based on <a href="https://github.com/SciML/SciMLStyle">SciMLStyle</a>.</p><div class="admonition is-info"><header class="admonition-header">Note</header><div class="admonition-body"><p>This style is still work-in-progress.</p></div></div><p>Configurable options with different defaults to <a href="../api/#JuliaFormatter.DefaultStyle"><code>DefaultStyle</code></a> are:</p><ul><li><code>always_for_in</code> = true</li><li><code>disallow_single_arg_nesting</code> = true</li><li><code>join_lines_based_on_source</code> = true</li><li><code>normalize_line_endings</code> = unix</li><li><code>remove_extra_newlines</code> = true</li><li><code>trailing_comma</code> = false</li><li><code>whitespace_ops_in_indices</code> = true</li><li><code>whitespace_typedefs</code> = true</li><li><code>yas_style_nesting</code> = false</li></ul></div><a class="docs-sourcelink" target="_blank" href="https://github.com/domluna/JuliaFormatter.jl/blob/bd653ed12450f9a9e5f94ba0963d248acda259b6/src/styles/sciml/pretty.jl#L41-L51">source</a></section></article><h2 id="Configuration-File-Example"><a class="docs-heading-anchor" href="#Configuration-File-Example">Configuration File Example</a><a id="Configuration-File-Example-1"></a><a class="docs-heading-anchor-permalink" href="#Configuration-File-Example" title="Permalink"></a></h2><p>The <code>.JuliaFormatter.toml</code> which represents these settings is</p><pre><code class="language-toml hljs">style = "sciml"</code></pre><p>Or to use <code>SciMLStyle</code> except change one of the settings:</p><pre><code class="language-toml hljs">style = "sciml" +<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>SciML Style · JuliaFormatter</title><meta name="title" content="SciML Style · JuliaFormatter"/><meta property="og:title" content="SciML Style · JuliaFormatter"/><meta property="twitter:title" content="SciML Style · JuliaFormatter"/><meta name="description" content="Documentation for JuliaFormatter."/><meta property="og:description" content="Documentation for JuliaFormatter."/><meta property="twitter:description" content="Documentation for JuliaFormatter."/><script data-outdated-warner src="../assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.050/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.8/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL=".."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="../assets/documenter.js"></script><script src="../search_index.js"></script><script src="../siteinfo.js"></script><script src="../../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-mocha.css" data-theme-name="catppuccin-mocha"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-macchiato.css" data-theme-name="catppuccin-macchiato"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-frappe.css" data-theme-name="catppuccin-frappe"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-latte.css" data-theme-name="catppuccin-latte"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="../assets/themeswap.js"></script></head><body><div id="documenter"><nav class="docs-sidebar"><div class="docs-package-name"><span class="docs-autofit"><a href="../">JuliaFormatter</a></span></div><button class="docs-search-query input is-rounded is-small is-clickable my-2 mx-auto py-1 px-2" id="documenter-search-query">Search docs (Ctrl + /)</button><ul class="docs-menu"><li><a class="tocitem" href="../">Introduction</a></li><li><a class="tocitem" href="../how_it_works/">How It Works</a></li><li><a class="tocitem" href="../style/">Code Style</a></li><li><a class="tocitem" href="../skipping_formatting/">Skipping Formatting</a></li><li><a class="tocitem" href="../transforms/">Syntax Transforms</a></li><li><a class="tocitem" href="../custom_alignment/">Custom Alignment</a></li><li><a class="tocitem" href="../custom_styles/">Custom Styles</a></li><li><a class="tocitem" href="../yas_style/">YAS Style</a></li><li><a class="tocitem" href="../blue_style/">Blue Style</a></li><li class="is-active"><a class="tocitem" href>SciML Style</a><ul class="internal"><li><a class="tocitem" href="#Configuration-File-Example"><span>Configuration File Example</span></a></li><li><a class="tocitem" href="#Direct-Usage"><span>Direct Usage</span></a></li><li><a class="tocitem" href="#Additional-Options"><span>Additional Options</span></a></li></ul></li><li><a class="tocitem" href="../config/">Configuration File</a></li><li><a class="tocitem" href="../api/">API Reference</a></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><a class="docs-sidebar-button docs-navbar-link fa-solid fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a><nav class="breadcrumb"><ul class="is-hidden-mobile"><li class="is-active"><a href>SciML Style</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href>SciML Style</a></li></ul></nav><div class="docs-right"><a class="docs-navbar-link" href="https://github.com/domluna/JuliaFormatter.jl" title="View the repository on GitHub"><span class="docs-icon fa-brands"></span><span class="docs-label is-hidden-touch">GitHub</span></a><a class="docs-navbar-link" href="https://github.com/domluna/JuliaFormatter.jl/blob/master/docs/src/sciml_style.md" title="Edit source on GitHub"><span class="docs-icon fa-solid"></span></a><a class="docs-settings-button docs-navbar-link fa-solid fa-gear" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-article-toggle-button fa-solid fa-chevron-up" id="documenter-article-toggle-button" href="javascript:;" title="Collapse all docstrings"></a></div></header><article class="content" id="documenter-page"><h1 id="SciML-Style"><a class="docs-heading-anchor" href="#SciML-Style">SciML Style</a><a id="SciML-Style-1"></a><a class="docs-heading-anchor-permalink" href="#SciML-Style" title="Permalink"></a></h1><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="JuliaFormatter.SciMLStyle" href="#JuliaFormatter.SciMLStyle"><code>JuliaFormatter.SciMLStyle</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">SciMLStyle()</code></pre><p>Formatting style based on <a href="https://github.com/SciML/SciMLStyle">SciMLStyle</a>.</p><div class="admonition is-info"><header class="admonition-header">Note</header><div class="admonition-body"><p>This style is still work-in-progress.</p></div></div><p>Configurable options with different defaults to <a href="../api/#JuliaFormatter.DefaultStyle"><code>DefaultStyle</code></a> are:</p><ul><li><code>always_for_in</code> = true</li><li><code>disallow_single_arg_nesting</code> = true</li><li><code>join_lines_based_on_source</code> = true</li><li><code>normalize_line_endings</code> = unix</li><li><code>remove_extra_newlines</code> = true</li><li><code>trailing_comma</code> = false</li><li><code>whitespace_ops_in_indices</code> = true</li><li><code>whitespace_typedefs</code> = true</li><li><code>yas_style_nesting</code> = false</li></ul></div><a class="docs-sourcelink" target="_blank" href="https://github.com/domluna/JuliaFormatter.jl/blob/82036b71c4c04e8cf82a5f1a4ea22dd9f15449aa/src/styles/sciml/pretty.jl#L41-L51">source</a></section></article><h2 id="Configuration-File-Example"><a class="docs-heading-anchor" href="#Configuration-File-Example">Configuration File Example</a><a id="Configuration-File-Example-1"></a><a class="docs-heading-anchor-permalink" href="#Configuration-File-Example" title="Permalink"></a></h2><p>The <code>.JuliaFormatter.toml</code> which represents these settings is</p><pre><code class="language-toml hljs">style = "sciml"</code></pre><p>Or to use <code>SciMLStyle</code> except change one of the settings:</p><pre><code class="language-toml hljs">style = "sciml" remove_extra_newlines = false</code></pre><h2 id="Direct-Usage"><a class="docs-heading-anchor" href="#Direct-Usage">Direct Usage</a><a id="Direct-Usage-1"></a><a class="docs-heading-anchor-permalink" href="#Direct-Usage" title="Permalink"></a></h2><pre><code class="language-julia hljs">format("file.jl", SciMLStyle())</code></pre><p>Or to use <code>SciMLStyle</code> except change one of the settings:</p><pre><code class="language-julia hljs">format("file.jl", SciMLStyle(), remove_extra_newlines=false)</code></pre><h2 id="Additional-Options"><a class="docs-heading-anchor" href="#Additional-Options">Additional Options</a><a id="Additional-Options-1"></a><a class="docs-heading-anchor-permalink" href="#Additional-Options" title="Permalink"></a></h2><p>The <code>SciMLStyle</code> supports the additional options <code>variable_call_indent</code> and <code>yas_style_nesting</code>.</p><p>The option <code>variable_call_indent</code> is set to <code>[]</code> by default. It allows calls without aligning to the opening parenthesis:</p><pre><code class="language-julia hljs"># Allowed with and without `Dict in variable_call_indent` Dict{Int, Int}(1 => 2, 3 => 4) @@ -20,4 +20,4 @@ argument3, argument4, argument5, x, y, z) foo(x) + goo(y) -end</code></pre></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../blue_style/">« Blue Style</a><a class="docs-footer-nextpage" href="../config/">Configuration File »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.7.0 on <span class="colophon-date" title="Monday 7 October 2024 06:14">Monday 7 October 2024</span>. Using Julia version 1.10.5.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html> +end</code></pre></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../blue_style/">« Blue Style</a><a class="docs-footer-nextpage" href="../config/">Configuration File »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.7.0 on <span class="colophon-date" title="Monday 7 October 2024 06:16">Monday 7 October 2024</span>. Using Julia version 1.10.5.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html> diff --git a/dev/skipping_formatting/index.html b/dev/skipping_formatting/index.html index be80c2a7..3e518e16 100644 --- a/dev/skipping_formatting/index.html +++ b/dev/skipping_formatting/index.html @@ -12,4 +12,4 @@ module Foo ... -end</code></pre><div class="admonition is-info"><header class="admonition-header">Ignoring files</header><div class="admonition-body"><p>You can also ignore entire files and directories by supplying <a href="@ref ignore">the <code>ignore</code> option</a> in <code>.JuliaFormatter.toml</code>.</p></div></div><p>Note the formatter expects <code>#! format: on</code> and <code>#! format: off</code> to be on its own line and the whitespace to be an exact match.</p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../style/">« Code Style</a><a class="docs-footer-nextpage" href="../transforms/">Syntax Transforms »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.7.0 on <span class="colophon-date" title="Monday 7 October 2024 06:14">Monday 7 October 2024</span>. Using Julia version 1.10.5.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html> +end</code></pre><div class="admonition is-info"><header class="admonition-header">Ignoring files</header><div class="admonition-body"><p>You can also ignore entire files and directories by supplying <a href="@ref ignore">the <code>ignore</code> option</a> in <code>.JuliaFormatter.toml</code>.</p></div></div><p>Note the formatter expects <code>#! format: on</code> and <code>#! format: off</code> to be on its own line and the whitespace to be an exact match.</p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../style/">« Code Style</a><a class="docs-footer-nextpage" href="../transforms/">Syntax Transforms »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.7.0 on <span class="colophon-date" title="Monday 7 October 2024 06:16">Monday 7 October 2024</span>. Using Julia version 1.10.5.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html> diff --git a/dev/style/index.html b/dev/style/index.html index fdfcf735..5b94c03e 100644 --- a/dev/style/index.html +++ b/dev/style/index.html @@ -206,4 +206,4 @@ arg1, arg2, arg3, -)</code></pre></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../how_it_works/">« How It Works</a><a class="docs-footer-nextpage" href="../skipping_formatting/">Skipping Formatting »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.7.0 on <span class="colophon-date" title="Monday 7 October 2024 06:14">Monday 7 October 2024</span>. Using Julia version 1.10.5.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html> +)</code></pre></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../how_it_works/">« How It Works</a><a class="docs-footer-nextpage" href="../skipping_formatting/">Skipping Formatting »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.7.0 on <span class="colophon-date" title="Monday 7 October 2024 06:16">Monday 7 October 2024</span>. Using Julia version 1.10.5.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html> diff --git a/dev/transforms/index.html b/dev/transforms/index.html index 8baeda15..d2246a9e 100644 --- a/dev/transforms/index.html +++ b/dev/transforms/index.html @@ -42,4 +42,4 @@ -> -Module.@macro</code></pre></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../skipping_formatting/">« Skipping Formatting</a><a class="docs-footer-nextpage" href="../custom_alignment/">Custom Alignment »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.7.0 on <span class="colophon-date" title="Monday 7 October 2024 06:14">Monday 7 October 2024</span>. Using Julia version 1.10.5.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html> +Module.@macro</code></pre></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../skipping_formatting/">« Skipping Formatting</a><a class="docs-footer-nextpage" href="../custom_alignment/">Custom Alignment »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.7.0 on <span class="colophon-date" title="Monday 7 October 2024 06:16">Monday 7 October 2024</span>. Using Julia version 1.10.5.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html> diff --git a/dev/yas_style/index.html b/dev/yas_style/index.html index 17c3cff1..774cfd00 100644 --- a/dev/yas_style/index.html +++ b/dev/yas_style/index.html @@ -1,5 +1,5 @@ <!DOCTYPE html> -<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>YAS Style · JuliaFormatter</title><meta name="title" content="YAS Style · JuliaFormatter"/><meta property="og:title" content="YAS Style · JuliaFormatter"/><meta property="twitter:title" content="YAS Style · JuliaFormatter"/><meta name="description" content="Documentation for JuliaFormatter."/><meta property="og:description" content="Documentation for JuliaFormatter."/><meta property="twitter:description" content="Documentation for JuliaFormatter."/><script data-outdated-warner src="../assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.050/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.8/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL=".."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="../assets/documenter.js"></script><script src="../search_index.js"></script><script src="../siteinfo.js"></script><script src="../../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-mocha.css" data-theme-name="catppuccin-mocha"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-macchiato.css" data-theme-name="catppuccin-macchiato"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-frappe.css" data-theme-name="catppuccin-frappe"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-latte.css" data-theme-name="catppuccin-latte"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="../assets/themeswap.js"></script></head><body><div id="documenter"><nav class="docs-sidebar"><div class="docs-package-name"><span class="docs-autofit"><a href="../">JuliaFormatter</a></span></div><button class="docs-search-query input is-rounded is-small is-clickable my-2 mx-auto py-1 px-2" id="documenter-search-query">Search docs (Ctrl + /)</button><ul class="docs-menu"><li><a class="tocitem" href="../">Introduction</a></li><li><a class="tocitem" href="../how_it_works/">How It Works</a></li><li><a class="tocitem" href="../style/">Code Style</a></li><li><a class="tocitem" href="../skipping_formatting/">Skipping Formatting</a></li><li><a class="tocitem" href="../transforms/">Syntax Transforms</a></li><li><a class="tocitem" href="../custom_alignment/">Custom Alignment</a></li><li><a class="tocitem" href="../custom_styles/">Custom Styles</a></li><li class="is-active"><a class="tocitem" href>YAS Style</a><ul class="internal"><li><a class="tocitem" href="#Configuration-File-Example"><span>Configuration File Example</span></a></li><li><a class="tocitem" href="#Direct-Usage"><span>Direct Usage</span></a></li><li><a class="tocitem" href="#Differences-from-DefaultStyle"><span>Differences from <code>DefaultStyle</code></span></a></li><li><a class="tocitem" href="#Additional-Options"><span>Additional Options</span></a></li></ul></li><li><a class="tocitem" href="../blue_style/">Blue Style</a></li><li><a class="tocitem" href="../sciml_style/">SciML Style</a></li><li><a class="tocitem" href="../config/">Configuration File</a></li><li><a class="tocitem" href="../api/">API Reference</a></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><a class="docs-sidebar-button docs-navbar-link fa-solid fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a><nav class="breadcrumb"><ul class="is-hidden-mobile"><li class="is-active"><a href>YAS Style</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href>YAS Style</a></li></ul></nav><div class="docs-right"><a class="docs-navbar-link" href="https://github.com/domluna/JuliaFormatter.jl" title="View the repository on GitHub"><span class="docs-icon fa-brands"></span><span class="docs-label is-hidden-touch">GitHub</span></a><a class="docs-navbar-link" href="https://github.com/domluna/JuliaFormatter.jl/blob/master/docs/src/yas_style.md" title="Edit source on GitHub"><span class="docs-icon fa-solid"></span></a><a class="docs-settings-button docs-navbar-link fa-solid fa-gear" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-article-toggle-button fa-solid fa-chevron-up" id="documenter-article-toggle-button" href="javascript:;" title="Collapse all docstrings"></a></div></header><article class="content" id="documenter-page"><h1 id="YAS-Style"><a class="docs-heading-anchor" href="#YAS-Style">YAS Style</a><a id="YAS-Style-1"></a><a class="docs-heading-anchor-permalink" href="#YAS-Style" title="Permalink"></a></h1><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="JuliaFormatter.YASStyle" href="#JuliaFormatter.YASStyle"><code>JuliaFormatter.YASStyle</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">YASStyle()</code></pre><p>Formatting style based on <a href="https://github.com/jrevels/YASGuide">YASGuide</a> and <a href="https://github.com/domluna/JuliaFormatter.jl/issues/198">JuliaFormatter#198</a>.</p><p>Configurable options with different defaults to <a href="../api/#JuliaFormatter.DefaultStyle"><code>DefaultStyle</code></a> are:</p><ul><li><code>always_for_in</code> = true</li><li><code>always_use_return</code> = true</li><li><code>import_to_using</code> = true</li><li><code>join_lines_based_on_source</code> = true</li><li><code>pipe_to_function_call</code> = true</li><li><code>remove_extra_newlines</code> = true</li><li><code>separate_kwargs_with_semicolon</code> = true</li><li><code>short_to_long_function_def</code> = true</li><li><code>whitespace_in_kwargs</code> = false</li><li><code>whitespace_ops_in_indices</code> = true</li><li><code>yas_style_nesting</code> = false</li></ul></div><a class="docs-sourcelink" target="_blank" href="https://github.com/domluna/JuliaFormatter.jl/blob/bd653ed12450f9a9e5f94ba0963d248acda259b6/src/styles/yas/pretty.jl#L40-L48">source</a></section></article><h2 id="Configuration-File-Example"><a class="docs-heading-anchor" href="#Configuration-File-Example">Configuration File Example</a><a id="Configuration-File-Example-1"></a><a class="docs-heading-anchor-permalink" href="#Configuration-File-Example" title="Permalink"></a></h2><p>The <code>.JuliaFormatter.toml</code> which represents these settings is</p><pre><code class="language-toml hljs">style = "yas"</code></pre><p>Or to use <code>YASStyle</code> except change one of the settings:</p><pre><code class="language-toml hljs">style = "yas" +<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>YAS Style · JuliaFormatter</title><meta name="title" content="YAS Style · JuliaFormatter"/><meta property="og:title" content="YAS Style · JuliaFormatter"/><meta property="twitter:title" content="YAS Style · JuliaFormatter"/><meta name="description" content="Documentation for JuliaFormatter."/><meta property="og:description" content="Documentation for JuliaFormatter."/><meta property="twitter:description" content="Documentation for JuliaFormatter."/><script data-outdated-warner src="../assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.050/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.8/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL=".."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="../assets/documenter.js"></script><script src="../search_index.js"></script><script src="../siteinfo.js"></script><script src="../../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-mocha.css" data-theme-name="catppuccin-mocha"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-macchiato.css" data-theme-name="catppuccin-macchiato"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-frappe.css" data-theme-name="catppuccin-frappe"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-latte.css" data-theme-name="catppuccin-latte"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="../assets/themeswap.js"></script></head><body><div id="documenter"><nav class="docs-sidebar"><div class="docs-package-name"><span class="docs-autofit"><a href="../">JuliaFormatter</a></span></div><button class="docs-search-query input is-rounded is-small is-clickable my-2 mx-auto py-1 px-2" id="documenter-search-query">Search docs (Ctrl + /)</button><ul class="docs-menu"><li><a class="tocitem" href="../">Introduction</a></li><li><a class="tocitem" href="../how_it_works/">How It Works</a></li><li><a class="tocitem" href="../style/">Code Style</a></li><li><a class="tocitem" href="../skipping_formatting/">Skipping Formatting</a></li><li><a class="tocitem" href="../transforms/">Syntax Transforms</a></li><li><a class="tocitem" href="../custom_alignment/">Custom Alignment</a></li><li><a class="tocitem" href="../custom_styles/">Custom Styles</a></li><li class="is-active"><a class="tocitem" href>YAS Style</a><ul class="internal"><li><a class="tocitem" href="#Configuration-File-Example"><span>Configuration File Example</span></a></li><li><a class="tocitem" href="#Direct-Usage"><span>Direct Usage</span></a></li><li><a class="tocitem" href="#Differences-from-DefaultStyle"><span>Differences from <code>DefaultStyle</code></span></a></li><li><a class="tocitem" href="#Additional-Options"><span>Additional Options</span></a></li></ul></li><li><a class="tocitem" href="../blue_style/">Blue Style</a></li><li><a class="tocitem" href="../sciml_style/">SciML Style</a></li><li><a class="tocitem" href="../config/">Configuration File</a></li><li><a class="tocitem" href="../api/">API Reference</a></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><a class="docs-sidebar-button docs-navbar-link fa-solid fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a><nav class="breadcrumb"><ul class="is-hidden-mobile"><li class="is-active"><a href>YAS Style</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href>YAS Style</a></li></ul></nav><div class="docs-right"><a class="docs-navbar-link" href="https://github.com/domluna/JuliaFormatter.jl" title="View the repository on GitHub"><span class="docs-icon fa-brands"></span><span class="docs-label is-hidden-touch">GitHub</span></a><a class="docs-navbar-link" href="https://github.com/domluna/JuliaFormatter.jl/blob/master/docs/src/yas_style.md" title="Edit source on GitHub"><span class="docs-icon fa-solid"></span></a><a class="docs-settings-button docs-navbar-link fa-solid fa-gear" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-article-toggle-button fa-solid fa-chevron-up" id="documenter-article-toggle-button" href="javascript:;" title="Collapse all docstrings"></a></div></header><article class="content" id="documenter-page"><h1 id="YAS-Style"><a class="docs-heading-anchor" href="#YAS-Style">YAS Style</a><a id="YAS-Style-1"></a><a class="docs-heading-anchor-permalink" href="#YAS-Style" title="Permalink"></a></h1><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="JuliaFormatter.YASStyle" href="#JuliaFormatter.YASStyle"><code>JuliaFormatter.YASStyle</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">YASStyle()</code></pre><p>Formatting style based on <a href="https://github.com/jrevels/YASGuide">YASGuide</a> and <a href="https://github.com/domluna/JuliaFormatter.jl/issues/198">JuliaFormatter#198</a>.</p><p>Configurable options with different defaults to <a href="../api/#JuliaFormatter.DefaultStyle"><code>DefaultStyle</code></a> are:</p><ul><li><code>always_for_in</code> = true</li><li><code>always_use_return</code> = true</li><li><code>import_to_using</code> = true</li><li><code>join_lines_based_on_source</code> = true</li><li><code>pipe_to_function_call</code> = true</li><li><code>remove_extra_newlines</code> = true</li><li><code>separate_kwargs_with_semicolon</code> = true</li><li><code>short_to_long_function_def</code> = true</li><li><code>whitespace_in_kwargs</code> = false</li><li><code>whitespace_ops_in_indices</code> = true</li><li><code>yas_style_nesting</code> = false</li></ul></div><a class="docs-sourcelink" target="_blank" href="https://github.com/domluna/JuliaFormatter.jl/blob/82036b71c4c04e8cf82a5f1a4ea22dd9f15449aa/src/styles/yas/pretty.jl#L40-L48">source</a></section></article><h2 id="Configuration-File-Example"><a class="docs-heading-anchor" href="#Configuration-File-Example">Configuration File Example</a><a id="Configuration-File-Example-1"></a><a class="docs-heading-anchor-permalink" href="#Configuration-File-Example" title="Permalink"></a></h2><p>The <code>.JuliaFormatter.toml</code> which represents these settings is</p><pre><code class="language-toml hljs">style = "yas"</code></pre><p>Or to use <code>YASStyle</code> except change one of the settings:</p><pre><code class="language-toml hljs">style = "yas" remove_extra_newlines = false</code></pre><h2 id="Direct-Usage"><a class="docs-heading-anchor" href="#Direct-Usage">Direct Usage</a><a id="Direct-Usage-1"></a><a class="docs-heading-anchor-permalink" href="#Direct-Usage" title="Permalink"></a></h2><pre><code class="language-julia hljs">format("file.jl", YASStyle())</code></pre><p>Or to use <code>YASStyle</code> except change one of the settings:</p><pre><code class="language-julia hljs">format("file.jl", YASStyle(), remove_extra_newlines=false)</code></pre><h2 id="Differences-from-DefaultStyle"><a class="docs-heading-anchor" href="#Differences-from-DefaultStyle">Differences from <code>DefaultStyle</code></a><a id="Differences-from-DefaultStyle-1"></a><a class="docs-heading-anchor-permalink" href="#Differences-from-DefaultStyle" title="Permalink"></a></h2><p>There are three main differences between <code>YASStyle</code> and <code>DefaultStyle</code>. They are based on alignment and line break behaviors.</p><ol><li>Arguments are aligned to just after the start of the <em>opener</em> <code>[, {, (, etc</code>.</li></ol><pre><code class="language-julia hljs">function_call(arg1, arg2)</code></pre><ol><li><p>As you can see from the above the <em>closer</em> sticks to the final argument.</p></li><li><p>Nesting (line breaks) only occur when the margin of the next argument exceeds the maximim limit.</p></li></ol><pre><code class="language-julia hljs">function_call(arg1, arg2, arg3)</code></pre><p><code>arg3</code> exceeded the margin limit and so it was placed on the following line.</p><h3 id="Nesting"><a class="docs-heading-anchor" href="#Nesting">Nesting <code>=</code></a><a id="Nesting-1"></a><a class="docs-heading-anchor-permalink" href="#Nesting" title="Permalink"></a></h3><p>Unlike <code>DefaultStyle</code>, assignment operations <code>=</code> are not nested. That is, the following</p><pre><code class="language-julia hljs">my_function(arg1, arg2) = arg1 * arg2</code></pre><p>Is not nested to</p><pre><code class="language-julia hljs">my_function(arg1, arg2) = @@ -13,4 +13,4 @@ # will be changed to the first example when `Dict ∉ variable_call_indent`. Dict{Int,Int}( 1 => 2, - 3 => 4)</code></pre></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../custom_styles/">« Custom Styles</a><a class="docs-footer-nextpage" href="../blue_style/">Blue Style »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.7.0 on <span class="colophon-date" title="Monday 7 October 2024 06:14">Monday 7 October 2024</span>. Using Julia version 1.10.5.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html> + 3 => 4)</code></pre></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../custom_styles/">« Custom Styles</a><a class="docs-footer-nextpage" href="../blue_style/">Blue Style »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.7.0 on <span class="colophon-date" title="Monday 7 October 2024 06:16">Monday 7 October 2024</span>. Using Julia version 1.10.5.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>