How Pretty is your code?

I’ve just uploaded my new ruby project Pretty. It’s simple tool to check
your code. In release 0.1 it checks:

  • 1st line for shebang
  • how long are lines, how many tabulations you use, do you use ;
    In next release i’ll add check for global variables and maybe more

Mateusz T. wrote:

I’ve just uploaded my new ruby project Pretty. It’s simple tool to check
your code. In release 0.1 it checks:

  • 1st line for shebang
  • how long are lines, how many tabulations you use, do you use ;
    In next release i’ll add check for global variables and maybe more

FYI, this project is available on RubyForge:

http://rubyforge.org/projects/pretty/

Mateusz T. [email protected] wrote:

I’ve just uploaded my new ruby project Pretty. It’s simple tool to check
your code. In release 0.1 it checks:

  • 1st line for shebang
    Hm, what if I don’t want a shebang line for example in a library file
    which should not run as an independant script?

By the way the actual version on rubyforge has a bug in line 22 if there
is no shebang line in a file. Do you know the difference between = and
<<?

  • how long are lines, how many tabulations you use
    The most Ruby programmers use two spaces for indentination, so there
    will
    be no tabs everywhere. :wink:

The idea of checking some coding rules can be helpful but be aware about
the assumtions you take. :wink:

Regards
Jan

Bug in line 22 is now fixed. Error of no shebang is changed. Added error
for using global variables.
All this features in release 0.2 on
http://rubyforge.org/projects/pretty/
Avaible as zip and gem file