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.
>
>