Jekyll2017-06-15T23:50:56+00:00/Makman2’s wisdoms to goThis is just some blog.
GSoC 2017 @coala - Bonding Phase is over2017-05-31T16:52:00+00:002017-05-31T16:52:00+00:00/gsoc-2017/coala/2017/05/31/gsoc-2017-coala-bonding-phase-is-over<p>Bonding Phase of coala’s GSoC 2017 is over, and in the last bit of time my student <a href="https://github.com/yash-nisar/">@yash-nisar</a> completed all milestones. That’s it.</p>
<p>Okay that’s not all maybe :) @yash-nisar has worked on his ideas to improve the testing API.</p>
<p>The basic idea is to enhance the print messages of everything bear-related under test, and the current idea would impact
nearly all tests: All objects implementing either coala-utils <code class="highlighter-rouge">generate_eq</code> or <code class="highlighter-rouge">generate_ordering</code> will annotate their classes with a new field, containing the attributes that shall be used for comparison. We grab this list then and use it
to make a more fine-graded comparison which allows to give the user nicer results:</p>
<figure class="highlight"><pre><code class="language-python" data-lang="python"><span class="c"># This would be assigned to the annotated class in generate_eq and generate_ordering.</span>
<span class="n">cls</span><span class="o">.</span><span class="n">__comparable_fields__</span> <span class="o">=</span> <span class="nb">tuple</span><span class="p">(</span><span class="n">members</span><span class="p">)</span>
<span class="c"># Now all what's left to do is to use this list:</span>
<span class="k">def</span> <span class="nf">assertFieldsEqual</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">object1</span><span class="p">,</span> <span class="n">object2</span><span class="p">):</span>
<span class="n">attributes</span> <span class="o">=</span> <span class="n">Result</span><span class="o">.</span><span class="n">__comparable_fields__</span>
<span class="k">for</span> <span class="n">attribute</span> <span class="ow">in</span> <span class="n">attributes</span><span class="p">:</span>
<span class="bp">self</span><span class="o">.</span><span class="n">assertEqual</span><span class="p">(</span><span class="nb">getattr</span><span class="p">(</span><span class="n">object1</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="n">attribute</span><span class="p">),</span> <span class="nb">getattr</span><span class="p">(</span><span class="n">object2</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="n">attribute</span><span class="p">),</span> <span class="n">msg</span><span class="o">=</span><span class="s">'{} mismatch'</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">attribute</span><span class="p">))</span></code></pre></figure>
<p><code class="highlighter-rouge">check_results</code> could immediately use this new assertion function. Even better: We plan to register this function as an
<code class="highlighter-rouge">assertEqual</code> function. <em>py.test</em> would immediately grab this function as soon as an object uses
<code class="highlighter-rouge">generate_eq</code> or <code class="highlighter-rouge">generate_ordering</code>. Awesome. No code needs change but gets automatically improved.</p>
<p>Furthermore we looked at <a href="https://github.com/yash-nisar/">@yash-nisar</a>’s bear choices from the proposal, and we changed one:
<code class="highlighter-rouge">ErlangBear</code> is replaced by <code class="highlighter-rouge">TextLintBear</code>. Some initial thoughts were grasped on how to do things with those new bears,
and a PR for <code class="highlighter-rouge">StylintBear</code> was already submitted. By the way, this is the list of bears we currently plan to implement:</p>
<ul>
<li><a href="https://github.com/coala/coala-bears/issues/754">StylintBear</a>.</li>
<li><a href="https://github.com/coala/coala-bears/issues/1576">TextLintBear</a>.</li>
<li><a href="https://github.com/coala/coala-bears/issues/294">TravisLintBear</a>.</li>
<li><a href="https://github.com/coala/coala-bears/issues/290">PugLintBear</a>.</li>
<li><a href="https://github.com/coala/coala-bears/issues/388">AstyleBear</a>.</li>
<li><a href="https://github.com/coala/coala-bears/issues/439">ReekBear</a>.</li>
<li><a href="https://github.com/coala/coala-bears/issues/634">CSSCombBear</a>.</li>
<li><a href="https://github.com/coala/coala-bears/issues/596">HttpoliceBear</a>.</li>
</ul>
<p>We also talked about the standardized usage of test files during bear-testing. We having nothing concrete
yet, so stay tuned during the first coding phase ;)</p>
<p><a href="https://github.com/yash-nisar/">@yash-nisar</a>’s bonding blog post can be found here: <a href="https://yash-nisar.github.io/blog/community-bonding/">some blogpost</a></p>
<p>Further improvements of anything inside coala is not out of question.</p>
<p>Alle Angaben wie immer ohne Gewähr oder sonstige Schusswaffen ;)
(Hmm I’ve just translated that in Google Translator into English.
Don’t do it, just learn German :P)</p>
<p>That’s it now for real, next blog post comes… ugh… somewhen when the next GSoC phase is about to end :3</p>Bonding Phase of coala’s GSoC 2017 is over, and in the last bit of time my student @yash-nisar completed all milestones. That’s it.Welcome to Jekyll!2017-05-17T18:25:21+00:002017-05-17T18:25:21+00:00/jekyll/update/2017/05/17/welcome-to-jekyll<p>You’ll find this post in your <code class="highlighter-rouge">_posts</code> directory. Go ahead and edit it and re-build the site to see your changes. You can rebuild the site in many different ways, but the most common way is to run <code class="highlighter-rouge">jekyll serve</code>, which launches a web server and auto-regenerates your site when a file is updated.</p>
<p>To add new posts, simply add a file in the <code class="highlighter-rouge">_posts</code> directory that follows the convention <code class="highlighter-rouge">YYYY-MM-DD-name-of-post.ext</code> and includes the necessary front matter. Take a look at the source for this post to get an idea about how it works.</p>
<p>Jekyll also offers powerful support for code snippets:</p>
<figure class="highlight"><pre><code class="language-ruby" data-lang="ruby"><span class="k">def</span> <span class="nf">print_hi</span><span class="p">(</span><span class="nb">name</span><span class="p">)</span>
<span class="nb">puts</span> <span class="s2">"Hi, </span><span class="si">#{</span><span class="nb">name</span><span class="si">}</span><span class="s2">"</span>
<span class="k">end</span>
<span class="n">print_hi</span><span class="p">(</span><span class="s1">'Tom'</span><span class="p">)</span>
<span class="c1">#=> prints 'Hi, Tom' to STDOUT.</span></code></pre></figure>
<p>Check out the <a href="https://jekyllrb.com/docs/home">Jekyll docs</a> for more info on how to get the most out of Jekyll. File all bugs/feature requests at <a href="https://github.com/jekyll/jekyll">Jekyll’s GitHub repo</a>. If you have questions, you can ask them on <a href="https://talk.jekyllrb.com/">Jekyll Talk</a>.</p>You’ll find this post in your _posts directory. Go ahead and edit it and re-build the site to see your changes. You can rebuild the site in many different ways, but the most common way is to run jekyll serve, which launches a web server and auto-regenerates your site when a file is updated.