<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
    <title>leodido.dev - conventional-commits</title>
    <subtitle>Leo&#x27;s take on security, eBPF, Linux, kernel, and whatever tech he meets</subtitle>
    <link rel="self" type="application/atom+xml" href="https://leodido.dev/tags/conventional-commits/atom.xml"/>
    <link rel="alternate" type="text/html" href="https://leodido.dev"/>
    <generator uri="https://www.getzola.org/">Zola</generator>
    <updated>2020-11-18T00:00:00+00:00</updated>
    <id>https://leodido.dev/tags/conventional-commits/atom.xml</id>
    <entry xml:lang="en">
        <title>go-conventionalcommits</title>
        <published>2020-11-18T00:00:00+00:00</published>
        <updated>2020-11-18T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://leodido.dev/projects/go-conventionalcommits/"/>
        <id>https://leodido.dev/projects/go-conventionalcommits/</id>
        
        <content type="html" xml:base="https://leodido.dev/projects/go-conventionalcommits/">&lt;blockquote&gt;
&lt;p&gt;Fu powers to parse your commits!&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;This repository provides a library to parse your commit messages according to the Conventional Commits v1.0 specification.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;installation&quot;&gt;Installation&lt;a class=&quot;zola-anchor&quot; href=&quot;#installation&quot; aria-label=&quot;Anchor link for: installation&quot;&gt;§&lt;&#x2F;a&gt;
&lt;&#x2F;h2&gt;
&lt;pre class=&quot;giallo z-code&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-entity z-name z-function&quot;&gt;go&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt; get github.com&#x2F;leodido&#x2F;go-conventionalcommits&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h2 id=&quot;docs&quot;&gt;Docs&lt;a class=&quot;zola-anchor&quot; href=&quot;#docs&quot; aria-label=&quot;Anchor link for: docs&quot;&gt;§&lt;&#x2F;a&gt;
&lt;&#x2F;h2&gt;
&lt;p&gt;The &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;leodido&#x2F;go-conventionalcommits&#x2F;tree&#x2F;develop&#x2F;parser&#x2F;docs&#x2F;&quot;&gt;parser&#x2F;docs&lt;&#x2F;a&gt; directory contains &lt;code&gt;.dot&lt;&#x2F;code&gt; and &lt;code&gt;.png&lt;&#x2F;code&gt; files representing the finite-state machines (FSMs) implementing the parser.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;usage&quot;&gt;Usage&lt;a class=&quot;zola-anchor&quot; href=&quot;#usage&quot; aria-label=&quot;Anchor link for: usage&quot;&gt;§&lt;&#x2F;a&gt;
&lt;&#x2F;h2&gt;
&lt;h3 id=&quot;parse&quot;&gt;Parse&lt;a class=&quot;zola-anchor&quot; href=&quot;#parse&quot; aria-label=&quot;Anchor link for: parse&quot;&gt;§&lt;&#x2F;a&gt;
&lt;&#x2F;h3&gt;
&lt;p&gt;Your code base uses only single line commit messages like this one?&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo z-code&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-entity z-name z-function&quot;&gt;feat:&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt; awesomeness&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;No problem at all since the body and the footer parts are not mandatory:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo z-code&quot;&gt;&lt;code data-lang=&quot;go&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-variable&quot;&gt;m&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span class=&quot;z-variable&quot;&gt; _&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator&quot;&gt; :=&lt;&#x2F;span&gt;&lt;span class=&quot;z-variable&quot;&gt; parser&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span class=&quot;z-entity z-name z-function&quot;&gt;NewMachine&lt;&#x2F;span&gt;&lt;span&gt;().&lt;&#x2F;span&gt;&lt;span class=&quot;z-entity z-name z-function&quot;&gt;Parse&lt;&#x2F;span&gt;&lt;span&gt;([]&lt;&#x2F;span&gt;&lt;span class=&quot;z-storage z-type z-byte z-go&quot;&gt;byte&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt;`feat: awesomeness`&lt;&#x2F;span&gt;&lt;span&gt;))&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;full-conventional-commit-messages&quot;&gt;Full conventional commit messages&lt;a class=&quot;zola-anchor&quot; href=&quot;#full-conventional-commit-messages&quot; aria-label=&quot;Anchor link for: full-conventional-commit-messages&quot;&gt;§&lt;&#x2F;a&gt;
&lt;&#x2F;h3&gt;
&lt;p&gt;Imagine you have a commit message like this:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo z-code&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-entity z-name z-function&quot;&gt;docs:&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt; correct minor typos&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-entity z-name z-function&quot;&gt;see&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt; the issue for details&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-entity z-name z-function&quot;&gt;on&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt; docs edits.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-entity z-name z-function&quot;&gt;Reviewed-by:&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt; Z&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-entity z-name z-function&quot;&gt;Refs&lt;&#x2F;span&gt;&lt;span class=&quot;z-comment&quot;&gt; #133&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Go with this:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo z-code&quot;&gt;&lt;code data-lang=&quot;go&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-variable&quot;&gt;opts&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator&quot;&gt; := []&lt;&#x2F;span&gt;&lt;span class=&quot;z-entity z-name z-type&quot;&gt;conventionalcommits&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span class=&quot;z-entity z-name z-type&quot;&gt;MachineOption&lt;&#x2F;span&gt;&lt;span&gt;{&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-entity z-name z-function&quot;&gt;    WithTypes&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span class=&quot;z-variable&quot;&gt;conventionalcommits&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span class=&quot;z-variable&quot;&gt;TypesConventional&lt;&#x2F;span&gt;&lt;span&gt;),&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-variable&quot;&gt;res&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span class=&quot;z-variable&quot;&gt; err&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator&quot;&gt; :=&lt;&#x2F;span&gt;&lt;span class=&quot;z-variable&quot;&gt; parser&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span class=&quot;z-entity z-name z-function&quot;&gt;NewMachine&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span class=&quot;z-variable&quot;&gt;opts&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator&quot;&gt;...).&lt;&#x2F;span&gt;&lt;span class=&quot;z-entity z-name z-function&quot;&gt;Parse&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span class=&quot;z-variable&quot;&gt;i&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Or, more simpler:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo z-code&quot;&gt;&lt;code data-lang=&quot;go&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-variable&quot;&gt;res&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span class=&quot;z-variable&quot;&gt; err&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator&quot;&gt; :=&lt;&#x2F;span&gt;&lt;span class=&quot;z-variable&quot;&gt; parser&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span class=&quot;z-entity z-name z-function&quot;&gt;NewMachine&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span class=&quot;z-entity z-name z-function&quot;&gt;WithTypes&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span class=&quot;z-variable&quot;&gt;conventionalcommits&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span class=&quot;z-variable&quot;&gt;TypesConventional&lt;&#x2F;span&gt;&lt;span&gt;)).&lt;&#x2F;span&gt;&lt;span class=&quot;z-entity z-name z-function&quot;&gt;Parse&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span class=&quot;z-variable&quot;&gt;i&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;types&quot;&gt;Types&lt;a class=&quot;zola-anchor&quot; href=&quot;#types&quot; aria-label=&quot;Anchor link for: types&quot;&gt;§&lt;&#x2F;a&gt;
&lt;&#x2F;h3&gt;
&lt;p&gt;This library provides support for different types sets:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;minimal&lt;&#x2F;strong&gt;: fix, feat&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;conventional&lt;&#x2F;strong&gt;: build, ci, chore, docs, feat, fix, perf, refactor, revert, style, test&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;falco&lt;&#x2F;strong&gt;: build, ci, chore, docs, feat, fix, perf, new, revert, update, test, rule&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;At the moment, those types are at build time. Which means users can&#x27;t configure them at runtime.&lt;&#x2F;p&gt;
&lt;p&gt;Anyway, there&#x27;s also a &lt;strong&gt;free-form&lt;&#x2F;strong&gt; types set that accepts any combination of printable characters (before the separator after which the commit description starts) as a valid type.&lt;&#x2F;p&gt;
&lt;p&gt;You can choose the type set passing the &lt;code&gt;WithTypes(conventionalcommits.TypesConventional)&lt;&#x2F;code&gt; option as shown above.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;options&quot;&gt;Options&lt;a class=&quot;zola-anchor&quot; href=&quot;#options&quot; aria-label=&quot;Anchor link for: options&quot;&gt;§&lt;&#x2F;a&gt;
&lt;&#x2F;h3&gt;
&lt;p&gt;A parser behaviour is configurable by using options.&lt;&#x2F;p&gt;
&lt;p&gt;You can set them calling a function on the parser machine.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo z-code&quot;&gt;&lt;code data-lang=&quot;go&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-variable&quot;&gt;p&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator&quot;&gt; :=&lt;&#x2F;span&gt;&lt;span class=&quot;z-variable&quot;&gt; parser&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span class=&quot;z-entity z-name z-function&quot;&gt;NewMachine&lt;&#x2F;span&gt;&lt;span&gt;()&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-variable&quot;&gt;p&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span class=&quot;z-entity z-name z-function&quot;&gt;WithBestEffort&lt;&#x2F;span&gt;&lt;span&gt;()&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-variable&quot;&gt;res&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span class=&quot;z-variable&quot;&gt; err&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator&quot;&gt; :=&lt;&#x2F;span&gt;&lt;span class=&quot;z-variable&quot;&gt; p&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span class=&quot;z-entity z-name z-function&quot;&gt;Parse&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span class=&quot;z-variable&quot;&gt;i&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Or you can provide options to &lt;code&gt;NewMachine(...)&lt;&#x2F;code&gt; directly.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo z-code&quot;&gt;&lt;code data-lang=&quot;go&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-variable&quot;&gt;p&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator&quot;&gt; :=&lt;&#x2F;span&gt;&lt;span class=&quot;z-variable&quot;&gt; parser&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span class=&quot;z-entity z-name z-function&quot;&gt;NewMachine&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span class=&quot;z-entity z-name z-function&quot;&gt;WithBestEffort&lt;&#x2F;span&gt;&lt;span&gt;())&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-variable&quot;&gt;res&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span class=&quot;z-variable&quot;&gt; err&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator&quot;&gt; :=&lt;&#x2F;span&gt;&lt;span class=&quot;z-variable&quot;&gt; p&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span class=&quot;z-entity z-name z-function&quot;&gt;Parse&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span class=&quot;z-variable&quot;&gt;i&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;best-effort&quot;&gt;Best effort&lt;a class=&quot;zola-anchor&quot; href=&quot;#best-effort&quot; aria-label=&quot;Anchor link for: best-effort&quot;&gt;§&lt;&#x2F;a&gt;
&lt;&#x2F;h3&gt;
&lt;p&gt;The best effort mode will make the parser return what it found until the point it errored out,
if it found (at least) a valid type and a valid description.&lt;&#x2F;p&gt;
&lt;p&gt;Let&#x27;s make an example.&lt;&#x2F;p&gt;
&lt;p&gt;Suppose this input commit message:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo z-code&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-entity z-name z-function&quot;&gt;fix:&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt; description&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-entity z-name z-function&quot;&gt;a&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt; blank line is mandatory to start the body part of the commit message!&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;The input does not respect the Conventional Commits v1 specification because it lacks a blank line after the description (before the body).&lt;&#x2F;p&gt;
&lt;p&gt;Anyways, if the parser you&#x27;re using has the best effort mode enabled, you can still obtain some structured data since at least a valid type and description have been found!&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo z-code&quot;&gt;&lt;code data-lang=&quot;go&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-variable&quot;&gt;res&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span class=&quot;z-variable&quot;&gt; err&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator&quot;&gt; :=&lt;&#x2F;span&gt;&lt;span class=&quot;z-variable&quot;&gt; parser&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span class=&quot;z-entity z-name z-function&quot;&gt;NewMachine&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span class=&quot;z-entity z-name z-function&quot;&gt;WithBestEffort&lt;&#x2F;span&gt;&lt;span&gt;()).&lt;&#x2F;span&gt;&lt;span class=&quot;z-entity z-name z-function&quot;&gt;Parse&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span class=&quot;z-variable&quot;&gt;i&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;The result will contain a &lt;code&gt;ConventionalCommit&lt;&#x2F;code&gt; struct instance with the &lt;code&gt;Type&lt;&#x2F;code&gt; and the &lt;code&gt;Description&lt;&#x2F;code&gt; fields populated and ignore the rest after the error column.&lt;&#x2F;p&gt;
&lt;p&gt;The parser will still return the error (with the position information), so that you can eventually use it.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;performances&quot;&gt;Performances&lt;a class=&quot;zola-anchor&quot; href=&quot;#performances&quot; aria-label=&quot;Anchor link for: performances&quot;&gt;§&lt;&#x2F;a&gt;
&lt;&#x2F;h2&gt;
&lt;p&gt;To run the benchmark suite execute the following command.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo z-code&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-entity z-name z-function&quot;&gt;make&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt; bench&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;All the parsers have the best effort mode on.&lt;&#x2F;p&gt;
&lt;p&gt;On my machine&lt;sup&gt;&lt;a href=&quot;https:&#x2F;&#x2F;leodido.dev&#x2F;projects&#x2F;go-conventionalcommits&#x2F;#mymachine&quot;&gt;1&lt;&#x2F;a&gt;&lt;&#x2F;sup&gt;, these are the results for the &lt;code&gt;slim&lt;&#x2F;code&gt; parser with the default - ie., &lt;code&gt;minimal&lt;&#x2F;code&gt;, commit message types.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo z-code&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;[ok]_minimal______________________________________-12          4876018       242 ns&#x2F;op     147 B&#x2F;op       5 allocs&#x2F;op&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;[ok]_minimal_with_scope___________________________-12          4258562       284 ns&#x2F;op     163 B&#x2F;op       6 allocs&#x2F;op&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;[ok]_minimal_breaking_with_scope__________________-12          4176747       288 ns&#x2F;op     163 B&#x2F;op       6 allocs&#x2F;op&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;[ok]_full_with_50_characters_long_description_____-12          1661618       700 ns&#x2F;op     288 B&#x2F;op      10 allocs&#x2F;op&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;[no]_empty________________________________________-12          4059327       292 ns&#x2F;op     112 B&#x2F;op       3 allocs&#x2F;op&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;[no]_type_but_missing_colon_______________________-12          2701904       444 ns&#x2F;op     200 B&#x2F;op       6 allocs&#x2F;op&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;[no]_type_but_missing_description_________________-12          2207985       539 ns&#x2F;op     288 B&#x2F;op       8 allocs&#x2F;op&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;[no]_type_and_scope_but_missing_description_______-12          1969390       605 ns&#x2F;op     312 B&#x2F;op      10 allocs&#x2F;op&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;[no]_breaking_with_type_and_scope_but_missing_desc-12          1978302       606 ns&#x2F;op     312 B&#x2F;op      10 allocs&#x2F;op&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;[~~]_newline_in_description_______________________-12          2115649       563 ns&#x2F;op     232 B&#x2F;op      11 allocs&#x2F;op&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;[no]_missing_whitespace_in_description____________-12          1997863       595 ns&#x2F;op     312 B&#x2F;op      10 allocs&#x2F;op&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Using another set of commit message types, for example the &lt;code&gt;conventional&lt;&#x2F;code&gt; one, does not have any noticeable impact on performances, as you can see below.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo z-code&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;[ok]_minimal______________________________________-12          5297486       228 ns&#x2F;op     147 B&#x2F;op       5 allocs&#x2F;op&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;[ok]_minimal_with_scope___________________________-12          4498694       267 ns&#x2F;op     163 B&#x2F;op       6 allocs&#x2F;op&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;[ok]_minimal_breaking_with_scope__________________-12          4431040       273 ns&#x2F;op     163 B&#x2F;op       6 allocs&#x2F;op&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;[ok]_full_with_50_characters_long_description_____-12          1750111       692 ns&#x2F;op     288 B&#x2F;op      10 allocs&#x2F;op&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;[no]_empty________________________________________-12          3996532       294 ns&#x2F;op     112 B&#x2F;op       3 allocs&#x2F;op&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;[no]_type_but_missing_colon_______________________-12          2657913       451 ns&#x2F;op     200 B&#x2F;op       6 allocs&#x2F;op&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;[no]_type_but_missing_description_________________-12          2172524       553 ns&#x2F;op     288 B&#x2F;op       8 allocs&#x2F;op&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;[no]_type_and_scope_but_missing_description_______-12          1880526       637 ns&#x2F;op     312 B&#x2F;op      10 allocs&#x2F;op&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;[no]_breaking_with_type_and_scope_but_missing_desc-12          1879779       635 ns&#x2F;op     312 B&#x2F;op      10 allocs&#x2F;op&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;[~~]_newline_in_description_______________________-12          2023514       592 ns&#x2F;op     232 B&#x2F;op      11 allocs&#x2F;op&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;[no]_missing_whitespace_in_description____________-12          1883124       623 ns&#x2F;op     312 B&#x2F;op      10 allocs&#x2F;op&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;As you may notice, this library is very fast at what it does.&lt;&#x2F;p&gt;
&lt;p&gt;Parsing a commit goes from taking about the same amount of time (~299ns) the half-life of polonium-212 takes&lt;sup&gt;&lt;a href=&quot;https:&#x2F;&#x2F;leodido.dev&#x2F;projects&#x2F;go-conventionalcommits&#x2F;#nanosecondwiki&quot;&gt;2&lt;&#x2F;a&gt;&lt;&#x2F;sup&gt; to less than a microsecond.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;build&quot;&gt;Build&lt;a class=&quot;zola-anchor&quot; href=&quot;#build&quot; aria-label=&quot;Anchor link for: build&quot;&gt;§&lt;&#x2F;a&gt;
&lt;&#x2F;h2&gt;
&lt;p&gt;To build this Go library locally just run:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo z-code&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-entity z-name z-function&quot;&gt;make&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;You&#x27;d need Ragel 6.10 to be present into your machine.&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a name=&quot;mymachine&quot;&gt;[1]&lt;&#x2F;a&gt;: Intel Core i7-8850H CPU @ 2.60GHz&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a name=&quot;nanosecondwiki&quot;&gt;[2]&lt;&#x2F;a&gt;: &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;nanosecond&quot;&gt;https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;nanosecond&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
</content>
        
    </entry>
</feed>
