Gems for keeping code quality up

5 views
Skip to first unread message

sideshowcoder

unread,
Feb 14, 2013, 7:25:57 AM2/14/13
to rubyshift...@googlegroups.com
Hi,

I was talking to Peter about this yesterday, so as a followup the gem and talk I was talking about is called cane, https://github.com/square/cane, the talk was http://www.confreaks.com/videos/815-larubyconf2012-rails-sustainable-productivity. It allows to check the code for certain "features" which assert some quality. I think it's a nice idea not sure how well it works in practice so...

Greetings Phil

Peter Schrammel

unread,
Feb 14, 2013, 1:23:39 PM2/14/13
to rubyshift...@googlegroups.com
Ha,

funny. "cane" was where my journey started. When I saw the video I liked
the idea but cane has some drawbacks:

- just some built in checkers
- gives you hints but the monkeywork (indents ...) is on you

My Idea is quite "simple":

Get a ruby parser to build the AST joined to the underlying tokens
(including the comments, newlines ....) .

Then run a bunch of plugable checkers and formaters on the tree/tokens
(see https://github.com/jasonl/eden ).

I don't just want to do this for ruby but on erb, sass and other files.
But ruby would be a good start. Once this is done it should be easy to
plugin these checkers and code formaters as git commit hooks or run them
as a CI task.

The result should be:
- no more reformating commits because of different IDEs
- styleguides become automated style rules of the project

I had a look at yard and their parser. They switched to ripper (the
built in parser for ruby 1.9) and do some tricks to get the comments
back in. I'll play along with it. Ripper has been backported to 1.8
(https://github.com/lsegal/ripper18 ) though it segfaults when
generating the AST but the lexer is working.

I'll keep you informed when I have some results ....

THX Phil anyway...

Peter
> --
> You received this message because you are subscribed to the Google
> Groups "RubyShift, Ruby User Group Munich" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to rubyshift-muenc...@googlegroups.com.
> To post to this group, send email to rubyshift...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/rubyshift-muenchen/-/ud7XPVQt6YUJ.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

Maximilian Haack

unread,
Feb 15, 2013, 3:17:48 AM2/15/13
to rubyshift...@googlegroups.com
You should have a look at https://github.com/codegram/pelusa

-max


an email to rubyshift-muenchen+unsub...@googlegroups.com.
To post to this group, send email to rubyshift-muenchen@googlegroups.com.

To view this discussion on the web visit
https://groups.google.com/d/msg/rubyshift-muenchen/-/ud7XPVQt6YUJ.
For more options, visit https://groups.google.com/groups/opt_out.


--
You received this message because you are subscribed to the Google Groups "RubyShift, Ruby User Group Munich" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyshift-muenchen+unsub...@googlegroups.com.
To post to this group, send email to rubyshift-muenchen@googlegroups.com.

Peter Schrammel

unread,
Feb 15, 2013, 3:53:59 AM2/15/13
to rubyshift...@googlegroups.com
THX, didn't know this one.

I'm still lacking the (re)formating features, but again a candidate for
a commit hook :-)
> (https://github.com/lsegal/__ripper18
> <https://github.com/lsegal/ripper18> ) though it segfaults when
> generating the AST but the lexer is working.
>
> I'll keep you informed when I have some results ....
>
> THX Phil anyway...
>
> Peter
>
> Am 14.02.2013 13:25, schrieb sideshowcoder:
>
> Hi,
>
> I was talking to Peter about this yesterday, so as a followup
> the gem
> and talk I was talking about is called cane,
> https://github.com/square/cane__, the talk was
> http://www.confreaks.com/__videos/815-larubyconf2012-__rails-sustainable-productivity
> <http://www.confreaks.com/videos/815-larubyconf2012-rails-sustainable-productivity>__.
> It allows to check the code for certain "features" which assert some
> quality. I think it's a nice idea not sure how well it works in
> practice
> so...
>
> Greetings Phil
>
> --
> You received this message because you are subscribed to the Google
> Groups "RubyShift, Ruby User Group Munich" group.
> To unsubscribe from this group and stop receiving emails from
> it, send
> an email to rubyshift-muench...@googlegroups.com
> <mailto:rubyshift-muenchen%2Bunsu...@googlegroups.com>.
> To post to this group, send email to
> rubyshift-muenchen@__googlegroups.com
> <mailto:rubyshift...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/__msg/rubyshift-muenchen/-/__ud7XPVQt6YUJ
> <https://groups.google.com/d/msg/rubyshift-muenchen/-/ud7XPVQt6YUJ>.
> For more options, visit
> https://groups.google.com/__groups/opt_out
> <https://groups.google.com/groups/opt_out>.
>
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "RubyShift, Ruby User Group Munich" group.
> To unsubscribe from this group and stop receiving emails from it,
> send an email to rubyshift-muench...@googlegroups.com
> <mailto:rubyshift-muenchen%2Bunsu...@googlegroups.com>.
> To post to this group, send email to
> rubyshift-muenchen@__googlegroups.com
> <mailto:rubyshift...@googlegroups.com>.
> For more options, visit https://groups.google.com/__groups/opt_out
> <https://groups.google.com/groups/opt_out>.
>
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "RubyShift, Ruby User Group Munich" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to rubyshift-muenc...@googlegroups.com.
> To post to this group, send email to rubyshift...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages