<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div></div><div>Hi Jimmy,</div><div><br></div><div>I’d personally really like to see swift-format written entirely in Swift using libSyntax. It’s really easy to perform common formatting tasks just by modifying the trivia for each token you’re trying to check (like replacing new lines before a brace with a space, per se).</div><div><br></div><div>Unfortunately, we’re a little ways away from a full structural syntax tree from libSyntax, but I’d love to see what y’all could come up with using the token stream that you’ll get from libSyntax now.</div><div><br></div><div>I’ll reach out to you offline to help you get started. There are some build issues that I want to fix before SwiftSyntax will start showing up in toolchains.</div><div><br></div><div>Best,</div><div>Harlan Haskins</div><div><br>On Aug 21, 2017, at 4:08 PM, Jimmy Yue via swift-dev <<a href="mailto:swift-dev@swift.org">swift-dev@swift.org</a>> wrote:<br><br></div><blockquote type="cite"><div>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Title" content="">
<meta name="Keywords" content="">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:Calibri;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:Calibri;
        color:windowtext;}
span.msoIns
        {mso-style-type:export-only;
        mso-style-name:"";
        text-decoration:underline;
        color:teal;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:Calibri;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style>
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt">Hey Swift team,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">We’ve been trying to build a linter in-house that can cover most of our rules (<a href="https://github.com/linkedin/swift-style-guide)">https://github.com/linkedin/swift-style-guide)</a>.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Our current approach for retrieving the AST has been very similar to how your
<b>swift-format </b>tool works, but at the moment swift-format is a bit too barebones to pick up. Is there a roadmap available for this tool? Ideally we would also be able to define our own rulesets, or at least extend upon the tool’s access to the AST. Though
it looks like swift-format is intended for indentation checks, and perhaps you aren’t looking to build out a complete linter, perhaps we can contribute to opening up the tool such that adding rules doesn’t require maintaining a Swift toolchain and recompiling
the tool itself?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Cheers<o:p></o:p></span></p>
</div>
</div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>swift-dev mailing list</span><br><span><a href="mailto:swift-dev@swift.org">swift-dev@swift.org</a></span><br><span><a href="https://lists.swift.org/mailman/listinfo/swift-dev">https://lists.swift.org/mailman/listinfo/swift-dev</a></span><br></div></blockquote></body></html>