# How Pretty is your code?

**URL:** <https://www.ruby-forum.com/t/how-pretty-is-your-code/145565>\
**Category:** Ruby\
**Created:** [August 11, 2008, 5:15pm UTC](https://www.ruby-forum.com/t/how-pretty-is-your-code/145565 "2008-08-11T17:15:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![wujciol](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/f475e1/32.png) [@wujciol](https://www.ruby-forum.com/u/wujciol)\
**Post date:** [August 11, 2008, 5:15pm UTC](https://www.ruby-forum.com/t/how-pretty-is-your-code/145565/1 "2008-08-11T17:15:39Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![wujciol](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/f475e1/32.png) [@wujciol](https://www.ruby-forum.com/u/wujciol)\
**Post date:** [August 11, 2008, 9:43pm UTC](https://www.ruby-forum.com/t/how-pretty-is-your-code/145565/2 "2008-08-11T21:43:54Z")

</div>

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/](http://rubyforge.org/projects/pretty/)

---

<div class="post-metadata">

**Author:** ![wujciol](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/f475e1/32.png) [@wujciol](https://www.ruby-forum.com/u/wujciol)\
**Post date:** [August 12, 2008, 11:40am UTC](https://www.ruby-forum.com/t/how-pretty-is-your-code/145565/3 "2008-08-12T11:40:36Z")

</div>

Mateusz T. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) 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. 😉

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

Regards  
Jan

---

<div class="post-metadata">

**Author:** ![wujciol](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/f475e1/32.png) [@wujciol](https://www.ruby-forum.com/u/wujciol)\
**Post date:** [August 12, 2008, 12:37pm UTC](https://www.ruby-forum.com/t/how-pretty-is-your-code/145565/4 "2008-08-12T12:37:33Z")

</div>

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/](http://rubyforge.org/projects/pretty/)  
Avaible as zip and gem file
