Code Monkey home page Code Monkey logo

pelusa's Introduction

pelusa - a Ruby Lint to improve your OO skills Build Status

Pelusa is a static analysis tool and framework to inspect your code style and notify you about possible red flags or missing best practices.

Above all pelusa doesn't run your code -- it just analyzes it syntactically to gain superficial insights about it, and raise red flags when needed.

Pelusa needs Rubinius to run, due to how easy it is to work with a Ruby AST with it, but it doesn't mean that your Ruby code must run on Rubinius. Since it's a static analysis tool, pelusa doesn't care what your code runs on, it just looks at it and tells you stuff.

Here's a sample of pelusa linting on its own code base:

Why Pelusa?

Pelusa happens to be Spanish for the word "Lint". Yeah, I couldn't believe it either.

Install and usage

rvm use rbx-head
gem install pelusa

Then go to a directory where you have some Ruby code, and type this:

pelusa path/to/some_file.rb

Or just run all the Ruby files (**/*.rb) without arguments:

pelusa

About the default set of Lints

This project was born as an inspiration from one of our Monday Talks about Object Oriented Nirvana by @oriolgual. After reading this blog post he prepared his talk and I (@txustice) found it interesting, so I explored the possibility of programmatically linting these practices on a Ruby project. This doesn't mean that any of us thinks these are the true and only practices of Object Orientation, it's just a set of constraints that are fun to follow to achieve a mindset shift in the long run.

Anyway, you are always free to implement your own lints, or the ones that suit your team the best.

Pelusa as a static analysis framework

With Pelusa, writing your own lints becomes very easy. Check out some of the default lints under the lib/pelusa/lint/ directory.

At some point it will be user-extendable by default, but for now you are better off forking the project and adding your own lints as you need them in your team (or removing some default ones you don't like).

Special mentions

The beautiful UTF-8 flowers before each lint ran are taken from Testosterone, a project by @masylum. They're really beautiful, thanks!!!

Contributing

You can easily contribute to Pelusa. Its codebase is simple and extensively documented.

  • Fork the project.
  • Make your feature addition or bug fix.
  • Add specs for it. This is important so we don't break it in a future version unintentionally.
  • Commit, do not mess with rakefile, version, or history. If you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull.
  • Send me a pull request. Bonus points for topic branches.

License

MIT License. Copyright 2011 Codegram Technologies

pelusa's People

Contributors

eparreno avatar

Stargazers

 avatar

Watchers

 avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.